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

    SD cart mount failed

    Scheduled Pinned Locked Moved Core 2
    3 Posts 2 Posters 6.4k Views
    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 Offline
      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 Offline
        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 Offline
          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

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post