So I initialized this SDHC card by sending CMD0, CMD8, CMD55, ACMD41, and CMD58. Everything runs fine. Now I want to read a block, so I set CS low, send CMD17, get a response, wait for 0xFE, then get 512 bytes of data, send two 0xFF, set CS high and send a further 0xFF.
Sometimes I only get an alternating bunch of 0x55 and 0xAA, and other times, the 0xFE just never arrives. Before it did read the correct block addresses, without any particular change that might have triggered the problem, aside from altering the timing, memory structures etc. Does anybody know why an SD card would only return immense loads of 55AA when there's only that value at the end of some blocks afaik?
EDIT: the result returned by CMD17 is 0x00, so the command is actually recognized. I've also tried to read address 0, but it returns the same 55AA pattern...
EDIT: ok, so now I've managed to read sector 0. This happens if I keep the device switched off with the SD outside the slot for a couple of minutes, and keeps happening for some time after powering it on, only to start failing again. Sector 0 reads correctly, but the higher the address, the more difficult it is to read. It locks up when it reaches 0x5F.
EDIT: here's the behavior with different microSDHC cards:
- SanDisk Ultra 16 GB uSDHC I C10
Eventually responds 0x00 to ACMD41, but locks up busy afterwards,
or locks up busy during an ACMD41, before an OK response.
- Kingston 16 GB uSDHC I C10 U1 (the one that can be read if left to 'cool')
- Hard reset
ACMD41 never returns 0x00, or the card gives a bad response to CMD8 just after CMD0.
- Soft reset
First sector is read, but only gives 55AA; then the next read command
never gives 0xFE to start data transmission.
- Transcend 4 GB uSDHC C2 (doesn't work very well even with other devices)
Doesn't give 0xFE with any read commands.
- No card
Response 0x00 to CMD0 (i.e. MISO remains low).