FunWithElectronics.com
          - Collection of Information for those with Electronics as a Hobby
Up one level (nRF51822)

Program the BLE soft device of nRF51822 (Linux)

<-- Back to Part 1

If you haven't read the tutorial "How to develop for nRF51822 on Linux using GCC", go back.

This page explains how to program the Bluetooth Low Energy soft device to the nRF51822 using the Linux command line.





  1. From the http://www.nordicsemi.com/ web site, download the newest version of the nRF51822-SD (BLE soft device). This is possible after registering the evaluation kit.

  2. When you have the s110_nrf51822_5.0.0_softdevice.hex file, you need to convert it to two .bin files by running these commands:
    /opt/arm-2012.09/bin/arm-none-eabi-objcopy -I ihex  -O binary --only-section .sec3 s110_nrf51822_5.0.0_softdevice.hex s110_uicr.bin
    /opt/arm-2012.09/bin/arm-none-eabi-objcopy -I ihex  -O binary --remove-section .sec3 s110_nrf51822_5.0.0_softdevice.hex s110_mainpart.bin
    
    (There may be a newer version of the SD when you read this)

  3. Start StartJLinkExe.sh (you can start it with ./segger/segger.sh from the "simple-nrf51822-linux" project directory. See here) and execute these commands:
    r
    w4 4001e504 1
    loadbin s110_uicr.bin 0x10001000
    loadbin s110_mainpart.bin 0
    r
    g
    
    The soft-device is now installed on the device!!! (if you don't get any error messages) If it doesn't work, try to erase the flash first (see below).


Erase the flash:

In order to erase the flash content, start StartJLinkExe.sh and execute these commands:
w4 4001e504 2
w4 4001e50c 1
w4 4001e514 1
r



Add a comment:

Fill in number
Name:
Title:
Text:
 
mergehex ? - sandeep (2014-08-04 15:21:58)
is it possible to mergehex the app and the softdevice to do this in one shot ?
changes in S110 v7 - Scott (2014-07-17 10:22:49)
As of version 7 this has changed again. The UICR is no longer included in the binary as the flash is no longer locked to allow 'over the air' updates. This means you just need to run an ordinary objcopy and write a single file to 0x0. So 1) arm-none-eabi-objcopy -I ihex -O binary s110_v7.hex s110_v7.bin 2) loadbin s110_v7.bin 0 3) loadbin myprogram.bin 0x16000
- Ruben (2013-12-15 13:27:26)
@Benoit: Go back to Part 1
And your app ? - Benoit (2013-12-13 17:12:15)
So with this command you install softdevice. But I don't understand how to install and run my app then ? What's the next step ?


Privacy | Contact