pico-debug runs on one core in a RP2040 and provides a USB CMSIS-DAP interface to debug the other core
 
 
Go to file
Peter Lawrence c5cfd9b8aa fix for IDEs sending under-sized OUT messages; bcdDevice to v10.05 2022-08-03 14:41:49 -05:00
CMSIS_5@61cfe5d56f initial commit 2021-02-04 16:51:59 -06:00
howto added link to #23 in howto/openocd.md 2022-05-21 15:22:49 -05:00
pico initial commit 2021-02-04 16:51:59 -06:00
rp2040 corrected core type in rp2040.h 2021-02-09 15:39:08 -06:00
tinyusb@fa895ed3dc update to TinyUSB v0.13.0 2022-03-21 15:15:14 -05:00
.gitmodules initial commit 2021-02-04 16:51:59 -06:00
DAP_config.h add unique serial number for USB descriptor and CMSIS-DAP DAP_Info 2021-03-21 14:09:12 -05:00
README.md modified README.md in response to #21 2022-05-14 10:08:08 -05:00
bootcode.c add unique serial number for USB descriptor and CMSIS-DAP DAP_Info 2021-03-21 14:09:12 -05:00
main.c fix for IDEs sending under-sized OUT messages; bcdDevice to v10.05 2022-08-03 14:41:49 -05:00
myboard.c update to TinyUSB v0.13.0 2022-03-21 15:15:14 -05:00
pico-debug.hzp update to TinyUSB v0.13.0 2022-03-21 15:15:14 -05:00
picodebug_MemoryMap.xml add unique serial number for USB descriptor and CMSIS-DAP DAP_Info 2021-03-21 14:09:12 -05:00
picodebug_Startup.s add unique serial number for USB descriptor and CMSIS-DAP DAP_Info 2021-03-21 14:09:12 -05:00
picodebug_sram_placement.xml add unique serial number for USB descriptor and CMSIS-DAP DAP_Info 2021-03-21 14:09:12 -05:00
picodebug_xip_placement.xml add unique serial number for USB descriptor and CMSIS-DAP DAP_Info 2021-03-21 14:09:12 -05:00
spawn.c two variants; debugger now runs on Core1 2021-02-06 19:30:11 -06:00
tusb_config.h update to TinyUSB v0.13.0 2022-03-21 15:15:14 -05:00
usb_descriptors.c fix for IDEs sending under-sized OUT messages; bcdDevice to v10.05 2022-08-03 14:41:49 -05:00

README.md

Description

RP2040 has two ARM Cortex-M0+ cores, and the second core normally remains dormant.

pico-debug runs on one core in a RP2040 and provides a USB CMSIS-DAP interface to debug the other core. No hardware is added; it is as if there were a virtual debug pod built-in.

Boot the RP2040 with the BOOTSEL button pressed, copy over pico-debug.uf2, and it immediately reboots as a CMSIS-DAP adapter. pico-debug loads as a RAM only .uf2 image, meaning that it is never written to flash and doesn't replace existing user code.

To cater to different user situations, there are two versions of pico-debug to download: MAXRAM and GIMMECACHE

Most users (including all arduino-pico users) should use the GIMMECACHE version.

With pico-debug-maxram, all 264kBytes of SRAM on the RP2040 is available for running user code; pico-debug shoehorns itself entirely into the 16kBytes of XIP_SRAM (aka flash cache).

With pico-debug-gimmecache, 248kBytes (94% of total) of SRAM is available for running user code; pico-debug gives plenty of elbow room by occupying only 6% near the very top of SRAM, and unlike MAXRAM, leaves the flash cache operational.

If viewing this on github, pre-built binaries are available for download on the right under "Releases".

Why pico-debug exists

pico-debug provides a debugger with only one RP2040 board instead of another debuggers approach with two RP2040 boards plus fiddly wiring; this makes this capability more accessible to all users and means that any RP2040-based design can have this latent debug capability without added cost.

pico-debug uses the CMSIS-DAP standard, making it compatible with the considerable amount of software development that has already gone into an array of existing CMSIS-DAP compatible IDEs. This standards-based approach seems far preferable to re-inventing the wheel with yet another proprietary debugger protocol.

How to use

Please read howto/README.md for instructions on how to start using pico-debug.

Caveats whilst using pico-debug

The executive summary is:

pico-debug uses the USB port to provide debugging to the user, so the user's app can't be simultaneously using the USB port! :)

The specifics are:

  • MAXRAM only: the flash cache cannot be used by the user code, as pico-debug is using this memory
  • GIMMECACHE only: SRAM 0x2003C000 to 0x2003FFFF must not be used by user code
  • user code cannot reconfigure the PLL_USB, as the USB peripheral needs this
  • after loading the pico-debug .uf2 and subsequently starting to run user code, CLK_SYS starts in a configuration where it is being fed by the 48MHz PLL_USB; Pico SDK users shouldn't care, but bare-metal developers might want to know this
  • the USB peripheral is used to provide the debugger, so the user code cannot use it as well

License

TinyUSB and code specific to pico-debug is licensed under the MIT license.

ARM's CMSIS_5 code is licensed under the Apache 2.0 license.