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

How to update software using the bootloader?

Hello!

I use a usb secure bootloader with MBR (without SD) for update my application via USB. Also, my application receives new firmware via GSM modem and saves it to an external flash. After receiving the update, I check it and write it to the internal flash (in bank 1). 

How to correctly record the necessary data for the bootloader (length, scc) and pass control to it to update the application?

I use nRF52840, nRF5_SDK_15.2.0.

Best regards

  • Hi Valery, 

    I assume that you have done the part to copy the image from external flash to bank 1 in the internal flash in your application.

    Now you just need to trigger the bootloader to swap the image. 

    This is very similar to what we have in our IOT background DFU where the image is received via TFTP and the application trigger a reset so the bootloader can swap the image. 

    Could you have a look inside the example especially those inside         #if NRF_DFU_IN_APP . These are the part of the code that used in background DFU (in the application). 

    Also pay attention to  #if NRF_BL_DFU_ALLOW_UPDATE_FROM_APP in the code (in nrf_bootloader.c and nrf_dfu_settings.c) .( NRF_BL_DFU_ALLOW_UPDATE_FROM_APP  should be set to 1) It's where the bootloader validates the image it have to swap. 

Related