SDCard does not work on M5Stack FIRE.
-
@fraramon
Check the format of the SD-Card, ist must be FAT32 -
Hello, thanks for your comment, I have it formatted with FAT32.
I think the problem is that the / sd drive is not mounted.
I am testing with the following code:from m5stack import *
from m5ui import *
from uiflow import *setScreenColor(0x222222)
with open('/sd/test.txt', 'w+') as fs:
fs.write('Hello World')And it gives me the following error: OSError: [Errno 19] ENODEV
-
@gaviota I am thinking that it is a problem with the firmware version v1.7.1 of the M5Stack FIRE.
-
@gaviota I have tried the following and it gives me error:
from m5stack import *
from m5ui import *
from uiflow import *
import os
sd_mount() -
@gaviota I have tried the following and it gives me error:
import uos
uos.sdconfig(uos.SDMODE_SPI,clk=18,mosi=23,miso=19,cs =4)
uos.mountsd() -
@gaviota I have tried the following and it gives me error:
import os
os.mountsd()
os.listdir('/sd') -
@fraramon
Try use the sd with the UIFlow IDE -
Hello @fraramon
the following micropython code works for me with a 16GB SD card and running UIFlow firmware 1.7.1.
from m5stack import * from m5ui import * from uiflow import * setScreenColor(0x222222) label0 = M5TextBox(34, 41, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0) with open('/sd/test123.txt', 'w+') as fs: fs.write('Hello World') with open('/sd/test123.txt', 'r') as fs: label0.setText(str(fs.read()))
BTW: Please make sure your SD card, when inserted, is completely in and flush with the case and doesn't stick out. I am mentioning that because I also have an M5Stack Gray which has a broken SD card slot in the sense that the SD card, when inserted, still sticks out a little bit and that makes the SD card fail as the pins do not make proper contact. Maybe your M5Stack Fire has a similar issue.
Thanks
Felix -
Hello, thank you very much for your answers, I have tried from UIFlow and it has not worked for me, and then I have tried with the code that @felmue has sent me and it does not work either, it returns the error code "OSError: [Errno 19] ENODEV" .
I am beginning to think that it is a problem with Firmware 1.7.1 for M5Stack FIRE or Hardware of M5Stack FIRE.
I have tested the card on other devices and it works without problems. It is formatted with FAT32 and has 16GB. -
-
Thanks for your support @felmue, today I received my new M5Stack CORE2 and the SD card was immediately, so the card is not the problem, the problem is the fire M5Stack FIRE that has a problem. I have verified the great quality that CORE2 has, the truth is that it is very very good. I'm going to do more tests to see how it works.
-
@felmue I have the same problem with two m5stack Fire devices.
Any chance you maybe solved this issue later? -
Hello @romor001
I've just retested it on my M5Stack Fire running UiFlow v1.9.1-fire firmware and I can list the content of the SD card just fine.
Blockly code:Micropython code:
from m5stack import * from m5ui import * from uiflow import * import os setScreenColor(0x222222) print(os.listdir('/sd/'))
Make sure the SD card is inserted before you power the M5Stack Fire as it is mounted while booting up (mounting code is in boot.py). In the log you'll see this:
SD card mounted at "/sd"
Thanks
Felix