Home | pfodApps/pfodDevices | WebStringTemplates | Java/J2EE | Unix | Torches | Superannuation | CRPS Treatment | | About Us
 

Forward Logo (image)      

nRF52 Raspberry Pi Pico Programmer
2022 -- No Longer Recommended

by Matthew Ford 23rd March 2024 (originally posted 10th April 2023)
© Forward Computing and Control Pty. Ltd. NSW Australia
All rights reserved.

Building a CMSIS-DAP-V2 programmer
from a Raspberry Pi Pico – NO LONGER RECOMMENDED

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.

Introduction

This tutorial covers building an CMSIS-DAP-V2 programmer for nRF52 devices from a Raspberry Pi Pico RP2040. 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.

Building the Pi Pico CMSIS-DAP programming module

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.

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)

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

GPIO (Pin)

Function

Resistor

Jumper

Comment

– (3V3)

BLE VCC

none

Red


– (GND)

BLE GND

none

Black


GPIO-11

SWCLK/TCK

100R

White


GPIO-12

SWDIO/TMS

100R

Purple


GPIO-0 (pin 1)

TX

100R

Blue

Connects to BLE Rx pin

GPIO-1 (pin 2)

RX

100R

Yellow

Connects to BLE Tx pin

GPIO-13

TDI – not used




GPIO-14

TDO – not used




GPIO-15

nReset – not used




GPIO-2

Status – not used




GPIO-25 (Led)

DAP Status – not used






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.

AndroidTM is a trademark of Google Inc. For use of the Arduino name see http://arduino.cc/en/Main/FAQ


The General Purpose Android/Arduino Control App.
pfodDevice™ and pfodApp™ are trade marks of Forward Computing and Control Pty. Ltd.




Forward home page link (image)

Contact Forward Computing and Control by
©Copyright 1996-2024 Forward Computing and Control Pty. Ltd. ACN 003 669 994