Using Pitaya-Link Debug Probe¶
Pitaya-Link is a low-cost debug probe based on the CMSIS-DAP (also known as DAPLink) protocol standard. It can be used to program and debug the application software running on Arm Cortex Microcontrollers.
This section details how to program the nRF52840 MDK USB Dongle using Pitaya-Link debug probe. Refer to the Pitaya-Link User's Guide for more details.
Requirements¶
Before you start, check that you have the required hardware and software:
- 1x nRF52840 MDK USB Dongle
- 1x Pitaya-Link Debug Probe
- 1x USB-C Cable
- Several jumper wires
- A computer running macOS, Linux, or Windows 7 or newer
- Python 3.6.0 or later
- pyOCD - Python based tool and API for debugging, programming, and exploring Arm Cortex microcontrollers.
Installing pyOCD¶
The latest stable version of pyOCD may be installed via pip. Open up a terminal and run:
Wiring the boards¶
Perform the following steps to connect the boards:
- Connect Pitaya-Link to the target board using the jumper wires.
- Connect Pitaya-Link to the PC using the USB-C Cable.
The following table shows the signals between Pitaya-Link and nRF52840 MDK USB Dongle:
Pitaya-Link | Wire | nRF52840 MDK USB Dongle |
---|---|---|
3V3 | VSYS | |
GND | GND | |
RESET | RESET | |
SWDCLK | SWDCLK | |
SWDIO | SWDIO |
Drag-and-drop programming¶
Drag-and-drop is an optional intuitive programming feature of DAPLink. It allows programming of your target microcontroller in a very simple way: dragging and dropping a file (.hex
-format) onto the PITAYA-LINK drive.
Using pyOCD¶
The pyocd
command line tool gives you total control over your device with these subcommands:
gdbserver
: GDB remote server allows you to debug using gdb via either the console or several GUI debugger options.load
: Program files of various formats into flash or RAM.erase
: Erase part or all of an MCU's flash memory.pack
: Manage CMSIS Device Family Packs that provide additional target device support.commander
: Interactive REPL control and inspection of the MCU.server
: Share a debug probe with a TCP/IP server.reset
: Hardware or software reset of a device.rtt
: Stream Segger RTT IO with any debug probe.list
: Show connected devices.
You can get additional help by adding --help
option.
To load/erase the nRF52840 MDK USB Dongle target, open up a terminal and run: