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
  • 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 

  • The solution is complete now

    https://github.com/simon-iversen/ncs_samples/blob/master/central_smp_client_dfu/README.md

    If you follow the instructions in the README, you will be able to perform a DFU from one nRF52840DK to another nRF52840DK over Bluetooth using NCS v2.0.0.

    Let me know if you're not able to get it to work with nRF5340DK's

    Best regards,

    Simon

  • Hi Simon, I'm in trouble with a new task this week so I'll try it maybe next week.
    Meantime very big thanks about it, I think it'll be a great start point to implement an OTA update as meand  needs to do.

  • Hey Simon! Thanks for all your help. I was taking time to do some reading since I am not super familiar with smp and mcuboot as well. I am moving my 52840 code to NCS so both nrf9160 and nrf52840 are running NCS based code now. 

    So for the two solutions you proposed, I have follow up questions for you - 
    1. Using the ncs2.0.0 version of the solution I was trying: 

    - 
    I can copy the changes to the 14 files that this solution touches in ncs2.0.0. But from what I understand, this is a library implementation of DFU over UART. Seems like it is doing exactly what I am trying to achieve, but I am not sure how to effectively use it in an example or my own code. Is there an example that can help me test these changes or understand how I can use them in my project once I download the image from the server over LTE. 
    - NCS2.0.0 only supports VSCODE and I use SES as my compiler, can I use the same changes on ncs1.9.1 which continues to support ses ide. 

    2. Using the solution you provided in this thread: 

    - You mentioned that I could use this as well, if I manage to receive binary chunks from the cloud instead of reading it from the flash. However, your solution does the image transfer over BLE if I understand correctly. So I would have to find a way to send it over UART as well, correct? 

    - Could you provide a changelist of changed files so I can make sense of what you're doing in your implementation. 


    I apologize if I'm missing something obvious here, I am fairly new to this.

    I've broken down my task into these steps: 

    1. Generating the nrf52840 image with the right OTA header
    2. Uploading the image to our servers 
    3. Downloading the image over LTE on the nrf9160
    4. Dividing the image into header + fixed size chunks 
    5. Sending the data over UART
    6. Storing the image into FLASH Secondary storage 
    7. Copying the data over to the Primary Storage 
    8. Reboot and take new image 

    Correct me if I am wrong, my understanding is step 5 is implemented here and I could use your code for steps 6,7, 8.




    Could you assign the other thread to yourself so we can continue the discussion there? 

  •   

    Again, if you're not running NCS/Zephyr on the ESP32 I don't think using my solution will be the best option. Please see my earlier answer continue the discussion in Perform NRF52840 OTA over the NRF9160 and UART.

    Actually in this ticket the thread starter is using NCS on both ends of the transfer, and if you don't do it, I think the solution will be a little different. Please create a new case, and inform what SDK you're using on both the ESP32 and the nRF52840, and link to it here, and I will assign it to myself and continue to help you out there.

    Best regards,

    Simon

Related