So you have a custom ARM Cortex-m0 (or other) board you want to program. Perhaps, like me, it’s a custom board using Nordic Semiconductors nRF51422/822/922. You may have bought an Evaluation Kit with a built in J-Link debugger. However, once you move to a custom board you now face the problem of programming it.
I bought both the nRF51422-EK and nRF51422-DK. Each kit was $100 USD. The EK did what I wanted, the DK “requires” the nRFgo development kit which is $400 dollars. What you might not know is that this board provides only power and the nRF51422-DK comes with a Segger J-Link lite. The J-link Lite is what I’ve been using to program my custom boards. I think $100 dollars for a programmer is ridiculous. My AVR was $50 dollars and that allows me to do everything.
Enter CMSIS-DAP. It seems this is intended to add debug functionality and firmware updating to embedded applications but looks like you can use it as a standalone programmer without any restrictions (like with the J-Link EDU; Cost effective but limited to Educational).
So pick yourself up a $14 Freescale Freedom FRDM-KL25Z. Cheaper than an Arduino and way more powerful with a 3 axis accelerometer, a tri colour LED and a capacitive sensor. It has two microcontrollers – the main one and a little one running OpenSDA. With OpenSDA you can load up a CMSIS-DAP firmware from Freescale and program other boards. Credit to www.mcuoneclipse.com for the idea.
Here is how:
- Cut J11 Trace. This disables programming the main KL25Z microcontroller.
- Install a 1mm pitch, 10 Pin header at J6. Little bit difficult to solder due to the fine pitch.
- Break Pin 7 off – This is the Key pin. This isn’t needed if you don’t have a blocked pin on your ribbon cable.
- Hold RST while plugging it in. This loads it into OpenSDA firmware upload mode.
- See a new drive
- Download Freescale Quickstart here and copy CMSIS-DAP_OpenSDA.S19 to the Bootloader
- Unplug and plug back in. Now Freescale is in CMSIS-DAP mode.
- Connect your custom board
- Set to CMSIS-DAP (I’m using Keil)
- Switch to SW programming and not JTAG
There are other firmwares for programming but they are locked to Freescale Devices. The CMSIS-DAP isn’t. The trade off is that you lose the Serial to USB lines on the OpenSDA programmer. Oh well.