Send dfu image between two nrf5340

Hi,

What is the best way to send image from one nrf5340 that is central to other nrf5340 that is peripheral in order to update him via 

MCUMGR
thanks
Parents
  • I added the echo command to my code.
    How to implement other commands?

    For example Reset or Upload the image?
    Where is an documentation for this(op,flags,id, payload types)?

    Thanks

  • Hey Simon, 

    Thank you for putting this together. Like @enpre, I was directed to this thread from another thread. 

    What Enpre and I are trying to do is download an image for nrf52840 over an LTE/WIFI chip (nrf9160 in my case) and then send it to the BLE chip over UART. I've been trying to follow this link to formulate a solution that works, but there's very little documentation that explains what's going on there. 

    So my question is - what modifications does your code need to be able to DFU over UART. I use a zephyr ncs code on my nrf9160 and an sdk17 based code on my NRF52840, but I am happy to port to ncs if it makes the OTA solution easier. 

    Also, thank you so much for helping out with this! 

  • Exactly, I have the same task to do as  
    To be honest   it's the first time I approach OTA on zephyr ( or generally linux based devices) and so I have to go deep into some topics, as MCUBoot / Images I haven't used before.

    When I asked support here I believed that OTA was a common task on a IoT device as Nordic's MCU, but I imagined wrong 

    So, what I can do, is to go deep into the main concepts and support you if you are doing something on this, I think that help one to each other in this open source world is a great opportunity to make the world better than now.

  • Okay, so let me try to clarify:

    Hash5422

    If I understand it correctly, you want to perform a DFU update in the following manner: Cloud/server-->LTE-->9160 (NCS)-->UART-->52840 (nRF5 SDK).

    It may be a good idea to port the 52840 to NCS, especially if it's a new design. If you do port to NCS, then you could look at this pull request https://github.com/nrfconnect/sdk-nrf/pull/8839 (a customer updated the solution you've been looking to NCS v2.0.0). I think my (almost complete) solution should work fine as well (if 52840 runs NCS), you just need to modify it to get the binary chunks from the library that receives the binary from the cloud, instead of reading it from flash. If you're not planning to go for my solution, please continue the discussion in this thread: Perform NRF52840 OTA over the NRF9160 and UART, since it's nice to keep the thread clean and on-topic. I have worked some with this, so I could probably re-assign the ticket to me and give more inputs

    enpre

    Is this what you're trying to achieve? Cloud/server-->WiFi-->ESP32 (SDK?)-->UART-->52840 (SDK?)

    What SDK are you using on the ESP32? What SDK are you running on the 52840? If both are running NCS/Zephyr you could use my solution, and continue the discussion in this thread.

    If the esp32 is running some other SDK and the 52840 is running NCS, I think it is easier to just skip the SMP protocol (which the solution in this thread uses) and send the binary image as raw bytes. Check out this ticket for more information, it is the opposite of your solution but should still be relevant since it explains how to send the image as raw bytes and what to do on the 9160 once the update is received (the same should be done on the 52840 if NCS is used). However, if you have more questions regarding this, please continue the discussion in Perform NRF52840 OTA over the NRF9160 and UART. I have worked some with this, so I could probably re-assign the ticket to me and give more inputs

    If the esp32 is running some other SDK and the 52840 is running nRF5SDK, I will not be of much help, since I have not touched the nRF5 SDK in many years. Then you should probably continue the discussion in Perform NRF52840 OTA over the NRF9160 and UART, or if Håkon is not familiar with the nRF5 SDK either just create a new ticket. Remember to specify in the title that the 52840 is running the nRF5 SDK and the ticket will be assigned to an engineer with knowledge about this.

    Best regards,

    Simon

  • Hi,
    Thanks. 
    Did you test it on sdk 1.9.1? 

  • I tested it on NCS v2.0.0.

    Yesterday I was able to receive and parse the image list response, which is required to run in order to get the image hash. I have not implemented it yet, but now it should be straigth forward to test/confirm the image from the app. What is needed to do next is to run the image list command after doing the update, then store the hash of the newly updated image, confirm/test the new update using the stored hash and eventually reset it using the reset command.

    After doing this + cleaning up the sample, the solution is complete

    Feel free to create a pull request on https://github.com/simon-iversen/ncs_samples/tree/master/central_smp_client_dfu 

Reply Children
No Data
Related