You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/asciidoc/microcontrollers/debug-probe/swd-connection.adoc
+12-13Lines changed: 12 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,12 @@
1
-
== Serial Wire Debug (SWD)
1
+
== Starting a Debug Session
2
2
3
-
Serial Wire Debug (SWD) is a two-pin interface (https://developer.arm.com/documentation/101761/1-0/Debug-and-trace-interface/Serial-Wire-Debug-signals[SWDIO and SWCLK]) alternative to the JTAG four- or five-pin debugging interface standard.
3
+
The Debug Probe will let you load binaries via the SWD port and OpenOCD: you will not need to unplug, and then push-and-hold, the BOOTSEL button every time you push a new binary to your Pico. Using the Debug Probe to upload new binaries is an entirely hands-off affair.
4
4
5
-
=== Uploading new programs to your Pico
5
+
GDB is then used to debug the binary running on the Pico.
6
6
7
-
The Pico Debug Probe will let you load binaries via the SWD port and OpenOCD: you will not need to unplug, and then push-and-hold, the BOOTSEL button every time you push a new binary to your Pico. Using the Debug Probe uploading new binaries is an entirely hands off affair.
7
+
We recommend the use of the Raspberry Pi Pico VSCode extension, which integrates the use of OpenOCD and GDB, to upload and debug programs. See Chapter 4 of https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf[Getting started with Raspberry Pi Pico] for more information.
NOTE: When you use the Debug Probe to upload a binary the ELF version of the file is used, not the UF2 file that you would use when you drag-and-drop.
17
19
18
-
=== Debugging with SWD
20
+
=== Standalone debug session
19
21
20
-
It'll also let you use `openocd` in server mode, and connect GDB, which gives you break points and "proper" debugging.
22
+
This will use `openocd` in server mode, and connect GDB, which gives you breakpoints and single-step over a console interface.
21
23
22
24
[IMPORTANT]
23
25
======
@@ -35,10 +37,12 @@ $ make -j4
35
37
----
36
38
37
39
In a debug build you will get more information when you run it under the debugger, as the compiler builds your program with the information to tell GDB what your program is doing.
38
-
39
-
See Chapter 6 of https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf[Getting started with Raspberry Pi Pico] for more information.
40
40
======
41
41
42
+
NOTE: For computers that are _not_ Raspberry Pis, a variant of GDB that can debug ARM processors is required. Use one of the following alternatives depending on your operating system and device:
43
+
* On Linux devices, use `gdb-multiarch`.
44
+
* On macOS and Windows devices, use `arm-none-eabi-gdb` from the toolchain on https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads[Arm's website]
45
+
42
46
To start an OpenOCD server, run the following command:
43
47
44
48
[source,console]
@@ -55,8 +59,3 @@ $ gdb blink.elf
55
59
> monitor reset init
56
60
> continue
57
61
----
58
-
59
-
GDB doesn't work on all platforms. Use one of the following alternatives instead of `gdb`, depending on your operating system and device:
60
-
61
-
* On Linux devices that are _not_ Raspberry Pis, use `gdb-multiarch`.
0 commit comments