summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-11-15 00:14:31 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-11-19 20:15:16 -0700
commit573b0f7d4d4a7e84ae8d1e4a7c0611dd9f513fa2 (patch)
treeb0396c6f2d721c7c31bcff68272e676662c3e510 /README.md
parent0011fcb2328cf387225a72eee7bdc3d8ea31d71d (diff)
README: Add notes about SWD
Diffstat (limited to 'README.md')
-rw-r--r--README.md103
1 files changed, 102 insertions, 1 deletions
diff --git a/README.md b/README.md
index 33c9cb8..2be841f 100644
--- a/README.md
+++ b/README.md
@@ -32,7 +32,108 @@ UART:
- pin1: gpio0: TX (so connect it to your FTDI's RX)
- pin2: gpio1: RX (so connect it to your FTDI's TX)
- pin3: gnd (so connect it to your FTDI's GND)
-- picocom --baud=115200 /dev/ttyUSB0
+- `picocom --baud=115200 /dev/ttyUSB0`
+- `picocom --baud=115200 /dev/ttyACM0`
+
+- `openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000"`
+- `arm-none-eabi-gdb ./build/rp2040/cmd/sbc_harness/sbc_harness.elf`
+ ```
+ target remote localhost:3333
+ monitor reset init
+ continue
+ ```
+
+SWD:
+- https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html
+- https://github.com/raspberrypi/debugprobe
+- https://developer.arm.com/documentation/101451/0100/About-CMSIS-DAP
+
+## Raspberry Pi 3-pin Debug Connector
+- https://datasheets.raspberrypi.com/debug/debug-connector-specification.pdf
+
+| Pin # | UART | ARM SW-DP | cJTAG (IEEE 1149.7) |
+|-------|----------------------|------------------------------------|----------------------------------|
+| 1 | RX (target←debugger) | SC/SWCLK (serial clock) | TMSC - Test Clock Control |
+| 2 | GND | GND | GND |
+| 3 | TX (target→debugger) | SD/SWDIO (bidi serial data) | TCKC - Test Master/Slave Control |
+| | | SWO (optional: serial wire output) | |
+
+## UART (Universal asynchronous receiver/transmitter)
+
+## ARM SWD (Serial Wire Debug)
+- https://developer.arm.com/documentation/101761/1-0/Debug-and-trace-interface/Serial-Wire-Debug-signals
+- https://developer.arm.com/documentation/ihi0031/a/The-Serial-Wire-Debug-Port--SW-DP-/Introduction-to-the-ARM-Serial-Wire-Debug--SWD--protocol
+- https://arm-software.github.io/CMSIS-DAP/latest/index.html
+- ADIv5: https://developer.arm.com/documentation/ihi0031/g/
+- ADIv6: https://developer.arm.com/documentation/ihi0074/e/
+
+Alternative to Raspberry Pi Debug Probe:
+https://oshwlab.com/wagiminator/samd11c-swd-programmer which uses
+https://github.com/ataradov/free-dap instead of ARM's reference CMSIS
+implementation
+
+Note that the RP2040 chip has a pure SW-DP (just speaks SWD), not a
+JTAG-DP (just speaks JTAG) or a SWJ-DP (can speak either SWD or JTAG).
+
+```
++-[Host PC]-------------------------+
+| |
+| +-----+ |
+| | GDB | |
+| +-----+ |
+| ^ |
+| | GDB Remote Serial Protocol
+| | on localhost:3333
+| V |
+| +---------+ |
+| | OpenOCD | |
+| +---------+ |
+| ^ |
+| | |
++-----------------|-----------------+
+ USB-A
+ |
+ | ARM CMSIS-DAP protocol
+ | (a USB-based protocol)
+ |
+ (micro)USB-B
+ +-[Debug Probe]-------+
+ | | |
+ | V |
+ | +----------------+ |
+ | | ARM's | |
+ | | reference | |
+ | | CMSIS-DAP | |
+ | | implementation | |
+ | +----------------+ |
+ | ^ |
+ | | |
+ +----------|----------+
+ SW-DP (3-pin JST-SH)
+ |
+ | ADIv5 SWD protocol
+ |
+ SW-DP (3 .1" headers)
++-[SBC-Harness]---|-----------------+
+| | |
+| ,---------------' |
+| | |
+| | +----------------------------+ |
+| | | Cortex-M0+ | |
+| | | +------------------------+ | |
+| +--->| CoreSight ADIv5 module | | |
+| | | +------------------------+ | |
+| | +----------------------------+ |
+| | |
+| | +----------------------------+ |
+| | | Cortex-M0+ | |
+| | | +------------------------+ | |
+| `--->| CoreSight ADIv5 module | | |
+| | +------------------------+ | |
+| +----------------------------+ |
+| |
++-----------------------------------+
+```
# Usage