-
Notifications
You must be signed in to change notification settings - Fork 53
Debug with JTAG
The first section describes quick usage and the rest of the document are about preparation.
-
Open a PowerShell in administrator mode:
usbipd wsl list
Find a line looks like
3-2 2e8a:0004 Picoprobe, Picoprobe (Interface 2) Not attached
. In this example,3-2
is the "busid".usbipd wsl attach --busid 3-2
-
Open an Ubuntu shell:
sudo openocd -f interface/picoprobe.cfg -f target/rp2040.cfg
-
Open one more Ubuntu shell:
cd prk_firmware rake debug # Builds a debug built then runs gdb-multiarch
- In the console of gdb-multiarch:
target remote localhost:3333 # Connects to picoprobe load # Installs prk_firmware-******.elf into the target RP2040 continue # Starts PRK Firmware
- In the console of gdb-multiarch:
- Ubuntu on WSL2
- Completed setup of Building a binary
Make sure that the kernel version is 5.10.60 or later.
uname -a
# for example,
# => Linux DESKTOP-FOEG8S2 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
# ^^^^^^^^
- USBIPD
- Add UDEV rule
- OPENOCD
- PICOPROBE
Download and install USBIPD-WIN from https://github.com/dorssel/usbipd-win/releases
Install dependencies:
(Not sure if this is the complete list or not)
sudo apt install libusb-1.0-0-dev libusb-dev gdb-multiarch libtool
Install the USBIP tools and hardware database:
(Valid tool version may differ at the point you see this document)
sudo apt install linux-tools-5.4.0-77-generic hwdata
sudo update-alternatives --install /usr/local/bin/usbip usbip /usr/lib/linux-tools/5.4.0-77-generic/usbip 20
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="0004", MODE="0666"' | sudo tee /etc/udev/rules.d/60-rp2040.rules
sudo service udev restart
sudo udevadm trigger
git clone https://github.com/raspberrypi/openocd.git --branch rp2040 --depth=1 --no-single-branch
cd openocd
./bootstrap
./configure --enable-picoprobe
make
sudo make install
git clone https://github.com/raspberrypi/picoprobe.git
mkdir build
cd build/
cmake ..
make
Install build/picoprobe.uf2
into an RP2040 which you are using as the debugger.
Target | Debugger |
---|---|
SWDIO | GPIO3 |
GND | GND |
SWDCLK | GPIO2 |
Connect a USB cable to both target and debugger.
The example uses RustyKeys though, you can use also a breadboard.
- Getting started
- Keyboard features
- Keycodes (ja)
- Mouse (ja)
- Layers and mode key (ja)
- Debounce
- Composite key
- Split-type keyboard
- Keyscan matrix
- Num Lock, Caps Lock and Scroll Lock
- Useful methods that make you free
- BIOS mode
- Other features
- Examples
- Development
- Contribute to the Wiki
- FAQ