Debugging rp2040 with PICO_COPY_TO_RAM=1

Sysprogs forums Forums VisualGDB Debugging rp2040 with PICO_COPY_TO_RAM=1

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36111
    jafeucht
    Participant

    I have a project where I need to have the setting “set(PICO_COPY_TO_RAM 1)” in the CMakeLists. This is because I have another device on my board which utilizes the SPI flash memory from which the Pico device loads the program memory contents.

    However, whenever I have PICO_COPY_TO_RAM set, I cannot set a breakpoint in my main method — I think, since the breakpoint is set for the Flash address and not the RAM address, so the debugger never detects the breakpoint is reached.

    When I hit F10, I can break into the entry point. I can continue to hit F10, but as soon as I execute the command to branch to the BOOTROM vector, the debugger stops working at that moment and any breakpoints set in main() are not hit.

    Is there any workaround so that I can break into my main() method whenever PICO_COPY_TO_RAM is set to 1?

    • This topic was modified 6 days, 1 hour ago by jafeucht.
    #36113
    jafeucht
    Participant

    I think I just figured out a work-around which works well for me:

    In the CMakeLists, remove:

    • set(PICO_COPY_TO_RAM 1)

    And replace with:

    • pico_set_binary_type(my_app_name no_flash)

    In that case, the application is compiled to go directly into RAM skipping programming it to flash memory.

    • This reply was modified 6 days ago by jafeucht.
    • This reply was modified 6 days ago by jafeucht.
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.