I'm writing assembly for my Pico and I'd like to shrink my edit-compile-debug cycle (and save wear on my flash chips) by "flashing" straight to RAM, resetting the Pico, and continue debugging.
Using the gcc/gdb/openocd toolchain I'm normally flashing with this command:
and then calling monitor reset init in GDB.
Is this possible? Is openocd capable of flashing my object code to RAM if my linker script defines it that way? My intuition is telling me that I'll also have to alter the bootloader to set the VTOR and SP to somewhere in RAM rather than XIP, and then jump to the reset handler.
I don't know if there's something hiding in the chip's reset procedure or GDB that would clear RAM or otherwise make this impossible. Hopefully someone can save me a few hours of frustration ahead of time if this can't be done.
Using the gcc/gdb/openocd toolchain I'm normally flashing with this command:
Code:
openocd -f /usr/local/share/openocd/scripts/interface/cmsis-dap.cfg -f /usr/local/share/openocd/scripts/target/rp2040.cfg -c 'adapter speed 5000' -c "program $(MAIN) verify reset exit"
Is this possible? Is openocd capable of flashing my object code to RAM if my linker script defines it that way? My intuition is telling me that I'll also have to alter the bootloader to set the VTOR and SP to somewhere in RAM rather than XIP, and then jump to the reset handler.
I don't know if there's something hiding in the chip's reset procedure or GDB that would clear RAM or otherwise make this impossible. Hopefully someone can save me a few hours of frustration ahead of time if this can't be done.
Statistics: Posted by winduptoy — Sat Apr 06, 2024 4:47 pm — Replies 1 — Views 77