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

    SD cart mount failed

    Core 2
    2
    3
    5.2k
    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.
    • G
      GoT
      last edited by

      I'm facing a weird issue.
      When I use the SD.exists or SD.open on different CPP files, everything works well, but when I click on the reset button, an error occurred.It's also happening when I try to save a file on the SD card twice.

      I have to remove and reinsert the SD card every time which is a little annoying.

      What I'm trying to do is check if there is an SD card available, if yes, I can add a button to save the current game state, or I'm able to load the JSON stored on the SD card.

      [  1788][E][sd_diskio.cpp:199] sdCommand(): Card Failed! cmd: 0x00
      [  1788][E][sd_diskio.cpp:795] sdcard_mount(): f_mount failed: (3) The physical drive cannot work
      [  2095][E][sd_diskio.cpp:199] sdCommand(): Card Failed! cmd: 0x00
      

      Everything I do is public: https://github.com/PierreRambaud/pokegotchi/

      I'm not sure it's the right approach as I started C/C++ one month ago.

      https://github.com/PierreRambaud/pokegotchi/blob/master/src/main.cpp#L85
      https://github.com/PierreRambaud/pokegotchi/blob/master/lib/Pokegotchi/Pokegotchi.cpp#L17

      1 Reply Last reply Reply Quote 0
      • G
        GoT
        last edited by

        Ok, I bypass the problem by using SD.begin() and SD.end() each time I need to use SD methods

        1 Reply Last reply Reply Quote 0
        • M
          Minxster
          last edited by

          Glad you got things working, out of interest, are you running with tasks/threads? I'm working on a project that is reading and writing to an SD card, and luckily I've not had this problem yet. But I may implement what you've found just to be extra safe.

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