New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sdcard: add support for fatfs #265
Conversation
The default stack size may not be enough for your current code.
|
db0e8b9
to
cf463b7
Compare
In this PR, the following files have been modified.
|
Here is what results I got:
|
@deadprogram If it's already FAT32, it needs to be analyzed a bit more.
|
I've tried FAT32-format on windows 10 and ubuntu 20.04, and both are readable in my environment (pyportal) . |
Here is the SD card info:
|
@deadprogram
When I ran it, I got the following message.
|
Does the xxd command work?
|
I don't think sdcard has any problem. |
This is without your most recently suggested changes:
Did not fail, but the results look incorrect. |
@deadprogram https://drive.google.com/file/d/1YlI3q0JMf_uHPIzy3_zmZTZ9oa7GSQcp/view?usp=sharing When I ran it, I got the following log.
|
Here is my output:
|
You got an error in the first place. https://drive.google.com/file/d/1tSXLwVgRhiF1ge5tnsgRDb79u0PRWYsD/view?usp=sharing
|
Here is the output from the new version:
|
@deadprogram
Then, please run the following in pyportal.
|
Here is the result from running
Here are the results of both command using "try_03" on the Pyportal:
I will pull out my Wio Terminal in a little while to try with that device. |
Here are the results from trying the Wio Terminal:
|
Looking at the results of PyPortal and Wio Terminal, I do not think that the disk is read properly. Try the following command from linux.
|
Here is the output:
|
@deadprogram
https://github.com/tinygo-org/drivers/blob/dev/examples/sdcard/console/pyportal.go#L15
|
At 6Mhz, the following:
|
@deadprogram https://drive.google.com/file/d/1KtLNU39qjV4I9ZO4JTXvGnreh36De4M0/view?usp=sharing Please tell me the following results.
|
Here is the output from the latest test version:
|
Thank you for trying so many times! I created a uf2 that reads the sdcard of PyPortal from Arduino. https://drive.google.com/file/d/1dLiu4y0PjtemtdpjJksX1f8uXDplj06h/view?usp=sharing
|
OK, that worked:
|
@deadprogram arduino's init
tinygo's init:
|
If the above try06 doesn't work, please try this one as well. https://drive.google.com/file/d/1Z-1KHrAIXsDqAolD36ujzHxEi1rzhjAq/view?usp=sharing |
Output from the first program:
Output from the second:
|
@deadprogram
Try the following.
|
Here is the output from the last version:
|
The error has changed a bit.
|
|
@deadprogram
|
It worked!!! Output here: https://gist.github.com/deadprogram/71f8ae4a06f962bbbcd8eee04e2c4834 |
@deadprogram I have tried it in the following environment.
Note that the stack-size needs to be adjusted at this time. |
I have confirmed that it also works with |
Is there any reason to not want to set |
Confirm that is still working on my PyPortal with latest code in this branch, and the stack size change. 🎊 |
I don't have a clear reason. |
Can we change it to a lower number? Perhaps we should change the default only for all of the boards that we already know have built-in SD card readers. |
I tried it with
Here is the board that comes with the sdcard.
Here is the build log for maixbit
|
That all sounds great... except about the Maixbit of course. Maixbit is something we should take on in a separate task from all the other boards you mentioned. This is very exciting! |
@deadprogram |
|
@sago35 I think you have done some incredible work here. Any further enhancements/changes would probably be more easily handled in additional PRs later. I suggest you squash so we can merge this, and then we can continue from there as far as documentation etc. Only other thing still to handle is a PR to the main repo with the stack size changes we have been discussing, so that it can "just work" for anyone who has one of those boards. |
@deadprogram |
Now merging! |
Added filesystem support.
The commit will be cleaned up later.
I'm checking with windows 10 + feather-m4-can + 8GB sdcard w/fat32.
It is readonly at this time.
To make it writable, you need to change the settings on
tinygo-org/tinyfs
.