cancel
Showing results for 
Search instead for 
Did you mean: 

One SD Card doesn't boot properly (rejects everything after CMD0)

brunoferren9
Associate II
Posted on March 23, 2018 at 10:06

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

1 ACCEPTED SOLUTION

Accepted Solutions
stm322399
Senior
Posted on March 24, 2018 at 15:51

Clocking at 12MHz for the setup phase is out of specification. As far as I remember you must not go higher than 400KHz.

View solution in original post

2 REPLIES 2
stm322399
Senior
Posted on March 24, 2018 at 15:51

Clocking at 12MHz for the setup phase is out of specification. As far as I remember you must not go higher than 400KHz.

brunoferren9
Associate II
Posted on March 26, 2018 at 17:29

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!