Regarding Simultaneous DFU for app core, net core and wifi patch

Hello,

I am working on a custom board with my own custom project. I want to perform DFU for all the images I mentioned. 
The mechanism for the OTA update will be as follows:
1. The OTA binary will be downloaded over the WIFI and stored to the SDCard
2. The OTA binary(from the SDCard) will be written to the respective memory in the flash and verified through my application core(if possible) or any other mechanism which is possible in the device runtime
3. The image will be verified and confirmed to be booted on the next reboot

I need help for the 2nd and 3rd step in the context of APIs and configuration options(already referred to Dev academy and nordic documentation but still in case I miss any).

Important details:
1. The nrf7002ek(for the wifi patch) is on the SPI interface.
2. The toolchain used is ncs v3.0.2(sysbuild and partition manager enabled)

Thanks in advance!  

Parents Reply Children
  • All of this is done.
    The only missing point is how to write it from the sdcard to the external flash.
    I have my FAT FS initialised.
    I am able to read contents of my file but the only thing I don't know is how to write it into the external flash.
    Since external flash is a partition instead of a file, my only question is: 
    What is the interface/API(s) to write the contents of the firmware binary file into the external flash in those regions defined in the pm_static for all the three partitions.

  • I think I am not able to make explain you what I want. Can you please float this ticket to someone else? 

  • No can do, sir. You're stuck with me. Please review the resources, as you should have everything you need from there. 

    AHaug said:
    Doesn't this work?

    This is the API you need to write contents to a specific memory address. You need to separate the contents of the .bin you download and initially write to the SD card. TBH I can't see the reason for why you have the SD card as a temporary storage when you already have an external flash and you can download the candidate images directly to the external flash in the first place.

    Kind regards,
    Andreas

  • Because the application will download the firmware from a specific secure API and then when the file is succesfully downloaded, we will go for writing the contents into the external flash.
    Writing the downloaded chunk directly into the external flash does not seem to be a good idea for now but I will still consider it and try.

    Still the part "how to write the content into the external flash" is not clarified. What you have given me in the last response is a write function of FAT FS library: fs_write which takes an initialised file descriptor(through fs_open) as an input and the FAT FS takes care of handling the address stuff.

    What you are essentially saying is I should mount the external flash with the FAT FS library, then open a file in external flash for which I don't know how I am assigning a path, then write the content into it knowing that I am not giving any input for a specific address in this whole process.

    Is this even possible and the correct way to do this?

    Please correct me bluntly if I am wrong.

Related