Write to external flash via OTA?

I am looking to design a board with two microcontrollers, the nRF52840 will be the primary micro plus another that will be connected via UART.

The second micro can be updated via an inbuilt bootloader via the UART. I would like to, if possible, use the existing OTA functionality on the Nordic to push a combined package for both micros.

Has anyone do anything similar? How did you go about it?

My first thoughts were something like, combine the two hex files, offset the second micro addressing, possible to a external flash connected to the Nordic, extending the memory address, then have the OTA process write to that extended memory address. I then later manage the sending over serial part.

I had also through about streaming the data via the UART service but we need upgrade fallover recovery, that's why I'm thinking external flash, where I could possibily do a A/B bank system.

Any thoughts, suggestions, similar attempts or implementations?

Parents
  • Hello,

    Seeing as you want to upload a custom image, that is going to run on a custom* bootloader, I don't think it is feasible to transfer this together with the image update for the nRF52840.

    *custom meaning a bootloader written either by you or a 3rd party device manufacturer.

    Can you please confirm whether or not the second microchip is running Zephyr as well? I will assume it is not for now. 

    The DFU solution in NCS consists of two parts. Part one is the transfer of the image, while part two is the execution of the image, meaning performing the swap to the new image. 

    Perhaps you want to piggyback on part one, the transfer, but in my honest opinion, the DFU/MCUMGR is quite complex. It may be a lot easier to just write a proprietary BLE service that you can use to transfer the custom image to the nRF, which you can then use later to perform the DFU on the second microchip. If you really want to piggyback on the transport functionality of MCUMGR (SMP server), then that might be possible, but you need to look at how it works and find some way to tell it to not try to install this image to the nRF52840. 

    But my honest opinion is that it is probably easiest to create your own BLE service that you use to transfer your custom image. Then you can tranfer this image to a specific place in flash, then you tranfer the image for the nRF52840, then you perform the serial DFU to the second micro, and then you perform the swap on the nRF52840. 

    Best regards,

    Edvin

  • Thanks Edvin, I suspected that might be the case but hoped there might be a solution, maybe involving external flash and memory mapping. I suspect we'll go down the BLE service route rather than modifying the existing DFU. It should be straight forward enough to handle at the application level. We'll just have to see what the mobile apps team say to that Slight smile

Reply
  • Thanks Edvin, I suspected that might be the case but hoped there might be a solution, maybe involving external flash and memory mapping. I suspect we'll go down the BLE service route rather than modifying the existing DFU. It should be straight forward enough to handle at the application level. We'll just have to see what the mobile apps team say to that Slight smile

Children
No Data
Related