2018-03-23 02:06 AM
Hello!
I'm currently developping a SD Card driver, and after some hard work, I got to a point where everything works pretty well. However, I have this one SD card that doesn't boot properly, while 3 others work great. I'm working on a STM32F070, accessing the microSD card with SPI, clocked at 12MHz.
The error occurs at the very beginning : I send CMD0, the card actually sends the correct response (0x01), but then, when sending CMD8, the command is rejected (I get a 0x7F R1 response). I tried sending CMD0 again instead, same result. I raise CS, send 8 clock bits, and lower CS again between the two commands.
The 3 cards that do work are:
- Standard capacity 2G, with no speed class indication
- HC 4G C10
- HC I 4G C4 (this one is strange : UHS-I bus, but low speed class C4)
The one that doesn't work is a HC I 16G U1.
I read a lot, I tried a lot, but I can't figure out why the card would accept CMD0 and reject everything else after that. Of course, I tested the card on a standard reader and it works.
Any suggestion would be appreciated
Solved! Go to Solution.
2018-03-24 07:51 AM
Clocking at 12MHz for the setup phase is out of specification. As far as I remember you must not go higher than 400KHz.
2018-03-24 07:51 AM
Clocking at 12MHz for the setup phase is out of specification. As far as I remember you must not go higher than 400KHz.
2018-03-26 08:29 AM
Well, that was it, thanks!
And now I feel stupid, because I actually noticed this in the standard. I just dismissed it, because the card is faster than the other (during normal use), and because it responds to the first CMD0 command. I can't, for the life of me, understand why it needs to be clocked slow at the beginning. But of course, I don't have to, it's just outside the standard.
Standards are not to be ignored, even if ignoring them worked OK in the past. Lesson learned!