🛠 Programmer par glisser-déposer via le DAPLink
The principle
The DAPLink debugger embedded on the nRF52840-MDK exposes a mass storage function: a removable drive DAPLINK appears on your machine. Dropping a .hex file onto it programs the flash — no SDK, no programmer, no command line required. After copying, press the Boot/Reset button to run the new firmware.
Step 1 — Get the right .hex
Two scenarios:
- Bare application (without SoftDevice, for example a Zephyr build): the file
build/zephyr.hexis dropped as is. - nRF5 SDK application with SoftDevice (anything doing BLE): you must merge the SoftDevice and the application into a single image. This is the #1 cause of “it flashes but nothing happens” (issue #31 on the MakerDiary tracker):
mergehex -m s140_nrf52_6.1.1_softdevice.hex \
_build/mon_app_nrf52840_mdk.hex \
-o firmware.hex
mergehex is provided with the nRF Command Line Tools (also installed by nRF Connect for Desktop).
Step 2 — Program via drag-and-drop
- Connect the board via USB; the
DAPLINKdrive appears. - Drop
firmware.hexonto the drive; the activity LED blinks during the copy. - Once the copy is complete, press Boot/Reset: the board restarts on the new firmware.
Step 3 — The command-line alternative: pyOCD
The embedded probe speaks CMSIS-DAP; pyocd (installable via pip) does the same thing in a scriptable way:
pyocd flash -t nrf52840 firmware.hex
pyocd gdbserver # débuggage GDB via la même sonde
Checks if nothing starts
- SoftDevice not merged: the BLE application points to an address where nothing runs without the S140 controller — see step 1.
- Invalid example hex: some precompiled hex files from the old repository are broken (issue #45); rebuild them yourself.
- USB not enumerated: the
DAPLINKdrive does not appear on some machines (issues #53 and #37); try different cables/ports/hosts. - Windows < 10: install the Arm Mbed CDC serial port driver.
Do not confuse
The UF2 bootloader (dropping a .uf2) concerns only the nRF52840 MDK USB Dongle variant, not the pin-header board documented here. On the dongle, reflashing the bootloader hex via the drive can put the device in an inconsistent state (“Bricked device” report on the Nordic DevZone) — only do this following the official recovery procedure.