@@ -82,8 +82,25 @@ Programming and Debugging
82
82
Flashing
83
83
========
84
84
85
- Using an SWD adapter
86
- --------------------
85
+ Using SEGGER JLink
86
+ ------------------
87
+
88
+ You can Flash the rpi_pico with a SEGGER JLink debug probe as described in
89
+ :ref: `Building, Flashing and Debugging <west-flashing >`.
90
+
91
+ Here is an example of building and flashing the :ref: `blinky-sample ` application.
92
+
93
+ .. zephyr-app-commands ::
94
+ :zephyr-app: samples/basic/blinky
95
+ :board: rpi_pico
96
+ :goals: build
97
+
98
+ .. code-block :: bash
99
+
100
+ west flash --runner jlink
101
+
102
+ Using OpenOCD
103
+ -------------
87
104
88
105
To use PicoProbe, You must configure **udev **.
89
106
@@ -96,15 +113,15 @@ Create a file in /etc/udev.rules.d with any name, and write the line below.
96
113
This example is valid for the case that the user joins to `plugdev ` groups.
97
114
98
115
The Raspberry Pi Pico has an SWD interface that can be used to program
99
- and debug the on board RP2040. This interface can be utilized by openocd .
116
+ and debug the on board RP2040. This interface can be utilized by OpenOCD .
100
117
However, to use it with the RP2040, `fork of OpenOCD supporting RP2040 `_ is needed.
101
118
102
119
If you are using Debian based system (including RaspberryPi OS, Ubuntu. and more),
103
120
using `pico_setup.sh `_ script is convenient to set up forked version of OpenOCD.
104
121
105
122
Depending on the interface used (such as JLink), you might need to
106
123
checkout to a branch that supports this interface, before proceeding.
107
- Build and install openocd as described in the README.
124
+ Build and install OpenOCD as described in the README.
108
125
109
126
Here is an example of building and flashing the :ref: `blinky-sample ` application.
110
127
@@ -115,7 +132,7 @@ Here is an example of building and flashing the :ref:`blinky-sample` application
115
132
:gen-args: -DOPENOCD=/usr/local/bin/openocd -DOPENOCD_DEFAULT_PATH=/usr/local/share/openocd/scripts -DRPI_PICO_DEBUG_ADAPTER=picoprobe
116
133
117
134
Set `/usr/local/bin/openocd ` to **OPENOCD ** and `/usr/local/share/openocd/scripts ` to **OPENOCD_DEFAULT_PATH ** will works
118
- with openocd that install with default configuration.
135
+ with OpenOCD that install with default configuration.
119
136
This configuration also works with an environment that is set up by `pico_setup.sh `_ script.
120
137
121
138
**RPI_PICO_DEBUG_ADAPTER ** specifies what debug adapter is used for debugging.
@@ -128,11 +145,11 @@ Any other SWD debug adapter maybe also work with this configuration.
128
145
So you can omit the option in `west flash ` and `west debug ` execution,
129
146
you need only the `west build ` case.
130
147
131
- **RPI_PICO_DEBUG_ADAPTER ** is used in an argument to openocd as `"source [find interface/${RPI_PICO_DEBUG_ADAPTER}.cfg]" `.
148
+ **RPI_PICO_DEBUG_ADAPTER ** is used in an argument to OpenOCD as `"source [find interface/${RPI_PICO_DEBUG_ADAPTER}.cfg]" `.
132
149
Thus, **RPI_PICO_DEBUG_ADAPTER ** needs to assign from the definition file name of debugging adapter.
133
150
134
151
You can also flash the board with the following
135
- command that directly call openocd (assuming JLink is used):
152
+ command that directly call OpenOCD (assuming a SEGGER JLink adapter is used):
136
153
137
154
.. code-block :: console
138
155
@@ -150,8 +167,20 @@ UF2 file should be drag-and-dropped to the device, which will flash the Pico.
150
167
Debugging
151
168
=========
152
169
153
- The SWD interface can also be used to debug the board. To achieve this,
154
- install openocd as described for flashing the board.
170
+ The SWD interface can also be used to debug the board. To achieve this, you can
171
+ either user SEGGER JLink or OpenOCD.
172
+
173
+ Using SEGGER JLink
174
+ ------------------
175
+
176
+ Use a SEGGER JLink debug probe and follow the instruction in
177
+ :ref: `Building, Flashing and Debugging<west-debugging> `.
178
+
179
+
180
+ Using OpenOCD
181
+ -------------
182
+
183
+ Install OpenOCD as described for flashing the board.
155
184
156
185
.. note ::
157
186
`fork of OpenOCD supporting RP2040 `_ does not provide ZephyrRTOS enhancement.
@@ -169,7 +198,7 @@ Here is an example for debugging the :ref:`blinky-sample` application.
169
198
As with flashing, you can specify the debug adapter by specifying **RPI_PICO_DEBUG_ADAPTER **
170
199
at `west build ` time. No needs to specify it at `west debug ` time.
171
200
172
- You can also debugging with openocd and gdb launching from command-line.
201
+ You can also debugging with OpenOCD and gdb launching from command-line.
173
202
Run the following command:
174
203
175
204
.. code-block :: console
0 commit comments