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
### Manual configuration of VSCode as Pico IDE (old)
61
+
## Pico Memory Flashing and Debugging via Pico Probe and OpenOCD
62
+
63
+
To work efficiently on the project, we need the ability to upload firmware to the microcontroller, debug, and communicate through the serial port. The Raspberry Pi Pico board itself allows for software uploads, but this process is not very convenient or efficient for larger projects. The Pico Probe extends the capabilities of the Raspberry Pi Pico board to include fast firmware uploads to the microcontroller's memory, debugging via Serial Wire Debug (SWD), and it also serves as a USB UART converter.
64
+
65
+
The Debug Probe is compatible with the CMSIS-DAP interface, allowing OpenOCD to be used as the debugger server. By using OpenOCD, it becomes possible to communicate between development containers and the Debug Probe via TCP. On Linux, the Docker container can communicate directly through COM ports. However, on Mac and Windows, this is not possible because Docker runs in a dedicated virtual machine that does not have access to COM ports. Therefore, a solution with the OpenOCD server on the host machine was chosen.
66
+
67
+
The diagram below shows the environment topology:
68
+
69
+
1. Pico Probe is connected to the Raspberry Pi Pico board:
70
+
71
+
- SWD (Serial Wire Debug) interface for debugging.
72
+
- UART (Universal Asynchronous Receiver/Transmitter) interface for serial communication.
73
+
74
+
2. The Pico Probe is connected to the PC via USB.
75
+
76
+
3. OpenOCD (Open On-Chip Debugger) runs on the PC and communicates with the Pico Probe.
77
+
78
+
4. The development container (devContainer) connects to OpenOCD via TCP.
5. Make a debug build. Go to the CMake extension tab (1), click "Select Variant" (2), and choose "Debug" build (3). Start the build (4). If the build completes successfully, you can proceed to flashing the memory and debugging.
6. To start a debug session, first add a breakpoint in the main function. Next, go to the debugger extension tab (1), and click "Play" (2). The debug session starts by flashing the Pico's memory and restarting the microcontroller. After the reset, the flashed firmware starts and the program should stop at the breakpoint.
0 commit comments