Skip to content
 
 

Repository files navigation

cmdr-probe

A Waveshare RP2350-GEEK running debugprobe, with two things added: a status screen for the target on its built-in 1.14" LCD, and a commander shell on a second USB CDC.

The screen is a traffic light for whatever you are debugging — green running, yellow halted or stepping, red for a broken link, grey for no debugger attached — read by snooping the DAP traffic as it passes through, so it costs the debug session nothing. Underneath it: DHCSR, the DP IDCODE, and transfer counts.

$ ./monitor                    # the shell, on CDC1 (CDC0 stays the target's UART)
> probe
target: IDLE
  host: no traffic
  DHCSR: 0x00130003
  DP ID: 0x00000094
  transfers: 720156
  faults: 8
> lcd text 10 40 "hello"

It is a libraries-only commander consumer: debugprobe already owns main(), the FreeRTOS configuration and the USB stack, so commander is linked as libraries rather than as a runner (COMMANDER_LIBRARIES_ONLY), and this project plays the runner's role itself in src/commander_shell.cpp. cmdr.toml records the panel and the framework pin; cmdr manages those and nothing else. The ST7789 driver, the font and the lcd command all come from commander — there is no display register code in this firmware.

./build      # cmake → build-geek/
./bum        # build + upload (BOOTSEL) + monitor
./monitor    # the commander shell

Bring-up notes, including the wiring and what each failure looked like, are in docs/geek-lcd.md.

Relationship to debugprobe

This is a fork of raspberrypi/debugprobe, and deliberately stays one. The debug engine is not ours and we do not want to own it:

src/probe.c, src/probe.pio (the PIO SWD implementation) untouched
CMSIS_5 submodule (the CMSIS-DAP implementation) untouched
Files added by this fork 14
Upstream files modified 7, +143 / -7 lines

Nearly all of it is additive — main.c, cdc_uart.c and tusb_edpt_handler.c have zero deletions, just hooks. The GEEK-specific parts are namespaced (board_geek_config.h, dap_vendor_geek.c) so the rest stays generic.

Branches

  • main — this work. The default branch.
  • master — left as a pristine mirror of upstream, never merged into. That is what makes git diff master..main show exactly what this fork adds, and what keeps taking upstream fixes simple.

Taking upstream fixes

git fetch upstream
git merge upstream/master

Expect conflicts in CMakeLists.txt, src/main.c, src/cdc_uart.c, src/tusb_edpt_handler.c and src/usb_descriptors.c — all five are files where this fork adds to upstream, so they resolve as "keep both sides" rather than reconciling two designs.

Currently based on debugprobe v2.2.0; upstream is at v2.3.1. Not yet taken, and worth knowing about because they touch the code this fork depends on and does not modify: dap thread: multiple bugfixes, dap thread: fix request/response buffer full helper, Correct handling of threads in suspend-disconnect cycles, and main: restore compatibility with single-core RTOS operation.


Everything below is upstream debugprobe's README, unchanged.

Debugprobe

Firmware source for the Raspberry Pi Debug Probe SWD/UART accessory. Can also be run on a Raspberry Pi Pico.

Raspberry Pi Debug Probe product page

Raspberry Pi Pico product page

Documentation

Debug Probe documentation can be found in the Pico Getting Started Guide. See "Appendix A: Using the Debug Probe".

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/raspberrypi/debugprobe
cd debugprobe

Initialize and update the submodules:

 git submodule update --init

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 PICO_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.

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 as rp2350 needs a downstream FreeRTOS port for now.
  • PICO_SDK_PATH must point to a version 2.0.0 or greater install.
git submodule sync
git submodule update --init
mkdir build-pico2
cd build-pico2
cmake -DDEBUG_ON_PICO=1 -DPICO_BOARD=pico2 -DPICO_PLATFORM=rp2350 ../

TODO

  • AutoBaud selection, as PIO is a capable frequency counter
  • Possibly include RTT support

About

A Waveshare RP2350-GEEK debug probe that shows what the target is doing on its own LCD — a debugprobe fork with a commander shell on a second USB CDC

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages