This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Creating a bootable first article hex image for nrf52840 based hardware.

I am using SDK 15.3.0 and need to create a single hex file to program the initial batch of our nRF52840 based HW.
Currently, I have built the bootloader project (open not secure for now) and have a bootloader.hex file.

1. As a first step I created the bootloader settings file by:

nrfutil settings generate --family NRF52840 --application app_pca10056_s140.hex --application-version 0 --bootloader-version 0 --bl-settings-version 2 setting.hex

2. Merged bootloader hex file with setting (Apparently mergehex has a limit on number of input files to merge)

mergehex -m bootloader.hex setting.hex -o final-boot.hex

3. Merged the APP + SD + BL

mergehex -m app_pca10056_s140.hex s140_nrf52_6.1.1_softdevice.hex final-boot.hex -o firstArticle.hex

4. When I use nrfjprog to erasend program firstArticle.hex, nothing happens and the system is completely dead:

nrfjprog --family nRF52 --eraseall
nrfjprog --family nRF52 --program firstArticle.hex


However, If I go back to SEGGER and launch debugger for the bootloader (the one I used hex file for the above steps), the system boots and all is happy.

Can someone point me to what I am doing wrong? For now I am not using secure boot.

Related