SD cart mount failed
-
I'm facing a weird issue.
When I use theSD.existsorSD.openon 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: 0x00Everything 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 -
Ok, I bypass the problem by using
SD.begin()andSD.end()each time I need to use SD methods -
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.
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