This project is a port of the Black Magic Probe project to Raspberry Pi RP2040 (2 Cortex-M0+ cores at 125MHz) MCU.
The project is a USB debugger that operates via JTAG and SWD interfaces, supporting many ARM Cortex processors (see supported device list here).
It also supports debug output via Serial Wire Output (SWO) and RTT. Additionally, the device has an extra UART serial port that can be accessed through a second Virtual COM port.
This README contains only the basic information: information about the hardware, how to build the firmware and flash the probe.
Detailed instructions on how to use the debugger, how to configure SWO, RTT and etc. you can find on the project's wiki.
The main board for this device is MioLink (rev. A/rev. B): RP2040 + 16Mbit (2MiB) QSPI Flash memory (W25Q16).
At this moment, there are two revisions of MioLink: rev. A and rev. B.
You can find information about their differences here.
MioLink_Pico is a breakout board for Pico and Pico W featuring a power switch and voltage converters.
Standard Pico and Pico W boards are also supported.
The device type is determined at runtime, so all boards use the same firmware.
MioLink_adapter is an adapter that allows you to connect the probe with target boards that have different types of connectors.
You can find all hardware CAD files (designed in KiCad) here.
MioLink and MioLink_Pico use the standard ARM 10-pin 0.1" connector and has additional 4-pin 0.1" UART connector:
Pin | Name | Description | Pin | Name | Description |
---|---|---|---|---|---|
1 | VTref | Target reference voltage | 2 | SWDIO/TMS | SWD Data input/output / JTAG Test mode select |
3 | GND | Ground | 4 | SWDCLK/TCK | SWD Clock / JTAG Test clock |
5 | GND | Ground | 6 | SWO/TDO/RX | SWO Trace output / JTAG Test data output / UART Probe RX (Target TX) |
7 | NC | Not connected | 8 | NC/TDI/TX | Not connected for SWD / JTAG Test data input / UART Probe TX (Target RX) |
9 | GND | Ground | 10 | RESET | Reset pin |
Pin | Name | Description | Pin | Name | Description |
---|---|---|---|---|---|
1 | RX | UART Probe RX (UART Target TX) | 2 | VTref | Target reference voltage |
3 | TX | UART Probe TX (UART Target RX) | 4 | GND | Ground |
Pin | Name | Description |
---|---|---|
10 (GP7) | RESET | Reset pin |
11 (GP8) | TX | UART Probe TX (UART Target RX) |
12 (GP9) | RX | UART Probe RX (UART Target TX) |
13 | GND | Ground |
14 (GP10) | SWDCLK/TCK | SWD Clock / JTAG Test clock |
15 (GP11) | SWDIO/TMS | SWD Data input/output / JTAG Test mode select |
16 (GP12) | NC/TDI/TX | Not connected for SWD / JTAG Test data input / UART Probe TX (Target RX) |
17 (GP13) | SWO/TDO/RX | SWO Trace output / JTAG Test data output / UART Probe RX (Target TX) |
36 | 3V3 | 3.3V output from Pico |
PLEASE, note that the Vtref pin (pin 1) on MioLink and MioLink_Pico MUST always be connected (internally or externally) to the logic level voltage of the target being debugged (from 1.65V to 5.5V) to power the level shifters inside the probe.
If the target device operates at a 3.3V logic level, this pin can be powered internally by the probe, also in this case, the target can be powered by the probe if needed, and the maximum current is specified in the table below, but be careful, accidentally connecting anything to this pin that is not rated for 3.3V may lead to irreversible damage to the external device.
3.3V power supply on this pin can be enabled with the GDB command monitor tpwr enable
and disabled with the command monitor tpwr disable
. By default (after probe reset), it's disabled.
Pico and Pico W are also able to provide 3.3V power for target through 3V3(OUT) pin (pin 36), but it is recommended to keep the load on this pin less than 300mA, for more information see chapter 2.1, page 8 in Pico datasheet and chapter 2.1, page 9 in Pico W datasheet.
In all other cases, the Vtref pin (pin 1) functions as an input and must be connected to the logic level voltage of the target device.
The allowable voltage range is from 1.65V to 5.5V.
Board | Max current |
---|---|
MioLink | rev.A: ~200 mA; rev.B: ~350 mA (min. 300, max. 400) |
MioLink_Pico | ~200 mA (min. 175, max. 234) |
Pico or Pico W | ~300 mA from 3V3 pin, see recommendations in Pico and Pico W datasheets. |
Pin | Description |
---|---|
Vtref | Target reference voltage |
GND | Ground |
TMS | Test mode select |
TCK | Test clock |
TDO | Test data output |
TDI | Test data input |
RESET | Optional reset pin |
Pin | Description |
---|---|
Vtref | Target reference voltage |
GND | Ground |
SWDIO | Data input/output |
SWDCLK | Clock signal |
RESET | Optional reset pin |
The following tools are required to build this project:
The simplest way to build the firmware under Windows environment is to use MinGW64.
pacman -Syu
pacman -S git mingw-w64-x86_64-python mingw-w64-x86_64-make mingw-w64-x86_64-cmake mingw-w64-x86_64-arm-none-eabi-gcc mingw-w64-x86_64-gcc
git clone --recurse-submodules https://github.com/Misaka0x2730/MioLink.git
cd MioLink/firmware
mkdir debug
cd debug
cmake -DCMAKE_BUILD_TYPE=Debug -G "MinGW Makefiles" ..
cmake --build .
MioLink.uf2
to flash device via factory USB-MSC bootloader.mkdir release
cd release
cmake -DCMAKE_BUILD_TYPE=Release -G "MinGW Makefiles" ..
cmake --build .
MioLink.uf2
to flash device via factory USB-MSC bootloader.Download and install all requirements:
cd /opt
sudo wget "https://developer.arm.com/-/media/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz"
sudo tar -xf arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz
sudo rm arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz
export PATH="$PATH":/opt/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin
sudo apt-get install git python3 cmake
Note: export PATH
will set the path environment variable only for the current session.
If you want to set PATH permanently, you need to add export PATH="$PATH":/opt/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin
to your ~/.profile
or ~/.bashrc
.
Clone this project with submodules into home directory:
cd ~
git clone --recurse-submodules https://github.com/Misaka0x2730/MioLink.git
Change current dir: cd MioLink/firmware
mkdir debug
cd debug
cmake -DCMAKE_BUILD_TYPE=Debug -G "Unix Makefiles" ..
cmake --build .
MioLink.uf2
to flash device via factory USB-MSC bootloader.mkdir release
cd release
cmake -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ..
cmake --build .
MioLink.uf2
to flash device via factory USB-MSC bootloader.xcode-select --install
to install Xcode Command Line Tools (includes gcc
and make
);git clone --recurse-submodules https://github.com/Misaka0x2730/MioLink.git
cd MioLink/firmware
mkdir debug
cd debug
cmake -DCMAKE_BUILD_TYPE=Debug -G "Unix Makefiles" ..
cmake --build .
MioLink.uf2
to flash device via factory USB-MSC bootloader.mkdir release
cd release
cmake -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ..
cmake --build .
MioLink.uf2
to flash device via factory USB-MSC bootloader.MioLink.uf2
file to mass storage device;