How to format file system?
How to format file system?
How to format esp32 or esp8266 file system for repair and remove all Files? (damaged files)
-
- Posts: 969
- Joined: Sat Feb 03, 2018 7:02 pm
Re: How to format file system?
esptool.py --port /dev/ttyS3 erase_flash
Adapt your port of course.
You have to flash the firmware again afterwards.
Adapt your port of course.
You have to flash the firmware again afterwards.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Re: How to format file system?
Thank you.kevinkk525 wrote: ↑Sun Sep 08, 2019 8:37 amesptool.py --port /dev/ttyS3 erase_flash
Adapt your port of course.
You have to flash the firmware again afterwards.
in this way you use a computer.
but i want do by ESP32 itself.
is it possible?
To do this by the ESP32 itself?
-
- Posts: 969
- Joined: Sat Feb 03, 2018 7:02 pm
Re: How to format file system?
i don't think that is possible. The esp can't erase itself.
Not sure it can erase the fat filesystem where you store your files but haven't heard of that either.
Not sure it can erase the fat filesystem where you store your files but haven't heard of that either.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Re: How to format file system?
You can format the file system from by python commands once the ESP32 is started, with:
bdev is instantiated by the boot script and refers to the block storage device in the flash. Note that this erases ALL files on the flash, including potentially the script that erase the file system. This script will continue to run, since at that time it is loaded to RAM. But this script must rebuild the files needed for the next reboot.
Code: Select all
import uos
uos.VfsFat.mkfs(bdev)
Re: How to format file system?
Thank you
Good. it worked.
Good. it worked.