mastering-stm32 icon indicating copy to clipboard operation
mastering-stm32 copied to clipboard

SD card initialization example: ACMD41 transmission bit missing

Open pterodragon opened this issue 4 years ago • 0 comments

https://github.com/cnoviello/mastering-stm32/blob/master/nucleo-f446RE/Middlewares/FatFs/src/drivers/sd_diskio_spi.c#L354 ACMD41 returns 0x05 (includes the illegal command flag) here

I think this line https://github.com/cnoviello/mastering-stm32/blob/master/nucleo-f446RE/Middlewares/FatFs/src/drivers/sd_diskio_spi.c#L259 should have been

    cmd_message[0] = cmd | 0x40;

I'm using a SanDisk 64 GB microSDXC card, and after making the above correction, ACMD41 returns 0x00 and the SD card initialization process is successful

pterodragon avatar Feb 14 '21 10:02 pterodragon