Unerstanding of DFU OTA on legacy bootloder

Hello,


I have an application running on legacy NRF SDK and using the nRF5 bootloader, which has below flash sectors,
0x00000 - 0x026000 - Soft-device section
0x26000 - 0x0D9000 - Application section
0xD9000 - 0x0F8000 - Reserved section
0xF8000 - 0x100000 - Bootloader/settings/mrb

Now I want to perform a DFU OTA over this with my new application called the intermediate application. This shall have,
- two large byte arrays, of 50KB and 320KB
- A function that copies the above array to flash into a specific address(in 0x00000 to 0x062000); this function is a RAM function that loads into RAM.
- And a main function that calls this RAM function.

The flash sections of this intermediate application are as below,
0x00000 - 0x062000 - Space to paste two byte array data
0x62000 - 0x0BF000 - dedicates sectors to hold byte array in flash memory
0xBF000 - 0x100000 - Application section

What I want is to perform a DFU OTA of the intermediate application over the legacy application. Now the legacy application has a bootloader, softdevice, and application in the dedicated flash regions, while the intermediate application has a different flash layout compared to the legacy application.

So the question here is, is it possible for the legacy application bootloader to accept the intermediate application and perform DFU? Because the intermediate application does not have a softdevice, a bootloader, and the same flash layout that the legacy application expects.

If not, then can you suggest a way I can follow to achieve my goal?

Parents
  • Hi Ankit, 

    Could you explain what exactly you want to achieve by swapping the original application with the intermediate application ? Does the intermediate application has a softdevice ? What exactly the intermediate application does  ? Is it flashed just to perform some operation before being swapped with another application ? Does it have a softdevice ? 

    How familiar you are with the secure bootloader in nRF5 SDK. What you asking for is quite advanced and not something our bootloader support originally. 

  • Hello,

    Thank you for the response.

    My goal is to switch the nrf bootloader to MCUboot. I have multiple devices running on a legacy nRF application + bootloader. I ported this application to Zephyr + MCUBoot, and now I want to update the Zephyr application over the legacy nRF application. Due to hardware limitations, I am not able to access the SWD pins, so I cannot flash the Zephyr application straight away. 

    So, I have created an intermediate firmware that has two byte arrays. One array contains the raw bytes of the mcuboot binary zephyr.bin, and another array contains the raw bytes of the application binary zephyr_signed.bin.

    Along with this, I have created a RAM function that copies these raw byte arrays to a specific flash location as mentioned above.

    This approach is working as expected. I have tested this on devkits. After flashing the intermediate firmware over the legacy nRF application, it erases the required flash sectors, write new byte array data of the MCUboot and Zephyr application, and reboots the device. After this reboot, it starts with the MCUboot and zephyr application.

    Now, I need to perform the same thing through DFU OTA. The legacy nRF application supports BLE OTA DFU, and I have created a DFU package of intermediate firmware that can be transferred to the nRF application. But this part is not working, and the reason I suspect is my initial comment.

    I hope this will provide you with the required information that you are looking for. Let me know if you have doubts about any of the explanations.

    Thank you,
    Ankit.

Reply
  • Hello,

    Thank you for the response.

    My goal is to switch the nrf bootloader to MCUboot. I have multiple devices running on a legacy nRF application + bootloader. I ported this application to Zephyr + MCUBoot, and now I want to update the Zephyr application over the legacy nRF application. Due to hardware limitations, I am not able to access the SWD pins, so I cannot flash the Zephyr application straight away. 

    So, I have created an intermediate firmware that has two byte arrays. One array contains the raw bytes of the mcuboot binary zephyr.bin, and another array contains the raw bytes of the application binary zephyr_signed.bin.

    Along with this, I have created a RAM function that copies these raw byte arrays to a specific flash location as mentioned above.

    This approach is working as expected. I have tested this on devkits. After flashing the intermediate firmware over the legacy nRF application, it erases the required flash sectors, write new byte array data of the MCUboot and Zephyr application, and reboots the device. After this reboot, it starts with the MCUboot and zephyr application.

    Now, I need to perform the same thing through DFU OTA. The legacy nRF application supports BLE OTA DFU, and I have created a DFU package of intermediate firmware that can be transferred to the nRF application. But this part is not working, and the reason I suspect is my initial comment.

    I hope this will provide you with the required information that you are looking for. Let me know if you have doubts about any of the explanations.

    Thank you,
    Ankit.

Children
Related