Loading...
Uncategorized

Cheap Arm Programmer

DSC_9764
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:

  1. Cut J11 Trace. This disables programming the main KL25Z microcontroller.DSC_9767
  2. Install a 1mm pitch, 10 Pin header at J6. Little bit difficult to solder due to the fine pitch.DSC_9766
  3. 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. DSC_9770
  4. Hold RST while plugging it in. This loads it into OpenSDA firmware upload mode.DSC_9768
  5. See a new drive image
  6. Download Freescale Quickstart here and copy CMSIS-DAP_OpenSDA.S19 to the Bootloaderimage
  7. Unplug and plug back in. Now Freescale is in CMSIS-DAP mode.
  8. Connect your custom board DSC_9763
  9. Set to CMSIS-DAP (I’m using Keil) image
  10. Switch to SW programming and not JTAG image

And now you can program. The one caveat is that it won’t autoreset my board. I have to disconnect.
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.