tinyfs icon indicating copy to clipboard operation
tinyfs copied to clipboard

not able to run simple-fatfs

Open mytechnotalent opened this issue 2 years ago • 4 comments
trafficstars

Unable to build simple-fatfs example here.

panic: runtime error: type assert failed

What is the minimal example to simply: 1)write "hello world" to a Pico's flash using TinyGo 2)read the string from flash and print to the terminal

This is essential for any persistence if we are to use TinyGo.

mytechnotalent avatar Feb 10 '23 19:02 mytechnotalent

RP2040 is generally not working yet in TinyGo itself, pending https://github.com/tinygo-org/tinygo/pull/3378 which in turn will depend on https://github.com/tinygo-org/tinygo/pull/3382

Once XIP/QSPI flash is working then the TinyFS examples can probably be made to work on pico.

A word of caution though ... using writable fatfs on a flash chip is not advisable, littlefs would be much better for the longevity of the device.

bgould avatar Feb 11 '23 02:02 bgould

@bgould thank you for your response. Yes I would prefer TinyFS as I see that those examples are not working so I went here. I would prefer that route and thank you for the aforementioned branches.

Without file persistence and a filesystem of some sort on the Pico it is really limited in its functionality. In the meantime do you know of a way to:

1)write "hello world" to a Pico's flash using TinyGo
2)read the string from flash and print to the terminal

In addition, do we know how far away we are to getting TinyFS on the Pico? I read the PR's but was unsure we are close to a working solution.

mytechnotalent avatar Feb 11 '23 12:02 mytechnotalent

See https://github.com/tinygo-org/tinygo/pull/3536 for progress on rp2040.

deadprogram avatar Mar 11 '23 20:03 deadprogram

An update: using the dev branch of TinyGo itself from the upcoming 0.28, and LIttleFS filesystem in this repo on dev branch, is working on RP2040 flash.

The fatFS is still not able to run. However LittleFS at least fulfills the minimum requirements for file persistence.

deadprogram avatar May 18 '23 14:05 deadprogram