DAPLink Mode

What is it?

DAPLink mode allows a Binho Nova to be utilized as a programmer / debugger for ARM microcontrollers. By entering DAPLink mode, the Nova will enumerate as a CMSIS-DAP interface that can be discovered by OpenOCD, pyOCD, and even your favorite IDEs. As such, the Nova becomes a robust device which bridges the gap between expensive & powerful debuggers such as Segger J-Link devices and cheap bare board tools or illegal knock-off devices.
Binho Nova's DAPLink mode supports the SWD interface (SWDIO, SWCLK, and RESET signals) as well as a UART bridge to a virtual COM port (using the same TX, RX signals as in normal Nova operation).
DAPLink is an open-source software project that is developed and maintained by ARM that enables programming and debugging of ARM Cortex CPUs. Please check out the official DAPLink website for more specific details:
DAPLink

How to try it out

You can put your Nova into DAPLink mode using our python library CLI with the following command:
1
binho daplink
Copied!
This will then download our DAPLink-capable firmware to the device. Note that the device cannot be used as a host adapter while in DAPLink mode. (One of the big limitations is that the pins for the SWD interface are the same as other protocols). Note that you can confirm that your device is in DAPLink mode by using the binho info command:
1
PS C:\Users\Jonathan> binho info
2
Found a Binho Nova [in DAPLink Mode]
3
Port: COM3
4
Device ID: 0X1C4780B050515950362E3120FF141C2A
5
Note: This device is in DAPlink Mode! It can be returned to host adapter (normal) mode
6
by issuing 'binho daplink -q' command.
Copied!

Step #2: Connect to the target device SWD bus

The pinout of the wire harness for Nova when in DAPLink mode is as shown in the table below:
Pin Number
Function
IO0
SWDIO
IO1
nRESET
IO2
SWCLK
IO3
UART RX (same as normal mode)
IO4
UART TX (same as normal mode)
It's only necessary to connect the SWDIO and SWCLK signals to the target MCU, most can be reset without the reset signal through various commands. At Binho, we've tested this on ARM-M0 devices from Atmel, Nordic Semiconductor, and Nuvoton.

Step #3: Try out pyOCD / OpenOCD

These common tools have no problem discovering the device and using it as if it were a 'CMSIS-DAP' device (the predecessor of the DAPLink project).
You can verify it's working with pyOCD by sending the 'pyocd list' command:
1
PS C:\Users\Jonathan> pyocd list
2
# Probe Unique ID
3
----------------------------------------------------------
4
0 Binho CMSIS-DAP 1C4780B050515950362E3120FF141C2A
Copied!
You can verify it's working with OpenOCD with this command:
1
openocd.exe -f interface/binho-nova.cfg
Copied!
1
PS C:\Program Files\openocd-0.10.0\bin-x64> .\openocd.exe -f interface/binho-nova.cfg
2
Open On-Chip Debugger 0.10.0
3
Licensed under GNU GPL v2
4
For bug reports, read
5
http://openocd.org/doc/doxygen/bugs.html
6
adapter speed: 500 kHz
7
Info : CMSIS-DAP: SWD Supported
8
Info : CMSIS-DAP: JTAG Supported
9
Info : CMSIS-DAP: Interface Initialised (SWD)
10
Info : CMSIS-DAP: FW Version = 1.10
11
Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
12
Info : CMSIS-DAP: Interface ready
13
Info : clock speed 500 kHz
14
Error: BUG: current_target out of bounds
Copied!
Two quick notes:
1) You'll need to add the binho-nova.cfg file to the scripts/interfaces directory of your OpenOCD installation. The file can be downloaded here:
binho-nova-openocd-cfg.zip
327B
Binary
binho-nova.cfg
2) The last line 'Error' is what will be displayed if the MCU isn't connected or powered on. When an MCU is connected, it will display some information about the target MCU instead of the error message.

Step #4: Try out our Flasher CLI Tool

Hey! Wouldn't it be great if I could simply issue a single command line statement to flash a .hex or .bin file to my microcontroller? We put together a demo script that uses our Python library + the pyOCD scripting interface to show how that can be done.
It's implemented in python library as the binho flasher command, and takes a few parameters. You can see the various arguments by passing the -h / --help flag to the command to display them on the console:
1
binho flasher -h
Copied!
Or you can just take a look at the code for the script in our repository.

Step #5: Try out 3rd-Party tools

Seeed produced a great guide demonstrating how to use a DAPLink device with OpenOCD, Eclipse, Keil, and IAR Embedded Workbench. The configuration for Nova DAPLink mode should be extremely similar to their guide: Debug and Flash Example for IDEs [Seeed]
When you're finished using the device in DAPLink mode, issue the following command to return Binho Nova back to normal operation:
1
binho daplink -q
Copied!
You can verify that your device is back in normal mode using the binho info command, just as we did above:
1
PS C:\Users\Jonathan> binho info
2
Found a Binho Nova
3
Port: COM3
4
Device ID: 0X1C4780B050515950362E3120FF141C2A
5
Firmware Version: 0.2.5 [Up To Date]
Copied!

Feedback & Suggestions

If you've made it this far, please reach out and let us know your thoughts about this feature. We'd love to hear from you!
Last modified 7mo ago