News & Blog
Secure DFU OTA for nRF52840 solution modules: Guide to create hex/zip file for implementation - #1(Bootloader)
Here are the guidelines for users to implement Secure DFU OTA(over-the-air) while compiling using nRF52840 Solution modules.
(Click on link for Raytac nRF52840 module series)
IC: nRF52840
DK: PCA10056 (for nRF52840)
SDK: 17.1.0
Softdevice: s140_nrf52_7.2.0_softdevice.hex
IDE: Keil C
PC: Win 10
Below are the following steps to implement Secure DFU OTA by using nRF52840 chip set, SDK17.1.0.
It consists of 3 parts:
Part A: Bootloader
Part B: Application (Click for article link)
Part C: Combining and merging built files (Will be released in the upcoming article after Part B)
In this article, we will be focusing on Part A: Bootloader.
Part A: Bootloader
Path: nRF5_SDK_17.1.0_ddde560\examples\dfu\secure_bootloader\pca10056_s140_ble\arm5_no_packs
Step 1. An error may occur while building bootloader without a public key:
(Shown in red frames in below screenshot)

Step 2. How to generate the public key file in Bootloader?
A. Visit DOS at path: ..\Python27\Scripts
B. Then execute:
nrfutil keys generate private.pem
nrfutil keys display --key pk --format code private.pem --out_file public_key.c
Step 3. Copy the pk[64] code from (public_key.c) into (dfu_public_key.c)
(Shown in red frames in below screenshot)
※Note: Make sure to save the 3 generated files:
private.pem
public_key.c
dfu_public_key.c
![3-Copy pk[64] code 3-Copy pk[64] code](../upload/news_b/3a24ccc0d160bac79492085685627a5e.jpg)
Step 4. Generate the bootloader file: nrf52840_xxaa_s140.hex after re-compiling the code files.
※Stay tuned for #2 - Part B: Application in the next article, scheduled release in next week(29/05/2024).
Technical guidelines provided by R&D Manager: Mr. MW Lee
Edited by Sales Manager: Mr. Tony Yin
Raytac Corporation 勁達國際電子股份有限公司 A company of Abietec
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
Other News
-
Essential Tips for Verifying HEX Files to flash into Raytac nRF54L15 modules
Aug.06.2025UPDATE. -
MCUboot DFU Guide For Raytac MDBT50Q-DB-40 (Using NCS V2.9.1)
May.29.2025UPDATE.

