SD Card CMD Line Error (SDHC CC + CTOE)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SD Card CMD Line Error (SDHC CC + CTOE)

1,016 Views
inequihi
Contributor I

Hello!

I am working on a SD Card reader driver, with the help of the SDK example for it. I have encountered a problem when initializing the card which i do not know how to resolve. 

When I run my program in debug mode, with a breakpoint before sending each command, the initialization works fine. However when I ran without breakpoints I arrive to a command error. The IRQSIGEN register contains the Command Complete CC and the Command Time Out Error bits set to 1. 

inequihi_0-1673982337291.png

 

This is a CMD Line Conflict. And according to the K-64 Sub-Family Reference MAnual:

But what does recover mean? Should I start sending all the commands to initialize the sd card again?

I tried doing a reset but it still not works.

Is there another way to solve CMD line conflict? 

My SD card clock is set at 390kHz

 

0 Kudos
Reply
3 Replies

1,000 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @inequihi,

What does recover means? It means that you might try to restart the process, for example, reset the card, make a power cycle, etc.

Should I start sending all the commands to initialize the SD card again? Usually, the CMD line conflict is caused by a wrong initialization of SDHC controller, so please double check your pin muxing and initialization. Also, review the Present State Register (PRSSTAT) and the CIHB bit configuration.

Next, you could see another community post with a similar issue: i.MX51 SDHC CMD0 Results In Cmd Line Conflict - NXP Community; it might be useful to take a look at it.

Hope any of this information helps you.

Best regards, Raul.

0 Kudos
Reply

989 Views
inequihi
Contributor I

Hello Raul,

 

thank you for your response. I've restructured my code so I restart the process every time an error occurs during initialization. Also before issuing any command I do check that the command/data bus is not busy (CDIHB and CIHB) like in the SDK example.

However it didnt work and the initialization never got done. 

I found another solution which is having a delay (just like the solution from the post you send me) between each command and now I do not encounter CMD Line Conflicts. I know this isnt a good solution because this would probably mean that I should do a delay after ever transfer access to the SD Card. Do you have an idea why a delay solves the conflict problem? Is there a more elegant solution or another register I should check to ensure a transfer can be done? How many seconds should the delay be?

Thank you!


0 Kudos
Reply

961 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @inequihi,

If it is possible, could you please share your initialization code? Or at least, could you share the changes you made to the example code? Also, are you using FRDM-K64 sdmmc_examples->sdcard_interrupt example? If not, which example are you using?

Best regards, Raul.

0 Kudos
Reply