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

DFU OTA Firmware Image for production

Hi, I've an application developed with SDK v8.0.0 and S110 v8, that is using the bootloader to start the main firmware and to start the DFU OTA (in case the user request to do a firmware upgrade).

My development system is Linux, with gcc and JLinkExe to load the bin files on the nRF.

I'm testing the system doing these steps:

1. Compile the bootloader and the application firmware.

2. Flash the Softdevice at address 0x00000000.

3. Flash the Bootloader at address 0x0003B000 (bootloader is configured for 20KB).

4. Write UICR.CLENR0 (0x18000), write UICR.BOOTLOADERADDR (0x3B000).

5. nRF starts advertising with the DFU service.

6. Load the main application firmware using nRF Toolbox iOS app.

Using this procedure, the application firmware starts correctly and I can use my firmware and also reload the same firmware (just for test) using the nRF Toolbox app.

This procedure is long, so I decided to dump the whole flash of the nRF using JLinkExe to use as an image for the next devices:

JLinkExe> savebin /home/samuele/flash.bin 0x00000000 0x40000

I then load the created image on another nRF board (using the loadbin command of JLinkExe), the application starts correctly but I'm no more able to load the same firmware via the nRF Toolbox app because it says "Error on Init packet. Operation failed."

Since the only things that change between the two nRF boards are some values set in the UICR.CUSTOMER registers (we use UICR.CUSTOMER for model, serial numbers, etc), I tried to set the UICR.CUSTOMER of the second board to the same values as that in the first board, then I reset the board and try to load the firmware again: now everything goes well and the firmware is upgraded with the nRF Toolbox app.

Now, I would like to know why the differences in the UICR.CUSTOMER registers are causing problems with the init packet of the bootloader?

What kind of checks are performed on the init packet beyond those documented on the SoftDevice Init Packet documentation?

How can I create a dump of the flash memory of the nRF so that I do not have to load my application firmware via BLE?

Thanks for any suggestions.

Samuele.

Related