Replies: 4 comments 2 replies
-
I can confirm that we have problems mounting devices from machine.SDCard() both for slot=1 and slot=2.
The |
Beta Was this translation helpful? Give feedback.
-
It seems that there is not much interest in the (non) working of machine.SDCard() for esp32. I've been trying to find out what is the reason why the machine.SDCard() is now broken. The code for machine_sdcard.c and extmod/vfs_* has been stable for 8 months, except for vfs_blockdev.c, which was changed about 2 months ago. Now, when I replace the vfs_blockdev.c from the current release with the one from v1.22.0-preview.246.g4365edb81 and recompile, the machine.SDCard() seems to work as expected, at least with the following test script:
Now, it seems that the introduction of mp_vfs_blockdev_call_rw() breaks the machine.SDCard(). I am not too knowledgeable to find out where is the real problem is. I hope Angus can find some time to look into this. For now, we can use "sdcard.py" library found at For ESP32-CAM, please try this script:
|
Beta Was this translation helpful? Give feedback.
-
The mp_vfs_blockdev_call_rw() calls from mp_vfs_blockdev_read() and mp_vfs_blockdev_write() return -22. For them to work, they must both return 0. The reason for -22 being returned is due to:
since MP_EINVAL(Invalid argument) is 22, while If I set the return value of mp_vfs_blockdev_call_rw() in "extmod/vfs_blockdev.c" to 0 for both blockdev read and write (as of v1.22.0-preview.246.g4365edb81), everything works as normal for ESP32 (I have not checked for other boards). If you are interested, you can find the actual files at https://github.com/shariltumin/bit-and-pieces/tree/main/SDCard%20Problem |
Beta Was this translation helpful? Give feedback.
-
Thanks for the report and discussion here. This definitely needs to be fixed, and will go in a 1.24.1 patch release. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have upgraded to version 1.23.0 to 1.24.0 encountering the error when mounting SDCard. The sample code in the previous version works without problem, but in the new version of micropython it generates error:
Here's the code I'm using:
This code works perfectly in version 1.23.0
Beta Was this translation helpful? Give feedback.
All reactions