DragonProbe/README.md

132 lines
5.7 KiB
Markdown
Raw Normal View History

# Dragon Probe
2021-01-31 03:43:09 +00:00
2021-06-21 16:11:02 +00:00
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](https://github.com/majbthrd/DapperMime/), 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
](https://github.com/hathach/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.
2021-01-31 03:43:09 +00:00
## Building
2021-06-21 16:11:02 +00:00
After initially downloading this project's code, issue the following command to download TinyUSB and CMSIS 5 code:
2021-01-31 03:43:09 +00:00
```
git submodule update --init --recursive
2021-01-31 03:43:09 +00:00
```
2021-06-21 16:11:02 +00:00
Compilation is done using CMake:
```
mkdir cmake-build && cd cmake-build
cmake -DBOARD=raspberry_pi_pico -DFAMILY=rp2040 -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
```
2021-06-21 16:11:02 +00:00
`BOARD` and `FAMILY` should correspond to those used in the TinyUSB `hw` folder,
and with the folders used in `./bsp` as well.
2021-06-21 16:20:19 +00:00
A non-exhaustive list of possible BOARD/FAMILY combinations:
2021-06-21 16:11:02 +00:00
| `FAMILY` | `BOARD` | description | notes |
|:-------- |:------------------ |:----------------- |:------- |
| `rp2040` |`raspberry_pi_pico` | Raspberry Pi Pico | default |
### Notes on compiling for the RP2040 Pico
2021-06-21 16:11:02 +00:00
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.
2021-06-21 16:11:02 +00:00
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
2021-06-21 16:11:02 +00:00
## Usage
2021-08-17 21:47:58 +00:00
For detailed usage notes, please visit the [wiki](https://git.lain.faith/sys64738/DragonProbe/wiki/Home).
2021-07-29 23:53:15 +00:00
2021-01-31 03:43:09 +00:00
## License
2021-08-02 16:15:17 +00:00
The code of this project itself is licensed under the [GPL v3](https://opensource.org/licenses/GPL-3.0).
2021-01-31 03:43:09 +00:00
TinyUSB is licensed under the [MIT license](https://opensource.org/licenses/MIT).
2021-06-21 16:11:02 +00:00
ARM's CMSIS 5 code is licensed under the [Apache 2.0 license](https://opensource.org/licenses/Apache-2.0).
2021-01-31 03:43:09 +00:00
2021-08-02 16:15:17 +00:00
libco is licensed under the [ISC license](https://opensource.org/licenses/ISC).
2021-06-08 00:32:06 +00:00
2021-08-02 16:15:17 +00:00
Some code has been incorporated from the [DapperMime](https://github.com/majbthrd/DapperMime),
[picoprobe-sump](https://github.com/perexg/picoprobe-sump),
2021-09-25 11:22:09 +00:00
[JTAGenum](https://github.com/cyphunk/JTAGenum),
[SWDscan](https://github.com/szymonh/SWDscan) and the [Raspberry Pico
examples](https://github.com/raspberrypi/pico-examples/)
2021-07-29 23:39:09 +00:00
projects. These respective licenses can be found in
2021-08-02 16:15:17 +00:00
[this](./LICENSE.dappermime), [this](./LICENSE.picoprobe-sump),
2021-09-25 11:22:09 +00:00
[this](./LICENSE.jtagenum), [this](./LICENSE.swdscan) and
[this](./LICENSE.pico-examples) file.
2021-07-29 23:39:09 +00:00
2021-06-02 22:45:32 +00:00
## TODO
2021-09-25 11:22:09 +00:00
- [ ] **A (VID and) PID**
2021-08-02 16:15:17 +00:00
- [ ] GPL license headers on every file
- [x] Debug interface to send printf stuff directly to USB, instead of having
2021-06-14 01:42:12 +00:00
to use the UART interface as a loopback thing.
2021-06-20 21:58:26 +00:00
- [ ] Second UART port for when stdio UART is disabled?
2021-08-02 16:15:17 +00:00
- [x] I2C support ~~by emulating the I2C Tiny USB~~
2021-06-21 15:55:06 +00:00
- [x] Expose RP2040-internal temperature ADC on I2C-over-USB bus?
2021-06-20 22:10:12 +00:00
- [ ] ~~Does SMBus stuff need special treatment here?~~ ~~No.~~ Actually, some
2021-09-25 11:22:09 +00:00
parts do, but, laziness.
2021-06-20 22:10:12 +00:00
- [x] 10-bit I2C address support (Needs poking at the Pico SDK, as it only
2021-06-14 01:42:12 +00:00
supports 7-bit ones).
2021-08-02 16:15:17 +00:00
- [ ] **1-wire**
- [ ] **make modes persistent?**
2021-06-28 20:44:02 +00:00
- [ ] 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
2021-06-28 20:44:02 +00:00
- [ ] Mode where you can define custom PIO stuff for custom pinouts/protocols??????
- Maybe also with code that auto-reacts to stuff from the environment?
2021-06-29 02:27:41 +00:00
- [ ] 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?
2021-06-13 16:47:46 +00:00
- [ ] SD/MMC/SDIO (will be a pain)
- [ ] MSP430 programming
- https://dlbeer.co.nz/mspdebug/usb.html
- https://github.com/dlbeer/mspdebug
- https://www.ti.com/lit/an/slaa754/slaa754.pdf
- https://www.ti.com/lit/ug/slau320aj/slau320aj.pdf
2021-06-02 22:45:32 +00:00
- [ ] AVR programming (USBavr emulation?)
- AVR ISP is hardly used anymore
- TPI/UPDI requires 5V levels, Pico doesn't do that :/
- debugWIRE????
- https://github.com/travisgoodspeed/goodfet/blob/master/firmware/apps/avr/avr.c
- [ ] PIC programming
- https://github.com/travisgoodspeed/goodfet/tree/master/firmware/apps/pic
2021-06-28 01:31:07 +00:00
- iCE40 programming??
- https://github.com/adamgreig/ffp
- Renesas E7-{0,1,2} programming thing????
- Renesas tell us how this works pls
2021-08-02 16:15:17 +00:00
- https://github.com/szymonh/rl78check is something at least
2021-06-13 16:47:46 +00:00
- Maybe steal other features from the Bus Pirate, [HydraBus](https://github.com/hydrabus/hydrafw) or Glasgow or so
2021-06-29 02:27:41 +00:00
- 3-wire? Never seen this one in the wild
2021-06-28 01:31:07 +00:00
- CAN? LIN? MOD? If I'd first be able to find a CAN device to test it with, sure
2021-06-02 22:45:32 +00:00