-
Notifications
You must be signed in to change notification settings - Fork 7.6k
SD.h - Application is not notified that file::flush() failed #6303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you please take a look on this issue, @P-R-O-C-H-Y ? |
@ChristopheLaurent does this snippet from bool sdSelectCard(uint8_t pdrv)
{
ardu_sdcard_t * card = s_cards[pdrv];
digitalWrite(card->ssPin, LOW);
bool s = sdWait(pdrv, 300);
static unsigned int failcount = 0;
if (!s) {
if (failcount == 0){
log_e("Select Failed on first attempt!!!");
//digitalWrite(card->ssPin, HIGH);
//return false;
} else {
log_e("Select Failed");
digitalWrite(card->ssPin, HIGH);
return false;
}
failcount ++;
}
return true;
} |
Hi @ChristopheLaurent, can you please provide more informations, that were typed in issue template? |
Hi @P-R-O-C-H-Y , I was still using V1.0.6 according to file |
Hi @tobozo, I guess it would help but I would prefer your |
I don't know about issues with SD card on 1.0.6 version. But this version is no longer supported. |
Tanks a lot for your wise support @P-R-O-C-H-Y . I just managed to build using 2.0.2 on PlatformIO and even run to some extent, but my application get stuck using GxEPD, the graphic driver for e-paper screen. So I'm going back to 1.0.6 for the time being, and I will wait a couple of months until everything is stabilized, then try again. Best Regards. |
Related area
SD card
Hardware specification
LilyGo ESP32 board with SD slot
Is your feature request related to a problem?
My application can write data in a file on this SD card without any problem using
my_file.printf()
.If I remove the SD card while writing, there is no error. I noticed that the size returned by
my_file.printf()
> 0 even if nothing was wrote on the SD card since the card was physically removed. The error occurs later when my application callsmy_file.flush()
. I can then see on serial monitor:[E][sd_diskio.cpp:123] sdSelectCard(): Select Failed
I wish my application to react on this error instead of going on silently.
I did not find any public API in
SD.h
to inform my application thatmy_file.flush()
raised an error.Describe the solution you'd like
I'd like SD class to keep track of such a failure in a
SD.h
public property.Describe alternatives you've considered
No response
Additional context
I've seen issue SD card status check bug #6081, but I don't think this is related to my issue.
I have checked existing list of Feature requests and the Contribution Guide
The text was updated successfully, but these errors were encountered: