OTA Automatically Reset and Start the Application After Flashing a Merged Hex File

Hello Nordic Team,

I am  working on  the nRF52833 using nRF5 SDK 17.1.0 and i  have implemented OTA DFU in our application. in OTA We have merged all firmware into a single HEX file and flashed it to the device. after flashing the merged HEX file. We need to manually reset or power-cycle the hardware for the application to begin running.

Our requirement is for the device to reset automatically through firmware/software after flashing is completed. We do not want to send a reset command manually or perform a hardware   through reset.

I will share the scenario

Generated Bootloader DFU settings .hex file and stored it in: bl_settings.hex

Bootloader DFU Settings:
* File: bl_settings.hex
* Family: nRF52
* Start Address: 0x0007F000
* CRC: 0x41774DEA
* Settings Version: 0x00000002 (2)
* App Version: 0x00000001 (1)
* Bootloader Version: 0x00000001 (1)
* Bank Layout: 0x00000000
* Current Bank: 0x00000000
* Application Size: 0x0000F0E4 (61668 bytes)
* Application CRC: 0xD9F2EDB8
* Bank0 Bank Code: 0x00000001
* Softdevice Size: 0x00000000 (0 bytes)
* Boot Validation CRC: 0xE22406CE
* SD Boot Validation Type: 0x00000000 (0)
* App Boot Validation Type: 0x00000001 (1)


C:\Users\admin>mergehex --merge s140_nrf52_7.2.0_softdevice.hex secure_bootloader_ble_s140_pca10100.hex Echo_UnderDash_II.hex bl_settings.hex --output final_dongle.hex
Parsing input files.
Merging file "s140_nrf52_7.2.0_softdevice.hex" into output.
Merging file "secure_bootloader_ble_s140_pca10100.hex" into output.
Merging file "Echo_UnderDash_II.hex" into output.
Merging file "bl_settings.hex" into output.
Storing merged file.

C:\Users\admin>nrfjprog --eraseall
Erasing user available code and UICR flash areas.
Applying system reset.

C:\Users\admin>nrfjprog --program final_dongle.hex --verify
[ #################### ] 3.035s | Program file - Done programming
[ #################### ] 2.965s | Verify file - Done verifying

i want After flashing, the device should reset automatically and start the application.

We do not want to send a reset command manually or perform a hardware reset. 

We do not want to use the nrfjprog --reset command. The device should automatically reset and start the application through firmware/software after the flashing process is completed, without requiring any manual reset command or hardware reset.

Thanks,

Embel.Tech

Parents
  • Hello,

    By design, the chip is not reset automatically when you program something to it. There are many reasons for this, for example that you may want to program more hex files without a reset in between (e.g. when working with a bootloader, if you reset it after flashing the bootloader, it will create bootloader settings partitions, but you may want to program your own bootloader settings from a hex file before you reset the device).

    However, you can attach the argument --reset at the end of your program command, like this:

    nrfjprog --program final_dongle.hex --verify --reset

    This will program the device, and reset it when it is done verifying the hex file on the target.

    Does that work for you?

    Best regards,

    Edvin

Reply
  • Hello,

    By design, the chip is not reset automatically when you program something to it. There are many reasons for this, for example that you may want to program more hex files without a reset in between (e.g. when working with a bootloader, if you reset it after flashing the bootloader, it will create bootloader settings partitions, but you may want to program your own bootloader settings from a hex file before you reset the device).

    However, you can attach the argument --reset at the end of your program command, like this:

    nrfjprog --program final_dongle.hex --verify --reset

    This will program the device, and reset it when it is done verifying the hex file on the target.

    Does that work for you?

    Best regards,

    Edvin

Children
No Data
Related