Debug over SWD #10705
Replies: 2 comments 6 replies
-
A bit more information ... If I run picotool on the unresponsive elf file I get the following i.e. it seems fine but I am not able to connect to it via USB or serial. picotool info -a ~/micropython/ports/rp2/build-PICO/firmware.elf Program Information Fixed Pin Information Build Information |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to get a programming and debug workflow set up that does not use USB. I am stuck trying to get the REPL over serial.
For SWD I am using a Raspberry Pi4 as my development environment and the tool chain uses openocd to connect to the SWD pins on the RP2040. I have confirmed that this works and can push firmware elf files into the RP2040 and interact with a debugger (gdb-multiarch).
For REPL I have the RP2040 serial port on pins 2 and 3 wired to the Pi4 serial port at /dev/serial0. I have confirmed that this works by running the pico-examples/hello_world/serial application and see the responses in the terminal.
In order to get the REPL going over serial, I modify micropython/ports/rp2/mpconfigport.h with the following one line change
-#define MICROPY_HW_ENABLE_UART_REPL (0) // useful if there is no USB
+#define MICROPY_HW_ENABLE_UART_REPL (1) // useful if there is no USB
The build seems to proceed fine but the load is unresponsive when I push it to the device. If I back out the above change and build again using the same steps the micropython firmware works as expected.
Steps to recreate the issue:
openocd -f interface/raspberrypi-swd.cfg -f target/rp2040.cfg -c "program build-PICO/firmware.elf verify reset exit"
The same results are obtained if I replace step 4 with drag and drop the newly built uf2 file.
Beta Was this translation helpful? Give feedback.
All reactions