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

DFU and settings

Hello,

I have reserved an area in my flash mapping for settings (0x2000 length). I would like to update it (without application) with DFU / secured bootloader / nRF toolbox on Android. Is that possible ? If yes, what are the settings to generate the zip update file (my source is an hex file) and flash. 

I tried the same way that application but it looks like uploaded change the application start address and it fails to boot (normal).

Thank you

Parents
  • Hi Fabien, 

    The bootloader is designed so that an application update will always resign in the predefined location (right after the softdevice). This explain why when you update your setting data it doesn't work. 

    For your purpose, if you don't want to modify the bootloader I would suggest you can think of sending/receiving the setting data in your application and then store it to where you need.

    If it's ok to modify the bootloader then you can think of either define a new type of image see dfu_fw_type_t inside dfu-cc.pb.h

    Or you can re-use DFU_FW_TYPE_EXTERNAL_APPLICATION , but you define a special location that you will store the image. When an image is generated as DFU_FW_TYPE_EXTERNAL_APPLICATION  (in nrfutil you use --external-app) the bootloader will only store it in the swap bank (bank 1) and won't replace the application with the new image. 
    So in your case, you just need to modify the bootloader so that when it receive the DFU_FW_TYPE_EXTERNAL_APPLICATION  it will store the image in the data location that you selected instead of bank1 location. Doing this you don't need to modify the nrfutil or the app on the phone for the task. 

Reply
  • Hi Fabien, 

    The bootloader is designed so that an application update will always resign in the predefined location (right after the softdevice). This explain why when you update your setting data it doesn't work. 

    For your purpose, if you don't want to modify the bootloader I would suggest you can think of sending/receiving the setting data in your application and then store it to where you need.

    If it's ok to modify the bootloader then you can think of either define a new type of image see dfu_fw_type_t inside dfu-cc.pb.h

    Or you can re-use DFU_FW_TYPE_EXTERNAL_APPLICATION , but you define a special location that you will store the image. When an image is generated as DFU_FW_TYPE_EXTERNAL_APPLICATION  (in nrfutil you use --external-app) the bootloader will only store it in the swap bank (bank 1) and won't replace the application with the new image. 
    So in your case, you just need to modify the bootloader so that when it receive the DFU_FW_TYPE_EXTERNAL_APPLICATION  it will store the image in the data location that you selected instead of bank1 location. Doing this you don't need to modify the nrfutil or the app on the phone for the task. 

Children
No Data
Related