Skip to content

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:

Installing pyOCD

The latest stable version of pyOCD may be installed via pip. Open up a terminal and run:

py -3 -m pip install -U pyocd
python3 -m pip install -U pyocd

Wiring the boards

Perform the following steps to connect the boards:

  1. Connect Pitaya-Link to the target board using the jumper wires.
  2. 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:

pyocd load -t nrf52840 firmware.hex
pyocd load -t nrf52840 --base-address 0x1000 firmware.bin
pyocd erase -t nrf52840 --chip