format the file system

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

format the file system

Post by devnull » Sat Mar 04, 2017 6:48 am

I assumed that esptool erase_flash would erase my user files but it does not, and it appears that my file system is corrupted as when I list the root folder, there are dozens of lines with just a dot "." and no file name.

Is there a way to erase or re-format the file system ??

When I list using ampy I get:

Code: Select all

.
.
.
main.py
.
.
.
with os.listdir() I get :

Code: Select all

'\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00', '\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00', '\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00', '\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00',

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: format the file system

Post by devnull » Sat Mar 04, 2017 7:09 am

OK, answering my own post here:

Code: Select all

import os
import flashbdev
os.VfsFat.mkfs(flashbdev.bdev)

chh55
Posts: 2
Joined: Wed Sep 05, 2018 12:23 pm

Re: format the file system

Post by chh55 » Wed Sep 05, 2018 12:32 pm

Hi.
It seems that I have the same problem.
Tried:
import os
import flashbdev
os.VfsFat.mkfs(flashbdev.bdev)

But I still see garbage when listing
import os
os.listdir()
x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00',
'\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00', etc...

Also I don't see any boot.py after flashing with esp8266-20180511-v1.9.4.bin
Chip is ESP8266EX (ESP12F)

Hooe someone can help.

Thanks in advance
Claus

Post Reply