SD Card write stability worse since Version 3.0.0

save_jeff
Posts: 2
Joined: Sun Apr 18, 2021 8:40 am

SD Card write stability worse since Version 3.0.0

Postby save_jeff » Sun Apr 18, 2021 8:52 am

Hi,

I'm working on a Bigger Project that writes Loggings to an SD Card using the ESP32 (using both SPI and MMC).
The is developed in Visual Studio Code with PlatformIO and the Arduino Framework.
I can only give Version numbers of the Espressif Framework in PlatformIO.

The code works very stable for more than a year now. but since the introduction of Version 3.1.0 and higher (including 3.2.0) the
SD Card interaction is not reliable anymore.

It took me quite a lot of time to get sure about this. The Problem only appears after multiple hours of writing.
With 3.0.0 I have never problems writing to a file for more than 44h (writing files with sizes above 500MB). With newer versions the file.write(buff, len) function returns 0, the file position freezes and a complete reboot is needed to access the SD Card (also in some casing the SD Card must be reformated)

I believe the Problem is in the Base library to access the SD Card.
I'm always getting the error:
[W][sd_diskio.cpp:181] sdCommand(): token error [13] 0x3
and the file.write(buff, len) returns 0, signaling no bytes where written.


I see this unreliability as a serious matter. not only that I can not rely on the SD Card logging but in general it's quite a core feature of the ESP32 architecture/eco system. As this is quite hard to track down and happens so rarely I'm afraid it will by quite hard to find the Bug. I had the hope it would be fixed with newer versions but I still get the same error with the current 3.2.0 version.

I'm working on an example code that uses simple operations like open and write from a static buffer that crashes after long time with 3.2.0 but not with 3.0.0


I'm personally testing to find this error for a while now and I'm testing it with multiple SD Cards.
I can give further details on the code used if needed.

Greeting,
Jan

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: SD Card write stability worse since Version 3.0.0

Postby ESP_Sprite » Tue Apr 20, 2021 2:41 am

FWIW, all versions you use are pretty old; ESP-IDF 3.[0,1,2] is not supported anymore... suggest you switch to either 3.3 or 4.[1,2,3] and see if the issue still appears there.

save_jeff
Posts: 2
Joined: Sun Apr 18, 2021 8:40 am

Re: SD Card write stability worse since Version 3.0.0

Postby save_jeff » Tue Apr 20, 2021 7:52 am

Hi!

I think there is a misunderstanding. I'm using the PlaftormIO ESP32 Version 3.0.0.
it is based on the ESP32 Arduino Release 1.0.6 based on ESP-IDF v3.3.5.
I think that's the most current Arduino Release of the ESP Firmware.

The Problem described seems to only happen with SPI not with MMC.
I'm still trying to find an example code causing the error I can post. hope Ill have success soon.

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: SD Card write stability worse since Version 3.0.0

Postby ESP_Sprite » Tue Apr 20, 2021 8:50 am

Ah, apologies, I thought you were refering to ESP-IDF versions.

Who is online

Users browsing this forum: No registered users and 54 guests