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

Update 52840 firmware with aws_iot jobs with 9160 through external flash

Hello,

We're currently trying to update 52840 chip on a similar board such as the 9160dk, that has an external flash in between 9160 and 52840. We want to apply a firmware upgrade to 52840, but through LTE. Currently 9160 can be updated as expected, when we assign it a json job document telling it where to download the .bin file from an S3 bucket. This uses the aws_iot library, which again uses fota_download.

But, what we want to do further is to download another .bin file from the same server, forward it to external flash (we're using spi_nor) and once it's completed, tell 52840 through UART between 91 and 52, that there's a firmware available for 52. 52 then takes control over the external flash and applies the update by copying it from external flash to internal s1, and then reboots which triggers secure boot to validate and check if s1 is valid. If it is, perform a swap and apply the new update.

Based on this, a few questions have come to mind: Is there any examples or documentation that does something like this? I've seen this branch: DFU UART sample: update 52840 from 9160 · plskeggs/sdk-nrf@6baf0e0 · GitHub, but this looks like 9160 just forwards the entire update through UART?

How can we alter the fota_download to instead of writing to 9160 internal flash, send it to external flash with flash_write? Would we have to copy the contents of fota_download and create a fork of the SDK? Maybe there are CONFIG flags where we instead can set file download destination or something similar?

And regarding applying the upgrade to 52840; Which method is easiest and most beneficial to implement, apply the update by just telling MCUBOOT to check in external flash for firmware image, or manually copy the contents from external flash to 52840 internal s1 and perform a reboot and let MCUBOOT handle fw check and swap?

Regards,

EivindTH

  • Hi Håkon,

    Thanks for helpful advice. I successfully made FOTA for both 91 and 52 work, by utilizing download_client library. I managed to download to external flash and forward each fragment using callback for each fragment. I applied the same logic on 52840, and was able create a function built on top of spi_nor driver (called flash_read_file). This triggers a callback every time fragment size was reached during flash_read, where in this scenario on 52840, I used dfu_target library (and mcuboot as target) to send the fragments and apply the update.

    Just wanted to mention this and will mark this as verified answer, as the solution mentioned earlier does indeed work if anyone plans to do this themselves! Just keep in mind to handle how 9160 and 52840 both use the external flash ;)

    Kind Regards,

    EivindTH

Related