Skip to content

kab7/debugprobe-rp2040-zero

Repository files navigation

Debugprobe

Release License

Firmware source for the Raspberry Pi Debug Probe SWD/UART accessory, adapted for RP2040-Zero and still buildable for Raspberry Pi Pico and Pico 2.

This repository is based on the original raspberrypi/debugprobe project.

Raspberry Pi Debug Probe product page

Raspberry Pi Pico product page

Raspberry Pi Pico 2 product page

RP2040-Zero Support

This repository also contains a DEBUG_ON_ZERO configuration for the Waveshare-compatible RP2040-Zero boards.

Current pinout for RP2040-Zero:

  • GP8 = UART TX
  • GP9 = UART RX
  • GP10 = SWCLK
  • GP11 = SWDIO
  • GP16 = onboard WS2812 status LED

The onboard RGB LED replaces the discrete status LEDs used on the original Debug Probe hardware:

  • red = USB status
  • green = CMSIS-DAP connected
  • blue = UART RX activity

Target reset is currently not connected on this board configuration.

Documentation

Debug Probe documentation can be found at the Raspberry Pi Microcontroller Documentation portal.

Hacking

For the purpose of making changes or studying of the code, you may want to compile the code yourself.

First, clone the repository:

git clone https://github.com/kab7/debugprobe-rp2040-zero
cd debugprobe

Initialize and update the submodules:

 git submodule update --init --recursive

Then create and switch to the build directory:

 mkdir build
 cd build

If your environment doesn't contain PICO_SDK_PATH, then either add it to your environment variables with export PICO_SDK_PATH=/path/to/sdk or add -DPICO_SDK_PATH=/path/to/sdk to the arguments to CMake below.

Run cmake and build the code:

 cmake ..
 make

Done! You should now have a debugprobe.uf2 that you can upload to your Debug Probe via the UF2 bootloader.

Building for the Pico 1

If you want to create the version that runs on the Pico, then you need to invoke cmake in the sequence above with the DEBUG_ON_PICO=ON option:

cmake -DDEBUG_ON_PICO=ON ..

This will build with the configuration for the Pico and call the output program debugprobe_on_pico.uf2, as opposed to debugprobe.uf2 for the accessory hardware.

Note that if you first ran through the whole sequence to compile for the Debug Probe, then you don't need to start back at the top. You can just go back to the cmake step and start from there.

Building for the Pico 2

If using an existing debugprobe clone:

  • You must completely regenerate your build directory, or use a different one.
  • You must also sync and update submodules.
  • PICO_SDK_PATH must point to a version 2.0.0 or greater install.
git submodule sync
git submodule update --init --recursive
mkdir build-pico2
cd build-pico2
cmake -DDEBUG_ON_PICO=1 -DPICO_BOARD=pico2 ../

This will build with the configuration for the Pico 2 and call the output program debugprobe_on_pico2.uf2.

Building for the RP2040-Zero

If using an existing clone:

  • You must completely regenerate your build directory, or use a different one.
  • You must also sync and update submodules.
git submodule sync
git submodule update --init --recursive
mkdir build-rp2040-zero
cd build-rp2040-zero
cmake -DDEBUG_ON_ZERO=ON -DPICO_SDK_FETCH_FROM_GIT=ON ../
cmake --build . -j4

This builds debugprobe_on_rp2040_zero.uf2.

AutoBaud

Mode which automatically detects and sets the UART baud rate as data arrives.

To enable AutoBaud, configure the USB CDC port to the following custom baud rate:

9728 (0x2600)

Note: Some Linux serial tools cannot set custom baud values. PuTTY on Windows and any terminal that supports arbitrary baud rates works.

Changing the baud rate to any other value disables AutoBaud.

About

Raspberry Pi Debug Probe firmware ported to RP2040-Zero with WS2812 status LED support

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages