cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to read sectors from sd card on STM32U575ZI

kk9
Associate

Hello I'm trying read sector numer 0 from SD card. I use 4-bit mode for sd card reading. My MCU is on Nucleo development board. Card is correctly initialized but when I'm trying read sector I get zeros in buffer and maybe 10 random not-zero bytes. What do I incorrect?
After restart I get the same values when I use the same sd-card. But when I use other card - I get other incorrect data.

kk9_0-1769895357448.pngkk9_1-1769895396173.png

kk9_2-1769895422404.png

kk9_3-1769895546345.png

 

 

1 REPLY 1
TDK
Super User

0 is a valid value to be in memory. Do you think it should be something else? Why?

A better test would be to erase the block, write to it, then read it out and verify content.

initialize the buffer to something to ensure new data is actually populated.

If you feel a post has answered your question, please click "Accept as Solution".