🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    SDCard does not work on M5Stack FIRE.

    UIFlow
    4
    14
    20.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      fraramon
      last edited by

      Hi, SD card not working on M5Stack FIRE.
      Do you know what may be happening?

      G 1 Reply Last reply Reply Quote 0
      • G
        Gaviota @fraramon
        last edited by

        @fraramon
        Check the format of the SD-Card, ist must be FAT32

        A lot of nice M5Stack stuff :) ....

        F 4 Replies Last reply Reply Quote 0
        • F
          fraramon
          last edited by fraramon

          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

          1 Reply Last reply Reply Quote 0
          • F
            fraramon @Gaviota
            last edited by fraramon

            @gaviota I am thinking that it is a problem with the firmware version v1.7.1 of the M5Stack FIRE.

            1 Reply Last reply Reply Quote 0
            • F
              fraramon @Gaviota
              last edited by

              @gaviota I have tried the following and it gives me error:

              from m5stack import *
              from m5ui import *
              from uiflow import *
              import os
              sd_mount()

              1 Reply Last reply Reply Quote 0
              • F
                fraramon @Gaviota
                last edited by

                @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()

                1 Reply Last reply Reply Quote 0
                • F
                  fraramon @Gaviota
                  last edited by

                  @gaviota I have tried the following and it gives me error:

                  import os
                  os.mountsd()
                  os.listdir('/sd')

                  G 1 Reply Last reply Reply Quote 0
                  • G
                    Gaviota @fraramon
                    last edited by

                    @fraramon
                    Try use the sd with the UIFlow IDE

                    A lot of nice M5Stack stuff :) ....

                    1 Reply Last reply Reply Quote 0
                    • felmueF
                      felmue
                      last edited by felmue

                      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

                      GPIO translation table M5Stack / M5Core2
                      Information about various M5Stack products.
                      Code examples

                      1 Reply Last reply Reply Quote 0
                      • F
                        fraramon
                        last edited by

                        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.

                        1 Reply Last reply Reply Quote 0
                        • felmueF
                          felmue
                          last edited by

                          Hello @fraramon

                          sorry to hear. I am afraid I am out of ideas at this point. Sorry.

                          Thanks
                          Felix

                          GPIO translation table M5Stack / M5Core2
                          Information about various M5Stack products.
                          Code examples

                          R 1 Reply Last reply Reply Quote 0
                          • F
                            fraramon
                            last edited by fraramon

                            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.

                            1 Reply Last reply Reply Quote 1
                            • R
                              romor001 @felmue
                              last edited by

                              @felmue I have the same problem with two m5stack Fire devices.
                              Any chance you maybe solved this issue later?

                              1 Reply Last reply Reply Quote 0
                              • felmueF
                                felmue
                                last edited by felmue

                                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:

                                0_1644921580848_UiFlowM5FireSDCard220415.png

                                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

                                GPIO translation table M5Stack / M5Core2
                                Information about various M5Stack products.
                                Code examples

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post