DAPLink: A One-Stop Solution for Embedded Programming, Debugging, and Serial Logging

Developers working on embedded systems have certainly encountered issues such as tedious programming, difficult debugging, and lengthy log collection. Today, I would like to recommend a powerful tool—DAPLink—that provides a one-stop solution for programming, debugging, and serial logging, making the process incredibly smooth!

What is DAPLink? In simple terms, DAPLink is firmware that runs on a secondary MCU, linking your computer to the Cortex-M core via SWD/JTAG. It is recognized as a USB composite device and integrates:

  • • MSC (USB drag-and-drop programming)
  • • CDC (virtual serial port for easy log collection/interactivity)
  • • CMSIS-DAPv1/v2 (standard debugging protocol channel)
  • • WebUSB (direct browser debugging)

Almost all mainstream development boards (NUCLEO, OpenSDA, LPC-Link2, ST-LINK, J-Link OB, etc.) can run DAPLink.

DAPLink: A One-Stop Solution for Embedded Programming, Debugging, and Serial Logging

What Pain Points Does It Address?

  1. 1. Complicated Programming: Traditionally requires specialized tools or command line, which can easily lead to deadlocks.
  2. 2. Chaotic Serial Port Management: You have to install drivers and find the serial port number, which can be cumbersome.
  3. 3. Inconsistent Debugging Channels: Setting up environments for SWD, JTAG, USB, etc., can be a headache.
  4. 4. Poor Cross-Platform Support: Switching between Windows, Mac, and Linux can be costly.

With DAPLink, you can leave all these issues behind; just drag and drop, open the serial port directly, and complete debugging and programming in one go.

Core Features & Code Examples

  • • MSC Programming: Simply drag the compiled <span>.bin</span> file to the DAPLink drive, and it will instantly flash into the memory!
    mbed compile -m NUCLEO_F401RE -t GCC_ARM
    # Drag the BUILD/NUCLEO_F401RE/GCC_ARM/project.bin file to the DAPLink drive in the file manager.
  • • CDC Serial Port: Open your serial port tool (like PuTTY or minicom), set the baud rate as you wish, and print printf logs in real-time.
    #include "mbed.h"
    Serial pc(USBTX, USBRX);
    int main() {
        pc.printf("Hello DAPLink! %d\n", 123);
        while (1) wait_us(500000);
    }
  • • CMSIS-DAP Debugging: With OpenOCD or Keil, this provides the most user-friendly debugging experience.
    openocd -f interface/cmsis-dap.cfg -f target/stm32f4x.cfg

    Then in GDB:

    arm-none-eabi-gdb build/project.elf
    (gdb) target remote localhost:3333

Pros and Cons of DAPLink

Pros Cons
Driver-free drag-and-drop programming, incredibly simple Does not support all custom protocols (community updates needed)
Three-in-one: serial port, debugging, and USB Advanced debugging (trace, SWO) may have limitations
Cross-platform (Windows/Mac/Linux) compatibility Be cautious of interface order when using USB composite devices
Active open-source community with continuous contributions Some boards require manual firmware updates

Usage Tips and Practical Experience

  • • Firmware updates are very simple: go to the project Release[1] page, download the corresponding <span>.hex</span> file for your board, and drag it in just like programming.
  • • If you encounter slow or occasional USB recognition, try reconnecting or using a different USB port.
  • • Want to debug using a browser? Try WebUSB + Chrome; just connect the board, and the browser can interact directly.
  • • The community is very active; if you have questions or want to suggest new features, feel free to open an Issue/PR on GitHub.

Conclusion DAPLink truly banishes the term “tedious” and makes the integration of programming, serial communication, and debugging easily accessible. For embedded beginners, it significantly lowers the entry barrier; for experienced developers, it streamlines workflows. Give this powerful tool a try and watch your Cortex-M development efficiency soar!

Project Address: https://github.com/ARMmbed/DAPLink

Leave a Comment