Read file from an external flash after a reset

campestring
Posts: 17
Joined: Mon Dec 21, 2020 10:29 am

Read file from an external flash after a reset

Postby campestring » Thu Jan 21, 2021 10:55 am

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.

igrr
Espressif staff
Espressif staff
Posts: 2076
Joined: Tue Dec 01, 2015 8:37 am

Re: Read file from an external flash after a reset

Postby igrr » Thu Jan 21, 2021 11:41 am

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.

campestring
Posts: 17
Joined: Mon Dec 21, 2020 10:29 am

Re: Read file from an external flash after a reset

Postby campestring » Thu Jan 21, 2021 12:44 pm

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,

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot], Semrush [Bot] and 4 guests