Page 1 of 1
Does a new flash always overwrite the filesystem?
Posted: Fri May 06, 2022 12:44 pm
by cyrano1960
Hello there, I have a simple question, but I can“t find an answer. I wonder if there is a way to flash a board with a new firmware without overwriting the existing filesystem. Thank a lot an best regards, Werner
Re: Does a new flash always overwrite the filesystem?
Posted: Fri May 06, 2022 1:42 pm
by Roberthh
That depends. MicroPython attempts to keep an existing file system. On most ports and devices, that succeeds. The file system will however be re-created, if the initial mount fails. Possible reasons:
- The file system was by chance corrupted. That may happen for instance, when the board is mounted to a PC in MSC mode, and both board and PC wrote to the file system. Or the partitioning of the flash was changed with a new firmware.
- There are some boards/port combination, where a built-in bootloader erase the flash. That happens for instance with the Teensy boards.
Re: Does a new flash always overwrite the filesystem?
Posted: Fri May 06, 2022 3:47 pm
by cyrano1960
Hi Robert, thanks for your fast response. That explains a lot. I have flashed my Pi Picos several times and there was no change in my filesystem, but then I have done the same on an ESP32 and all my files are gone.
Re: Does a new flash always overwrite the filesystem?
Posted: Sat May 07, 2022 9:15 am
by pythoncoder
That is not normal behaviour on an ESP32. I have never lost files unless I deliberately erase flash.