CMSIS-DAP-V2 Programmer -- Simple With Raspberry Pi Pico -- No Longer Recommended

by drmpf in Circuits > Arduino

1562 Views, 0 Favorites, 0 Comments

CMSIS-DAP-V2 Programmer -- Simple With Raspberry Pi Pico -- No Longer Recommended

PiPicoProgramming.jpg

Update 23rd March 2024 – This programmer is no longer recommended. Use MuseLab DAPLink instead. The Pico programmer just stopped working. The SWDIO pin on the nRF52832 did not respond to the SWCLK startup pulse and resulting in an OpenOCD msg

Error: Error connecting DP: cannot read IDR.

Reprogramming did not fix this. However switching to MuseLab DAPLink worked just fine.

This is a very short Instructable (because is it very simple) on how to build a CMSIS-DAP-V2 programmer from a Raspberry Pi Pico (RP2040) for programming nRF52 BLE modules via Arduino.

Over the years there have been a number of CMSIS-DAP programmers for nRF52 that can be used with Arduino via Easy Very Low Power BLE in Arduino - 2022. Most of these are no longer available. This tutorial covers building your own using a RP2040 board and a pre-compiled uf2 file from https://github.com/ataradov/free-dap. No source code building, which is problematic on Windows, is required. This build was tested on a Windows 10 computer.

Background

Most of the programmers and BLE modules used in the previous Very Low Power BLE made Easy with Arduino – 2019 tutorial are no longer available or exorbitantly expensive. The MuseLab DAPLink is an inexpensive programmer. This project is a very simple DIY alternative using the inexpensive Raspberry Pi Pico board.

See Easy Very Low Power BLE in Arduino – 2022 for details on the currently available “bare board” BLE modules and how to use these programmers.

Supplies

Parts List:-

1 x Raspberry Pi Pico e.g. DFRobot ~US$4 or Adafruit 4864 ~US$4 or your favourite supplier

4 x 100R resistors e.g. DFRobot resistor pack of 20 each of a 100 different values ~US$8.50 or Adafruit pack of 25 x 100R ~US$0.75

6 x Female jumpers e.g. DFRobot pack of 9 ~US$1.80 or Adafruit pack of 20 ~US$1.95

3mm shrink wrap e.g. Adafruit pack ~US$4.95

free_dap_rp2040.uf2 – a local copy of the pre-compiled CMSIS-DAP-V2, sourced from https://github.com/ataradov/free-dap (Mar 7, 2020, commit 2e12df92c37dd3d641d280f6ca07ad94703ca96c)

Building the Pi Pico CMSIS-DAP Programming Module

PiPicoPins.jpg
CMSIS_pins.jpg

Building the programmer is as simple as dragging and dropping the uf2 file onto the Pi Pico and adding some 100R protection resistors to the outputs.

Programming the Raspberry Pi Pico

1) With the Pi Pico unplugged, press the BOOTSEL push button and then plug the board into your computer's USB port

2) This should install a RPI-RP2 drive in your file explorer

3) Drag and drop the free_dap_rp2040.uf2 file to the RPI-RP2 drive

4) Finished!! Unplug the Pi Pico and wire up the jumpers and resistors.

Wiring Up the Raspberry Pi Pico

Finally add the 100 ohm protection resistors as shown above. Note the jumpers are soldered half way down the wires so that when the shrink wrap is added it supports the solder joint.

The free-dap software creates these connections on your Pi Pico shown in the image above.

That's all. Finished!!

Installing the low power support for the nRF52832 in Arduino

See Easy Very Low Power BLE in Arduino – 2022 for how to install the Arduino support for low power nRF52832 and how to program the BLE modules and remove the program protection using CMSIS-DAP programmers.

Conclusion

This tutorial has shown how you can easily build your own CMSIS-DAP programmer from the inexpensive Raspberry Pi Pico to work with Easy Very Low Power BLE in Arduino – 2022.