2026-01-31 1:40 PM
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.
2026-01-31 5:49 PM
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.
2026-02-01 1:46 AM
Because this card is formatted in FAT32 and I'm trying read sector number 0 (boot sector) :)
Here is content of sector 0, what I read on my computer
I know, that last bytes on sd card are not like in original fat32 boot sector because I'm editing this bytes for test but values in buffer was not changed.