UART DFU of a nRF9160 in recovery mode via nRF5340.

Hello everyone, 

I guess my question is more conceptual rather than a specific issue with the code. 

I am working on a device featuring an nRF5340 chip and an nRF9160 chip which are linked by a UART interfface and 4 gpios. When it comes to DFU, i am able to update the firmware of the nRF5340 without issues. Although it could be possible to update the nRF9160 via LTE, the device might need to be updated in areas where there is no LTE connection available. For the update of the nRF9160 I would like to send the data to the nRF5340 via BLE which should transfer the new image to the nRF9160. While the nRF5340 has two slots in flash, the nRF9160 has only one slot and will be put in recovery mode for the DFU. 

To transmit the images over BLE, an ios app is going to be written. 

I have read the following posts, which tackle similar ideas : 

 nRF91 firmware upgrade over BLE  Here the image is sent via a PC running mcumgr commands and the nRF52 DK simply forwards it to the nRF9160. 

  Example For Using UART DFU on NRF52832 on both sides of communications  This post highlights the fact that mcuboot expects the image to be sent using the smp protocol. Or alternatively to modify the part of mcuboot especially the function boot_serial_input(). 

To preserve compatibility with upcoming versions of mcuboot I don't want to modify the sourcecode of mcuboot otherwise I am tied to that custom version or have to replicate my changes in every new version of mcuboot. 

I am considering basing the ios app on the device manager sample: 

https://github.com/NordicSemiconductor/IOS-nRF-Connect-Device-Manager 

I would like to clarify if it is possible to use the device manager on the ios app to send the nRF9160 image to the nRF5340 over BLE and having the nRF5340 simply forward the data chunks to the nRF9160, which is in recovery mode at that time. 

Hypothesis: 

I assume that, in order for this to work, the data chunks should be formatted using the SMP protocol with a serial transport layer, then each transport layer frame should be transmitted over BLE to a custom service which will simply forward the data as they are already formatted for serial transport. 

Since i am not too familiar with SMP and MCUmgr I am unsure if this is possible, could you confirm that idea? 

If this is a viable solution, are there any pitfalls to be aware of? How would you advise to proceed on the ios app? 

I am developping with the SDK version V2.7.0 and the Toolchain V2.7.0 

I am looking forward to reading your responses. 

Kind regards 

Colin 

Parents
  • Hi Charlie, 

    Thank you for the answer, interesting stuff! I'll study the Advanced Firmware Update for external MCU article. 

    How I understand it, I have to use the img_mgmt_client API from my Application on the nRF5340.

    First calling img_mgmt_client_init and passing an smp_client_object struct which selects the uart transport layer.

    Assuming my statement above is correct: 

    If I have the image of the nRF9160 stored in flash, can I simply read the image chunkwise from flash passing it to call img_mgmt_client_upload()? Does the size of the data chunks matter or does the img_mgmt_client and the underlying transport layer handle it?

    If my assumption is wrong, could you point me to the right API to use from the nRF5340 application to send chunks of the nRF9160 image to the nRF9160 via SMP using the uart transport layer? 

    Many thanks for the support 

    Cheers 

    Colin 

Reply
  • Hi Charlie, 

    Thank you for the answer, interesting stuff! I'll study the Advanced Firmware Update for external MCU article. 

    How I understand it, I have to use the img_mgmt_client API from my Application on the nRF5340.

    First calling img_mgmt_client_init and passing an smp_client_object struct which selects the uart transport layer.

    Assuming my statement above is correct: 

    If I have the image of the nRF9160 stored in flash, can I simply read the image chunkwise from flash passing it to call img_mgmt_client_upload()? Does the size of the data chunks matter or does the img_mgmt_client and the underlying transport layer handle it?

    If my assumption is wrong, could you point me to the right API to use from the nRF5340 application to send chunks of the nRF9160 image to the nRF9160 via SMP using the uart transport layer? 

    Many thanks for the support 

    Cheers 

    Colin 

Children
No Data
Related