This is my experiment of burn bootloader on nRF51822 and upload code with serial cable and Arduino IDE.
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
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
w4 4001e504 1
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.
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.