Skip to main content
ENo.1
Associate
November 12, 2020
Question

SD card is always in 'TRANSFER' state.

  • November 12, 2020
  • 6 replies
  • 2770 views

Hi

I'm using STM32F103VGT6 and now days i have a problem in working with SD cards.

I can't use FatFs library.

"HAL_SD_GetCardState" function, always return 'TRANSFER' state.

I try multiple SD cards, clock divider and any many configs.

please help.

thanks

This topic has been closed for replies.

6 replies

TDK
November 12, 2020

The TRANSFER state is where the card is most of the time. Do you think it should be in a different state?

https://user-images.githubusercontent.com/77482/29501948-45c1c196-85e1-11e7-9bfc-d4817115d5bb.png

"If you feel a post has answered your question, please click ""Accept as Solution""."
ENo.1
ENo.1Author
Associate
November 12, 2020

thanks @TDK​ 

This function (HAL_SD_GetCardState) has multiple output.

For example:

-HAL_SD_CARD_READY

Card state is ready

-HAL_SD_CARD_IDENTIFICATION

Card is in identification state

-HAL_SD_CARD_STANDBY

Card is in standby state

-HAL_SD_CARD_TRANSFER

Card is in transfer state

-HAL_SD_CARD_SENDING

Card is sending an operation

-HAL_SD_CARD_RECEIVING

Card is receiving operation information

'HAL_SD_CARD_READY' state, means SD card is ready for do an operation.

It seems that in most of the time, SD card must in READY state, not TRANSFER state.

in TRANSFER state, i can't read or write from/to SD card. it means SD card is doing an operation and its busy.

TDK
November 12, 2020

> in TRANSFER state, i can't read or write from/to SD card. it means SD card is doing an operation and its busy.

That's simply not true. Most commands, including read/write commands, are initiated when the card is in the transfer state. See the graph that I linked. If you have a copy of the SD standard, there are more details in there. I linked the figure for eMMC, but SD is similar.

"If you feel a post has answered your question, please click ""Accept as Solution""."