NNN40 Bootloader with BLE DFU service

Introduction

The main software components which go into a FOTA capable system. These include:

Softdevice: this is Nordic's encapsulation of the bluetooth stack. Application: the user's BLE application. Bootloader: which is responsible for firmware updates.

We provide a prebuild Bootloader;nrf51822_BLDR.hex for Delta NNN40 BLE-Wifi Combo module. No need to build this program. Just download (do not import) this program and unzip it. First, To combine nrf51822_BLDR.hex with the program which you developed on mbed. Second, download/flash the combined image to target. Then, User can program the NNN40 without going through the mbed interface chip over USB.

  • If you want to use Firmware OTA via BLE right away. You can update combined_BLDR_DFU_OTA.hex (Combined Application, Nordic SoftDevice and Bootloader) by using USB cable and goto Preparing the Application you want to update (program) to NNN40 section which described how to generate initial packet.

Init Packet /media/uploads/jimisu/screenshot_2015-10-26-16-27-08_-1-_a.png

Combine Bootloader-DFU with application which you developed

Preparing before you start

1. nrf51822_BLDR.hex (The bootloader Delta provided) The Bootloader with BLE OTA service for nRF51822 and NNN40 which we prebuild already.

2. Your Application which build on mbed (The sample image is BLE_APPwithSD_DELTA_DFCM_NNN40.hex) If you build your application on mbed the hex image combined Nordic SoftDevice with the application.

  • Softdevice: this is Nordic's encapsulation of the bluetooth stack.
  • Application: the user's BLE application.

3. You need to combine bootloader.hex and your application. by using srec_cat.exe (Download it from http://sourceforge.net/projects/srecord/files/srecord-win32/ ) We recommand / verify srecord-1.59-win32 by trial.

The combine command example; srec_cat s130_SD.hex -intel BLE_OTA_APP.hex -intel nrf51822_BLDR.hex -intel -exclude 0x3FC00 0x3FC20 -generate 0x3FC00 0x3FC04 -l-e-constant 0x01 4 -generate 0x3FC04 0x3FC08 -l-e-constant 0x00 4 -generate 0x3FC08 0x3FC0C -l-e-constant 0xFE 4 -generate 0x3FC0C 0x3FC20 -constant 0x00 -o combined_DFU_OTA.hex -intel pause

Preparing the Application you want to update (program) to NNN40

1. Download and install nRF Master Control APK from Google Paly/Google Market (for Andorid phone installation)

Master Control Panel APP /media/uploads/jimisu/screenshot_2015-11-24-17-07-54_a.png

2. Install nRF Master Control Panel (for PC installation) https://www.nordicsemi.com/eng/Products/nRFready-Demo-Apps/nRF-Master-Control-Panel-application

3. Build the image which you want to update on mbed by using App for FOTA mode. /media/uploads/jimisu/0b8fd2aab1050550d6da352ed7ff2be2.png

4. The format of the firmware image that you use to update the device firmware depends on the tool that you use to perform the DFU. The DFU bootloader expects the image in binary format; however, some tools automatically convert the image from HEX format to binary format.

  • Creating a zip with image and init packet*

If you use Master Control Panel or other tools by Nordic Semiconductor to update the device firmware, you must provide a zip that contains the image file and a corresponding init packet. To create this zip file, use the nrf.exe tool that is installed with the Master Control Panel. By default, the tool is located in the C:\Program Files (x86)\Nordic Semiconductor\Master Control Panel\<version>\nrf\ folder. Run nrf.exe dfu genpkg help to display usage instructions.

  • Generate a hex to a zip with image and init packet*

In my case; Open Windows CMD console with administator permittion. Go to C:\Program Files (x86)\Nordic Semiconductor\Master Control Panel\3.10.0.14\nrf\ copy your applicaiton; the .hex file to same destinatioin. In the prompt:

In the prompt:

nrfutil.exe dfu genpkg --application BLE_OTA_APP.hex BLE_OTA_APP.zip

Then, BLE_OTA_APP.zip will be generated. Unzip it you will get BLE_OTA_APP.bin and BLE_OTA_APP.dat Copy thoseBLE_OTA_APP.dat and BLE_OTA_APP.hex to the Android phone which will be using for DFU OTA.

OTA on progress /media/uploads/jimisu/screenshot_2015-10-22-15-38-36.png