jstill343
Posts: 2
Joined: Sun Aug 02, 2020 8:29 pm

EMMC CRC error

Sun Aug 02, 2020 10:26 pm

Hi,

I'm trying to write an SD card driver for my Raspberry Pi 3B+. I'm always getting a CRC error when I issue a single block read command (CMD17) to the SD card (I haven't tried multiblock read or writes yet. I want to get the single block read down first). For the card initialization process, I reset the EMMC, set the EMMC clock to 400KHz, send CMD0, CMD8, ACMD41, CMD2, CMD3, set EMMC clock to 25MHz, CMD7, then ACMD6 (after reading the SCR). The initialization process seems to succeed. After the initialization process, the card is in the TRAN state. For my read function, I wait for the data line to become available, set the EMMC blocksize to 0x00010200 (which should be correct for a single 512 bytes read), and issue CMD17. I'm trying to read block 0. The interrupt register before the read command is 0 and after is always 0x00208101. I'm not sure if there is a command or step I am missing which is causing my CRC error.

Any help is greatly appreciated.

LdB
Posts: 1586
Joined: Wed Dec 07, 2016 2:29 pm

Re: EMMC CRC error

Mon Aug 03, 2020 5:36 am

try reading at 400Khz if your speed change is wrong she will baulk and don't forget destination buffer must be 4 byte aligned.

jstill343
Posts: 2
Joined: Sun Aug 02, 2020 8:29 pm

Re: EMMC CRC error

Fri Aug 07, 2020 9:51 pm

try reading at 400Khz if your speed change is wrong she will baulk and don't forget destination buffer must be 4 byte aligned.
Can you explain why the destination buffer needs to be 4 byte aligned?

Return to “Bare metal, Assembly language”