Page 1 of 1

Read file from an external flash after a reset

Posted: Thu Jan 21, 2021 10:55 am
by campestring
Hello everyone,
I am using the example ext_flash in esp-idf but I Don't know how to do this :
reset my board and read file written before I have reset the board because in my case it reinitialize the flash each time I reset.
I have tryed to separate instructions but Nothing is working for now…
Thank you.
best regards.

Re: Read file from an external flash after a reset

Posted: Thu Jan 21, 2021 11:41 am
by igrr
Hi campestring,

Could you try adding the following call at the end of the example?:

esp_vfs_fat_spiflash_unmount(base_path, s_wl_handle);

This should write all the data to flash and unmount the partition.

Re: Read file from an external flash after a reset

Posted: Thu Jan 21, 2021 12:44 pm
by campestring
Thank you for your quick answer the problem is I will reset my system at any time… So this function will not Always be called. I would like at a reset to re-establish the communication between esp32 and SPI flash without reseting the storage…
Best regards,