Think & Create

nRF51822 with Arduino development

by on Nov.20, 2016, under My gadgets

This is my experiment of burn bootloader on nRF51822 and upload code with serial cable and Arduino IDE.

 nrf51822arduino

Tool package:

Tools come from RedBearLab/nRF51822-Arduino. However, their focus is now on S130 softdevice which does not support serial bootloader. So we will keep using the old branch at

https://github.com/RedBearLab/nRF51822-Arduino/archive/master.zip

Burn bootloader.

I used a J-link programmer to burn bootloader on nrf51822. You can get j-link software on https://www.segger.com/downloads/jlink

Once it is installed, go to bootloader folder in terminal and type:

jlinkexe -device NRF51822_XXAC -if SWD -speed 4000 -autoconnect 1

w4 4001e504 2

w4 4001e50c 1

w4 4001e514 1

r

w4 4001e504 1

loadfile bootloader_Avrdude_OTA_HCI_20150714.hex

If you don’t see any error. You can proceed to upload firmware.

if you see error like: “Old firmware which does not support pausing periodic actions during flash download”. You may want to try lower version of J-Link Software. My J-link worked on V5.12 but not on V6.10.

Config Arduino environment

You need to copy RBL folder from hardware folder in repo zip to the hardware folder in Arduino app. Then you can restart Arduino and see the RBL nRF51822 board.

copyhardwarefolder

Upload code

Since regular serial cable won’t be able to reset nRF51822. You need to manually press reset button when compile about to end. So nRF51822 will stay in bootloader for a few seconds (LED on P19 will blink). Then avrdude can upload successfully.


Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...