Adding Bus Pirate/..-style debugging & probing features to regular MCU boards such as the Raspberry Pi Pico
Go to file
Triss e92a7c1b94 also fix USB speed class stuff because uuurgh 2022-07-24 01:41:17 +02:00
CMSIS-DAP CMSIS-DAP protocol fixes and other stuff 2021-10-11 22:38:14 +02:00
bsp SBW: fix TCLK bullshit 2022-07-24 01:40:24 +02:00
cmake move pico_sdk_import.cmake to a cmake subdir 2021-06-28 20:10:01 -04:00
host start of ISP mode (mode2), MehFET SBW impl 2021-10-05 16:47:34 +02:00
libco started on new usb itf, it compiles and it lsusbs 2021-06-30 19:32:22 +02:00
scripts cherry-pick more haskal stuff, update CMSIS-DAP to 5.0.8 release, fix warnings 2021-06-28 21:42:18 +02:00
src also fix USB speed class stuff because uuurgh 2022-07-24 01:41:17 +02:00
tinyusb@4bfab30c02 update for pico sdk 1.3.0 2021-11-11 17:57:38 +01:00
.clang-format clang formatting stuff 2021-06-29 01:03:02 +02:00
.gitignore update for pico sdk 1.3.0 2021-11-11 17:57:38 +01:00
.gitmodules remove CMSIS submodule, add verbatim to source tree (because compiler errors) 2021-09-20 01:41:56 +02:00
CMakeLists.txt Merge remote-tracking branch 'dxmon/fix/pico-sdk-cmake' into sdk130 2022-07-08 04:06:57 +02:00
COPYING add license files 2021-06-28 22:13:17 +02:00
LICENSE add license files 2021-06-28 22:13:17 +02:00
LICENSE.dappermime add license files 2021-06-28 22:13:17 +02:00
LICENSE.jtagenum license stuff 2021-08-02 18:15:17 +02:00
LICENSE.pico-examples SWD PIO works now, too! 2021-09-25 13:22:09 +02:00
LICENSE.picoprobe-sump update README 2021-07-30 01:39:09 +02:00
LICENSE.swdscan license stuff 2021-08-02 18:15:17 +02:00
README.md SWD PIO works now, too! 2021-09-25 13:22:09 +02:00
pico_sdk_import.cmake Updated the CMakeLists.txt to work against the current pico-sdk 2022-07-07 20:22:02 -04:00

README.md

Dragon Probe

This project attempts to add Bus Pirate/...-like functionality to a number of MCUs, mainly the Raspberry Pi Pico. It was originally based on Dapper Mime, an SWD debugger probe implementation, with the goal of adding JTAG support as well. However, more and more features got added over time.

Variants

Most support and development effort goes to the RP2040/Pico, but, due to the projects' structure still being based on Dapper Mime's, it is relatively easy to add support for another MCU/board. Any MCU supported by TinyUSB should work. Features can also be disabled per MCU.

Adding support for another MCU is a matter of adding another subfolder in the ./bsp folder, implementing the functionality (which only concerns itself with sending commands to the hardware, protocol parsing is done by shared code), and handling it in the CMakeFiles.txt file.

Building

After initially downloading this project's code, issue the following command to download TinyUSB and CMSIS 5 code:

git submodule update --init --recursive

Compilation is done using CMake:

mkdir cmake-build && cd cmake-build
cmake -DBOARD=raspberry_pi_pico -DFAMILY=rp2040 -DCMAKE_BUILD_TYPE=RelWithDebInfo ..

BOARD and FAMILY should correspond to those used in the TinyUSB hw folder, and with the folders used in ./bsp as well.

A non-exhaustive list of possible BOARD/FAMILY combinations:

FAMILY BOARD description notes
rp2040 raspberry_pi_pico Raspberry Pi Pico default

Notes on compiling for the RP2040 Pico

If you have the Pico SDK installed on your system, and the PICO_SDK_PATH environment variable is specified properly, you can omit the --recursive flag in the git submodule invocation (to avoid many many git clones), and pass the -DUSE_SYSTEMWIDE_PICOSDK=On flag to CMake, too.

Other options are:

  • -DPICO_NO_FLASH=[On|Off]: store the binary in RAM only, useful for development.
  • -DPICO_COPY_TO_RAM=[On|Off]: write to flash, but always run from RAM
  • -DUSE_USBCDC_FOR_STDIO=[On|Off]: export an extra USB-CDC interface for debugging

Usage

For detailed usage notes, please visit the wiki.

License

The code of this project itself is licensed under the GPL v3.

TinyUSB is licensed under the MIT license.

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

libco is licensed under the ISC license.

Some code has been incorporated from the DapperMime, picoprobe-sump, JTAGenum, SWDscan and the Raspberry Pico examples projects. These respective licenses can be found in this, this, this, this and this file.

TODO

  • A (VID and) PID
  • GPL license headers on every file
  • Debug interface to send printf stuff directly to USB, instead of having to use the UART interface as a loopback thing.
    • Second UART port for when stdio UART is disabled?
  • I2C support by emulating the I2C Tiny USB
    • Expose RP2040-internal temperature ADC on I2C-over-USB bus?
    • Does SMBus stuff need special treatment here? No. Actually, some parts do, but, laziness.
    • 10-bit I2C address support (Needs poking at the Pico SDK, as it only supports 7-bit ones).
  • 1-wire
  • make modes persistent?
  • FT2232 emulation mode?
    • watch out, still need a vnd cfg interface! libftdi expects the following stuff: (TODO: acquire detailed protocol description)
      • interface 0 ("A"): index 1, epin 0x02, epout 0x81
      • interface 1 ("B"): index 2, epin 0x04, epout 0x83
      • interface 2 ("C"): index 3, epin 0x06, epout 0x85
      • interface 3 ("D"): index 4, epin 0x08, epout 0x87
  • "Complex Trigger" mode for aiding with glitching triggers, by turning UART/SPI/I2C/eMMC/... sequences into a GPIO toggle
  • Mode where you can define custom PIO stuff for custom pinouts/protocols??????
    • Maybe also with code that auto-reacts to stuff from the environment?
  • Facedancer implementation by connecting two picos via GPIO, one doing host stuff, the other device, commands being sent over GPIO to do stuff
  • Maybe use the ADCs for something?
  • SD/MMC/SDIO (will be a pain)
  • MSP430 programming
  • AVR programming (USBavr emulation?)
  • PIC programming
  • iCE40 programming??
  • Renesas E7-{0,1,2} programming thing????
  • Maybe steal other features from the Bus Pirate, HydraBus or Glasgow or so
    • 3-wire? Never seen this one in the wild
    • CAN? LIN? MOD? If I'd first be able to find a CAN device to test it with, sure