DFU over BLE using slots on external flash

Hello Hi Greetings 
This Ticket is regarding documentation and configuration on DFU over BLE using slots on external flash.


We are using 52833soc based custom board that has SPI flash .
We thought that suppose the new firmware upgrade won't have enough memory in soc flash to store , so we thought we can use external flash to store new firmware image and then do the swapping .


I am here to seek direction . 
Please can you tell me a flowchart like how I should approach this task .
like first I think I should study boot loaders and see what's MCUboot and what's nrf's secure boot .

I feel a flowchart / numbered points from a specialist will help more , that raising tickets all the time . So please help me with this , like what should be done first like partitioning or setting up MCUboot .

After that please provide me the link of sample example (if its there ) that does this operation .

Thanks 

S

Parents
  • Hi, 

    like first I think I should study boot loaders and see what's MCUboot and what's nrf's secure boot .

     See the Quick start guide and this Bootloaders and DFU/FOTA course

    Please can you tell me a flowchart like how I should approach this task .

    To update via BLE DFU with SPI external flash on nRF52833, you should make sure the SPI external flash works as expected at first. Here is a sample. You can take a look at the settings: nrf52840dk_nrf52840_spi.conf and nrf52840dk_nrf52840_spi.overlay and adopt them for your nRF52833 custom board. 

    Then, To use the SPI external flash as the second slot, it needs:

    Before you start the work, I highly recommend you take a look at the Bootloaders and DFU/FOTA course to know how the mcuboot and DFU work in the NCS, and use nRF52840DK to familiarize yourself with the flow and setting, then move to your custom board.  

    Regards,
    Amanda H.

  • Hi  

    My question now is when we create separate partition for secondary slot in external flash , do I have to explicitly write new image on secondary slot using write_spi api's or MCUboot bootloader does that for me ?

  • Hi  
    Greetings of the Day 
    I performed the DFU update after implementing SMP server for my test application , I can see the Nordic Application on my mobile connecting to my custom board , and I have DFU option enabled , when I uploaded a signed binary with a customisation -> UPLOAD ONLY , which I infer means that the new firmware will just be written to secondary slot .

    My secondary slot as per all configuration should exist in External Flash as we discussed . Following is my  Partition manager  report 

    Amanda I expect my new firmware to be written by mcuBOOT to this secondary slot in external flash at address 0x71000 right ? ( as per your messages above you said that I won't have to explicitly write new firmware image to the external flash )

    Or at 0x74000 . im not sure about this , but partition in my overlay file starts at 0x71000.



    I tried to read my external flash after I uploaded my new firmware image with customisation in nrf connect app  -> UPLOAD ONLY 


    my logs below 



    After DFU (upload only performed )




    I read at multiple offset mentioned above but I found all data to be 0xFF , 

    Please let me know where I might be lagging . 

    A direction can help me be better engineer , looking forward your expertise here Amanda 
    Thanks 

    S

  • Did you upload a new image with any changes? Without changes, the image would not be uploaded and updated. 

    Are you able to upload a new image via the nRF Device app without issue? If so, Are you able to see it boot up with the new image after updating? 

  • I made a separate blinky code generated the app_update.bin which I used as new image that I wanted to upload , when uploaded with configuration : upload only , I see seek going from 0 to 100 indicating file transfered to my device , but I can't read it .

    but yes test and confirm or test option do give error as below

    also I would like to mention that , one-time only I was able to upload my new firmware image , but I got error as stated in above screen shot , but after that subsequently when I try to perform the operation of uploading 





    this error is persistent after ONE-TIME WORK . 



     Please make this ticket private if possible and please let know where I might be lacking 

    regards

  • Hi  

    Sorry for plethora of responses .

    But we carried out some activities pertaining to above topic.

    1)
    Since morning today DFU was not executing ( Error : No entry ) was observed in nrf Device app .
    But We did observe at once or twice the transfer of new firmware take place out of 30 odd tries .

    CONCLUSION

    It was observed that when an old / some other firmware of irrelevance was flashed to our custom board and then again our current FOTA sample code was flashed , the DFU TRANSFER TOOK PLACE 

    Please explain why this happens , I feel it's about HASH key issue . 


    2)
    Now since we understood how to make our DFU process work .
    We printed in the code "old firmware " and flashed it to the device which would act as central device .

    then we generated a binary as steps listed in nordic technical documentation , an app_update.bin which had "NEW FIRMWARE, Congratulations !!" getting printed on it .

    It was observed , when I read my external flash from 0x0 address that only 30 odd "bytes" were written , when my app_update.bin was of 147KB . 

    please see screenshot below 




    which is not I thought would be case , I expected whole new firmware written here and then swap taking place . but to my dismay this never happened till now , 

    A senior from my workplace coined a term "Differential DFU " , but I never applied for this technology .

    I wished for basic DFU on secondary slot on external flash .






    this is my sample code 
    sample code

    Please let me know where I lag . 

    Regards 

  • Are you usinthe nRF Connect Device Manager app?

    Do you build the old and new applications with the same pm_static.yaml?

    I would suggest you update the same application with slight modifications as "printk("build time: " __DATE__ " " __TIME__ "\n");" for testing. 

Reply Children
Related