This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Update code via UART instead of FOTA nRF9160

Hello,

I am using your NRF9160 chip and need Nordic team help.
I have refer to your FOTA sample, I am looking for a safer solution for updating code. On my board, I use ESP32, Is there any way to download the app_update.bin file with ESP32 chip and transmit that file via the UART line for the Nordic chip?

In our living area, NB-IoT signal is not really popular, so it's hard for me to update the FOTA with NB-IoT.

Thanks

Parents
  • Yes, this is possible. All you need to do is the following:

    1. Place app_update.bin in the secondary slot of the nrf9160
    2. Reset the nrf9160
      1. The mcuboot will then check the secondary slot and if it finds a valid image, it will swap it with the image in the primary slot and boot the new image
    3. Mark the image as "okay" to prevent rollback on next reset
      1. This can be done from the image itself using boot_write_img_confirmed()

    You can set up everything yourself, by sending app_update.bin one block at the time over UART from the ESP32 to the nRF9160  and putting it in the secondary slot. Then executing step 2 and 3 from the nRF9160.

    You can also use the mcumgr protocol, which supports commands that makes it possible to send the image, confirm the image and reset the client (nrf9160) from the host (ESP32) side. We do have solutions for this in NCS/Zephyr, however if the ESP32 doesn't support NCS/Zephyr I think you'll have some work to do, but it should be manageable.

    Please let me know what approach sounds the best and if you have any more question.

    Best regards,

    Simon

Reply
  • Yes, this is possible. All you need to do is the following:

    1. Place app_update.bin in the secondary slot of the nrf9160
    2. Reset the nrf9160
      1. The mcuboot will then check the secondary slot and if it finds a valid image, it will swap it with the image in the primary slot and boot the new image
    3. Mark the image as "okay" to prevent rollback on next reset
      1. This can be done from the image itself using boot_write_img_confirmed()

    You can set up everything yourself, by sending app_update.bin one block at the time over UART from the ESP32 to the nRF9160  and putting it in the secondary slot. Then executing step 2 and 3 from the nRF9160.

    You can also use the mcumgr protocol, which supports commands that makes it possible to send the image, confirm the image and reset the client (nrf9160) from the host (ESP32) side. We do have solutions for this in NCS/Zephyr, however if the ESP32 doesn't support NCS/Zephyr I think you'll have some work to do, but it should be manageable.

    Please let me know what approach sounds the best and if you have any more question.

    Best regards,

    Simon

Children
Related