FAT filesystem appears to be corrupted

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
xevib
Posts: 2
Joined: Sun Jul 10, 2016 10:34 am

FAT filesystem appears to be corrupted

Post by xevib » Sun Jul 10, 2016 10:43 am

Hi I'm using a Sparkfun ESP8266 "The Thing"(https://www.sparkfun.com/products/13231) and a FTDI (https://www.sparkfun.com/products/9873) to flash it.
Actually I'm getting a "FAT filesystem appears to be corrupted" message on the serial console. I readed that sometimes happens when is reflashed so I tried to erase_flash an reflash it but I have the same result.
My doubt is if my board is broken or if the Sparkfun ESP8266 it's not compatible with micropython?

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: FAT filesystem appears to be corrupted

Post by Roberthh » Sun Jul 10, 2016 7:32 pm

According to the linked schematics, the device is equipped with 4 MBit = 512 kByte flash memory. That is too small to hold both the micropython firmware and a file system. The reference system for esp8266 micropython, the huzzah feather, has 32 MBi = 4 MByte flash, but 8MBit = 1 MByte should also be sufficient. See this link http://forum.micropython.org/viewtopic. ... 512k#p9414

markxr
Posts: 62
Joined: Wed Jun 01, 2016 3:41 pm

Re: FAT filesystem appears to be corrupted

Post by markxr » Sun Jul 10, 2016 8:22 pm

There should be some code to detect the flash size, which should not try to put a filesystem on the device if there isn't enough space.

I'm pretty sure I've seen this code, browsing the source. If it's creating this error, than that presumably means it's not working, and you should raise a bug.

I don't have an ESP8266 with less than 4M flash to test it on.

xevib
Posts: 2
Joined: Sun Jul 10, 2016 10:34 am

Re: FAT filesystem appears to be corrupted

Post by xevib » Mon Jul 11, 2016 6:31 am

Thank you for the answer, now it clear why it don't work.
markxr if you want I can try it for you if you upload the code somewhere

jms
Posts: 108
Joined: Thu May 05, 2016 8:29 pm
Contact:

Re: FAT filesystem appears to be corrupted

Post by jms » Mon Jul 11, 2016 2:53 pm

I thought the filesystem was flash-friendly one. If it isn't I'm seriously concerned and not surprised if it wears the flash and breaks itself. Of course once it does this you're going to have trouble loading a slightly newer and larger micropython as it would overlap the damaged (file allocation table, probably) area.

Regarding flash size it doesn't help that some people, and I definitely don't mean Robert are really sloppy and generally unclear with units. Bits ? Bytes ?

markxr
Posts: 62
Joined: Wed Jun 01, 2016 3:41 pm

Re: FAT filesystem appears to be corrupted

Post by markxr » Mon Jul 11, 2016 10:46 pm

The fs on Micropython on the esp8266 is a FAT filesystem, it's not flash-friendly, in particular, it often overwrites the blocks which contain the directory entries and FATs, which is very bad for flash.

Having said that, provide you don't abuse it too much, it should be ok.

I have bricked (so far) only 1 esp8266 by wearing its flash.

But that was cause by the wifi connect() function, which (unknown to me at the time) rewrites a flash block; this is a function inside the firmware blob and not part of micropython.

jms
Posts: 108
Joined: Thu May 05, 2016 8:29 pm
Contact:

Re: FAT filesystem appears to be corrupted

Post by jms » Tue Jul 12, 2016 4:39 am

Is anybody working on dropping in a replacement ?

SPIFFS for example ?

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: FAT filesystem appears to be corrupted

Post by deshipu » Tue Jul 12, 2016 10:09 am

As far as I know no, you can start on it :-)

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: FAT filesystem appears to be corrupted

Post by pythoncoder » Tue Jul 12, 2016 11:53 am

Is this feasible? Do the binary blobs make use of the filesystem, or is it a specific MicroPython feature?
Peter Hinch
Index to my micropython libraries.

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: FAT filesystem appears to be corrupted

Post by deshipu » Tue Jul 12, 2016 2:05 pm

This is specific to Micropython. Basically you can use any filesystem you want, you just have to implement it.

Post Reply