-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Description
Hardware:
Board: Adafruit HUZZAH32 Feather + SD/RTC Shield
Core Installation/update date: 05/Nov/2018
IDE name: Platform.io
Computer OS: Windows 10 and Ubuntu
Description:
There are problems mounting micro SD cards after rebooting.
The first time after inserting a micro SD card (e.g. Sundisk Ultra) and rebooting the chip, everything works fine. Leaving the card in the holder and rebooting again i get in ~50% of all attempts the error:
[E][sd_diskio.cpp:739] sdcard_mount(): f_mount failed 0x(3)
After reinserting the card (or removing power supply of the sd card holder) everything works fine again, but only for the first reboot.
I found some kind of 'workaround'. If you call SD.begin(CS) in a loop until it returns true, u will be able to mount the card, sometimes after 2-3 attempts, sometimes after 10.
I have tried with at least 3 different chips, multiple different SD card holder (some feather shields, an other micro SD holder, and an SD holder) and multiple different SD cards. -> same result for all of them.
Sketch:
#include <Arduino.h>
#include <SD.h>
void setup(){
Serial.begin(115200);
delay(200);
while(! SD.begin(33)){
}
Serial.println("SD OK");
}
void loop(){
File file = SD.open("/testfile.txt", FILE_APPEND);
file.println("printAnythingHerer");
file.close();
}
Debug Messages:
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:952
load:0x40078000,len:6084
load:0x40080000,len:7944
entry 0x40080310
[E][sd_diskio.cpp:739] sdcard_mount(): f_mount failed 0x(3)
[E][sd_diskio.cpp:739] sdcard_mount(): f_mount failed 0x(3)
[E][sd_diskio.cpp:739] sdcard_mount(): f_mount failed 0x(3)
[E][sd_diskio.cpp:739] sdcard_mount(): f_mount failed 0x(3)
[E][sd_diskio.cpp:739] sdcard_mount(): f_mount failed 0x(3)
[E][sd_diskio.cpp:739] sdcard_mount(): f_mount failed 0x(3)
[E][sd_diskio.cpp:739] sdcard_mount(): f_mount failed 0x(3)
[E][sd_diskio.cpp:739] sdcard_mount(): f_mount failed 0x(3)
[E][sd_diskio.cpp:739] sdcard_mount(): f_mount failed 0x(3)
SD OK