Playing with nRF51822 BLE module

Posted by dhanishvijayan 19/07/2018 0 Comment(s)

This post introduces the tools and environment for getting started with the NRF51822 based development. The chipset we used has ARM Cortex M0 in it, with highly configurable peripherals such that the UART,SPI,I2C peripherals can be connected to any Port pins!! 

Tools used

  • Segger Embedded Studio
  • nRF51 SDK version 5.2.0
  • nRF51 Softdevice version 6.0.0
  • JLink debugger/programmer

Using Segger embedded studio with softdevice v6.0 + nRF SDK 5.2.0 


Download the file from from below link (

Extract to C:/ nordic_semi/

Download the the softdevice hex file v6.0 from the below link



Programming softdevice core

There are two ways to program the Softcore hex file. 

1) Use nRFgo Studio to program the softdevice.

Press Erase all.

Browse the s110_nrf51822_6.0.0_softdevice.hex file and put 80 in the softdevice size.

Press Program button


nRFgo doesnot work in Linux.

2) Programming Softdevice using nrfprog commandline utility

For Linux users as usual commandline comes to the rescue. And is more powerful and handy at the same time..

Download the programming utility from

  • Erase the chip using

./nrfjprog -f NRF51

  • Program the softdevice core

./nrfjprog -f NRF51 --program <pathto file>/s110_nrf51_8.0.0_softdevice.hex



Using Segger Embedded Studio to run the SDK samples


Use the segger embedded studio to import the sdk project from C:\nordic_semi\ nrf51_sdk_v5_2_0_39364\examples using File -> Import Project -> Keil project.


Open the projects from the folder PCA10001+S110. This will ensure that the project suits nRF51422 chip which is similar to our intended nRF51822. S110 folder specifies that the code is compatible with the softdevice S110 which we program in the above section.

Important: Don’t press program button straightaway. We need to change the Device and Linker script first. 

Go to project build options(not solution build options), by right clicking on the project name(not solution name) and select “Edit Options”.


Select Debugger Tab.

Change the Target Connection to JLink

Target device to nRF51822_xxAA


Select Build Tab

Change the Memory Segment to

FLASH RX 0x00014000 0x0002C000

SRAM RWX 0x20002000 0x00002000


Try compiling the code.

Note: If there is any error like "core_cm0.h file not found" - then copy all files from C:\nordic_semi\nrf51_sdk_v5_2_0_39364\components\toolchain\gcc\ to C:\nordic_semi\nrf51_sdk_v5_2_0_39364\components\toolchain\


It is important to erase the device using nRFgo or nRFcommand tool, if you want to run the examples without using softcore.

Happy Hacking!!


Write a Comment