Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:00 01 Sep 2026 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : SD card warning

Author Message
Volhout

Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 6071
Posted: 07:20am 31 Aug 2026
Copy link to clipboard 
Print this post

A warning about using SD cards continuous.

After 1 weekend running the ChessClient program (playing continuous chess games) the board this morning looked like this (check the horse). The photo is rotated (for some reason on the PC it was correct, before upload).



The Chessclient program uses this code, to read the chess piece tiles from SD card.



In other words, for each piece on the board, each move, each game, it opens a file, reads it, and uses the data. For 1000 games with average 53 moves, and showing 64 pieces (empty fields also) those are roughly 3.4 million file opens, reads, and close.

And the files on SD card are corrupted. I repowered the pico, and still the problem existed. Then I have copied new tile files from the PC to the pico (MMCC) and now the problem is gone. The SD card tile files where actually bad.

So files actually can get corrupt from just reading them too often.

Maybe it is a bad SD card. But this is just a warning for others, who may use similar technique for other applications. Just reading a file, does not guarantee it is never corrupted.

Volhout

P.S. found on V60302b0 on PicoMiteVGA (RP2040) reference design 2, board revision V1.7.
Edited 2026-08-31 17:32 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Bleep

Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 850
Posted: 08:48am 31 Aug 2026
Copy link to clipboard 
Print this post

Hi Harm,
That's very surprising, I was always under the impression that reading there was basically no limit, it was only the writing, that potentially degraded the silicon! (in the 100s of thousands, depending on how good the wear leveling is) it would be interesting to see if it happens again.
Maybe worth looking at a more efficient way of loading the pieces image, maybe only once per move, or cache them & once per game, I realise memory space is a problem, though not so much with the client.
Regards Kevin
Edited 2026-08-31 18:53 by Bleep
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 9098
Posted: 10:14am 31 Aug 2026
Copy link to clipboard 
Print this post

What I'm amazed at is that all the corruption appears to be so localized. It's possible that the previous format operation didn't manage to map out all the bad blocks and you are seeing file corruption because of that.

There's an interesting reply on This Quora page which, IMHO. points to possible charge loss in the cells as being the problem. This is worse on high capacity cards but will happen on all cards eventually.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 2071
Posted: 10:21am 31 Aug 2026
Copy link to clipboard 
Print this post

Maybe the horse just attracted some fleas  

I'll see myself out  
 
Volhout

Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 6071
Posted: 11:56am 31 Aug 2026
Copy link to clipboard 
Print this post

Hi Mick,

It si not very localized. If you look at the photo, you see that the king graphics (harder to see, at edge of the photo) also shows similar artefacts.
Not sure how the memory cells are geographically located inside the flash chip inside the SD card, but the file size is 256 bytes (containing 200 bytes of data). And there are 2 files corrupted (horse and king).

Volhout
Edited 2026-08-31 21:57 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 9098
Posted: 12:14pm 31 Aug 2026
Copy link to clipboard 
Print this post

You can't tell where the data is on flash. Bad blocks are mapped out in a table and clean ones mapped in to replace them, but any block can be anywhere, I believe.
ValiDrive can test the card and show where bad or non-existent blocks are. It's a useful thing to run over a new card to show whether you are getting what you paid for!
Mick

Zilog Inside! nascom.info for Nascom & Gemini
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4376
Posted: 05:47pm 31 Aug 2026
Copy link to clipboard 
Print this post

Will such corruption apply (eventually) to USB memory sticks too?

John
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 2071
Posted: 07:21pm 31 Aug 2026
Copy link to clipboard 
Print this post

It doesn't sound right to me; here we are, debating CRC vs Checksum for serial comms and yet we can get garbage from a SD card?
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026