tinygo-org/tinygo

Virtual filesystem support broken on baremetal targets

bgould opened this issue · 7 comments

As best I can tell, virtual filesystem support on baremetal targets was effectively removed by a680bfb

NewFile in src/os/file_other.go always returns a stdioFileHandle now (a680bfb#diff-639e6d3c80d353b492953bcbd0b3eec979e6c88a776684acd1ac961b6217e24eR36) and should be refactored to delegate a mounted virtual filesystem if it exists.

Now that we have all these processors with flash support, I think I am feeling the pain of this issue.

Connected to /dev/ttyACM0. Press Ctrl-C to exit.
SPI Configured. Reading flash info
==> lsblk

-------------------------------------
 Device Information:  
-------------------------------------
 flash data start: 08015800
 flash data end:  08040000
-------------------------------------

==> format
Successfully formatted LittleFS filesystem.

==> ls
Could not open directory /: littlefs: Corrupted

What can I do to help resolve this @bgould ?

@bgould I think I need some help to understand how to fix this, if you please.

LittleFS filesystem is working with onboard flash using the latest dev branches of both TinyGo and TinyFS.

However, FAT filesystem is still broken, which was perhaps not clear from my previous comment.

@bgould I need your help to figure out what to fix, and where. 😿

How is it possible that LittleFS is still working but FatFS not? I am very confused.

@deadprogram @bgould Heads up to both of y'all, I'm writing a FatFS port in pure Go