Does a new flash always overwrite the filesystem?
-
- Posts: 39
- Joined: Fri Mar 29, 2019 7:08 pm
Does a new flash always overwrite the filesystem?
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?
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.
- 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.
-
- Posts: 39
- Joined: Fri Mar 29, 2019 7:08 pm
Re: Does a new flash always overwrite the filesystem?
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.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Does a new flash always overwrite the filesystem?
That is not normal behaviour on an ESP32. I have never lost files unless I deliberately erase flash.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.