Author Topic: New SD cards stuck in CARD_BUSY_WAIT  (Read 614 times)

Offline timadria

  • Newbie
  • *
  • Posts: 9
    • View Profile
New SD cards stuck in CARD_BUSY_WAIT
« on: May 20, 2022, 09:59:37 AM »
Hi,

WE received a new batch of SD cards (2 different brands) and they stay in a CARD_BUSY_WAIT loop forever. The older cards (same type, capacity, brand, ...) work perfectly.
I already updated our µtFAT library to the newest version.

I've added some logging:
SD_STATE_STABILISING
SD_STATE_GO_IDLE
SD_STATE_IF_COND
 SD v2 or higher
 SD do new poll (Now we are in a SD_STATE_APP_CMD55_CMD41 - CARD_BUSY_WAIT loop

Is there any known issue/solution?

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3188
    • View Profile
    • uTasker
Re: New SD cards stuck in CARD_BUSY_WAIT
« Reply #1 on: May 20, 2022, 08:20:09 PM »
Hi

During the mounting of the card once of the first things done is to execute the
CMD55
CMD41
sequence.

Typically the first of these take some time to be performed by the SD card it returns its busy state until it has completed and the CMD41 can be continued with.

It is however not normal that the card never returns that it has completed the first command. This also means that this is not something that have been experienced and worked around before.

Is the card being use in SDHC or SPI mode?

Regards

Mark


Offline timadria

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: New SD cards stuck in CARD_BUSY_WAIT
« Reply #2 on: May 23, 2022, 08:45:16 AM »
I indeed use it in SPI mode. The strange thing is that the cards work in my digital camera and laptop.
I've seen in the SD card protocols that a command is always ended with a stop bit. This is not done in your library. I've tested this and then the initialization continuous until the SD_MOUNTING_1 state. Here I get a timeout.

Maybe I can send you one of these cards?
« Last Edit: May 23, 2022, 11:57:40 AM by timadria »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3188
    • View Profile
    • uTasker
Re: New SD cards stuck in CARD_BUSY_WAIT
« Reply #3 on: May 23, 2022, 08:24:09 PM »
Hi

SD Cards are used mainly n SDHC/SDIO mode and that will be 99.999% the case when inserting them into pieces of equipment like cameras.

In the past I have hear of batches of card that didn't work normally in SPI mode but worked as expected in SDHC mode.

The last change that I made was 2 years ago in order to ensure that a batch of cards that suddenly used a different version of the specification (I believe in SPI mode) could be handled:

30.04.2020 Add option SUPPORT_SDCARD_V1 to allow V+ SD cards to be used

In that mode there is a command that is not supported and so has to be ignored when it fails but I don't see it to be the same case as yours. If it is not enabled you could however give it a try.

Have you tried the "info" command in the SD card menu? This will show the card's CSD register content which gives some details and may show that there is a difference when compared with the cards that have worked.

The SPI mode was developed about 14 years ago and I don't remember the details of the start and stop bit method that was integrated (or whether anything was not respected in the process) but you are welcome to send me a reference card so that I can investigate if you don't find a solution to get the batch operating.

Regards

Mark