Secure DFU OTA for nRF52840 solution modules: Guide to create hex/zip file for implementation – #3(Combining/merging built files)

Following up – Part A: Bootloader (Click for article link) and Part B: Application (Click for article link)

We will be focusing on:

in this article.

IC: nRF52840
DK: PCA10056 (for nRF52840)
SDK: 17.1.0
Softdevice: s140_nrf52_7.2.0_softdevice.hex
IDE: Keil C
PC: Win 10



Step 1. Execute the combine batch file in bootloader (nrf52840_bootloader_setting_merge.bat) and generate file of nrf52840_bootloader_secure_combin_settings.hex :

@echo off
title = [ J-Link Tool ] %CD%
set nrfDir=C:\Program Files (x86)\Nordic Semiconductor\nrf5x\bin
set BS= nrf52840_bootloader_secure_settings.hex
set BL= nrf52840_xxaa_s140.hex
set BSBLCombind= nrf52840_bootloader_secure_combin_settings.hex
set path=%nrfDir%;%path%
pause
echo ———–merge image file——————-
mergehex.exe -m %BS% %BL% -o %BSBLCombind%
pause


Step 2. Create a Final.hex file by 3-in-1 batch file(nrf52840_3in1_merge.bat)
※Note : This hex file is created for the production line to pre-load firmware into modules prior to shipment.

@echo off
title = [ J-Link Tool ] %CD%
set nrfDir=C:\Users\user\Desktop\Nordic BLE\nRF5_merge tools\nRF52 bin
set SD= s140_nrf52_7.2.0_softdevice.hex
set BLT= nrf52840_bootloader_secure_combin_settings.hex
set APP= nrf52840_xxaa.hex
set SD_BLT=SD_BLT.hex
set Finalfile=Final.hex
set path=%nrfDir%;%path%
pause
echo ———–merge image file——————-
mergehex.exe -m %SD% %BLT% -o %SD_BLT%
pause
mergehex.exe -m %SD_BLT% %APP% -o %Finalfile%
pause


Step 3. Create a DFU(OTA).zip file of nrf52840_xxaa.zip
※Note : This zip file is created for end device DFU(OTA) implementation.

nrfutil pkg generate –hw-version 52 –sd-req 0x100 –application-version 0xFF –application
nrf52840_xxaa.hex –key-file private.pem nrf52840_xxaa.zip

The DFU OTA zip file will be derived.

※Note :
The “0x100" appeared in the above DOS code(in red font) is the FWID(Firmware ID) for s140_nrf52_7.2.0_softdevice.hex;
FWID can be found from the soft device documents on the Nordic website.



Step 4: Run DFU OTA (On mobile in this example)


4A. Install the nRF Connect APP on mobile, with DFU OTA file: nrf52840_xxaa.zip. (Download link)


4B. Send nrf52840_xxaa.zip via email to mobile device after combination is done on PC, then download it.


4C. Open nRF Connect APP and run connection;


4D. Execute DFU and select “Distribution packet(ZIP)", thus starting the DFU OTA process.


4E. Start DFU OTA → exit the APP after DFU OTA is completed → restart the mobile device.



Secure DFU OTA for nRF52840 solution modules: Guide to create hex/zip file for implementation
Detailed links of articles:
Part A: Bootloader (Click for article link)
Part B: Application
(Click for article link)
Part C: Combining and merging built files
(Click for article link)



Technical guidelines provided by R&D Manager: Mr. MW Lee
Edited by Sales Manager: Mr. Tony Yin

Raytac Corporation 勁達國際電子股份有限公司 
Bluetooth & WiFi module maker based on Nordic nRF54, nRF53, nRF52, nRF7002 solution
BT5.4 &BT5.3 & BT5.2 & BT5.1 Qualified, FCC/IC/CE/Telec/KC/RCM/SRRC/NCC Pre-Certified.
Bluetooth Solution: nRF54, nRF5340, nRF52840, nRF52833, nRF52832, nRF52820, nRF52811, nRF52810, nRF52805, nRF51822
WiFi Solution: nRF7002
http://www.raytac.com
email: service@raytac.com
Tel: +886-2-3234-0208

Nordic nRF52840 Overview

 

Raytac Corporation

Bluetooth module maker based on Nordic nRF51 & nRF52 solution 
(Nordic nRF51822 & nRF51422 & nRF52832 & nRF52840)
Bluetooth Specification Version: BT4.0 & BT4.1 & BT4.2
Tel: +886.2.3234.0208
email: service@raytac.com
 
Quoted from Nordic
 

nRF52840

Advanced Multi-protocol SoC supporting Bluetooth 5 / ANT /802.15.4 / 2.4GHz Proprietary Acitve

Bluetooth 5-ready Nordic nRF52840 multi-protocol SoC released!

 

Raytac Corporation

Bluetooth module maker based on Nordic nRF51 & nRF52 solution 
(Nordic nRF51822 & nRF5142 & nRF52832 & nRF52840)
Bluetooth Specification Version: BT4.0 & BT4.1 & BT4.2
Tel: +886.2.3234.0208
email: service@raytac.com
http://raytaccorp.blogspot.tw/2016/12/bluetooth-5-ready-nordic-nrf52840-multi.html

Quoted from Nordic Press released!
https://www.nordicsemi.com/eng/News/News-releases/Product-Related-News/Bluetooth-5-ready-SoC-from-Nordic-redefines-scope-for-smart-home-IoT-and-wearables-by-delivering-4x-range-2x-bandwidth-and-best-in-class-security

Nordic Semiconductor has today released the new nRF52840 multi-protocol SoC with on-chip support for the upcoming Bluetooth 5 specification. In addition to Bluetooth 5 the nRF52840 also introduces on-chip support for the 802.15.4 standard. With Bluetooth 5’s new high throughput and long range modes and 802.15.4, it offers unparalleled development opportunities for connected devices for IoT. These opportunities include advanced single-chip wearables, wearables with payment options and connected home devices.
 
Bluetooth 5 will undergo ratification by the Bluetooth SIG beginning December 6th2016. Upon completion, we will provide Bluetooth 5-ready SoftDevices to support nRF52840 and the nRF52832 (high-throughput mode only).