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

    <SOLVED> M5Stack basic vs gray and SD card

    Arduino
    2
    6
    6.8k
    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.
    • C
      cepics
      last edited by cepics

      hi all
      I'm trying to use M5Stack-SD-Updater on M5stack basic (V2.61), but after flashing the M5Stack doesn't see the sd card....
      same process on M5Stack gray (v 2.4) works...

      same behavior if I use M5Burner to burn lovyan launcher on the two controllers... with the same sd card, M5gray can access to sd and M5basic don't

      I tried four different M5Stack basic unit ... same behavior!!

      ideas?
      tnks a lot!!!

      1 Reply Last reply Reply Quote 0
      • B
        basgoossen
        last edited by

        I also had some issues with the M5Stack basic and SD cards. I was unable to read 9 out of 10 cards. In the end i ended up slowing down the SD card clock from 40Mhz to 10Mhz, this solved all the read issues for me. You can achieve this by editing the M5Stack.cpp file, in the function M5Stack begin SD is enabled using the following function:

        // TF Card
        if (SDEnable == true) {
            SD.begin(TFCARD_CS_PIN, SPI, 40000000);
        }
        

        I changed this to:

        // TF Card
        if (SDEnable == true) {
            SD.begin(TFCARD_CS_PIN, SPI, 10000000);
        }
        

        Since than i have had no more troubles reading from and writing to the SD card.

        1 Reply Last reply Reply Quote 1
        • C
          cepics
          last edited by

          tnks a lot to answer!!!

          but I can't find where the M5Stack.cpp file is invoked....

          mumble mumble...

          1 Reply Last reply Reply Quote 0
          • C
            cepics
            last edited by

            I trierd to modify the sd.begin() function in the used SD.h with the new frequency .... but no joy!!

            still searching......

            any ideas??

            1 Reply Last reply Reply Quote 0
            • C
              cepics
              last edited by

              in SD.h I changed:

                  bool begin(uint8_t ssPin=SS, SPIClass &spi=SPI, uint32_t frequency=4000000, const char * mountpoint="/sd", uint8_t max_files=5, bool format_if_empty=false);
              

              to

                  bool begin(uint8_t ssPin=SS, SPIClass &spi=SPI, uint32_t frequency=1000000, const char * mountpoint="/sd", uint8_t max_files=5, bool format_if_empty=false);
              

              and in sd_diskio.cpp:

                  if (card->frequency > 25000000) {
                      card->frequency = 25000000;
                  }
              

              to

                  if (card->frequency > 10000000) {
                      card->frequency = 10000000;
                  }
              

              .... and now seems to work!!

              1 Reply Last reply Reply Quote 0
              • B
                basgoossen
                last edited by

                Glad to hear it worked for you too!

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