Skip to main content
Senior
May 24, 2020
Question

How to handle the data abord in SDIO card but not SD memory card?

  • May 24, 2020
  • 6 replies
  • 1293 views

For SD memory card when there are errors in data transfer or do multiple block transfer, we need use CMD12 to abort the transfer, And there is function for SD card in HAL library, for example, there is 'SDMMC_CmdStopTransfer' in STM32H7's lib. But how about SDIO? The SDIO specification states CMD52 is needed at card side. Then what we should do at STM32 side, particularly in STM32H7?

Thanks.

This topic has been closed for replies.

6 replies

TDK
May 24, 2020

SDIO should be compatible with SD. What specification are you seeing that CMD52 is required to abort the transfer?

"If you feel a post has answered your question, please click ""Accept as Solution""."
divergerAuthor
Senior
May 25, 2020

SDIO Simplified specification:

0693W000001pLkfQAE.png

TDK
May 25, 2020

You're right.

You'll have to create your own function as this command isn't in the HAL library. You can use SDMMC_CmdStopTransfer function as a template and change CmdIndex to 52 and change Argument to set the correct bits. However, it looks like the response is R5, which doesn't appear to be supported by HAL either--there doesn't appear to be a SDMMC_GetCmdResp5 function. You'd have to create this as well.

So short answer, do it yourself or wait until it's implemented into HAL, if ever.

"If you feel a post has answered your question, please click ""Accept as Solution""."
divergerAuthor
Senior
May 26, 2020

But what make me not so confident is the ST's manual only mentions how to handle CMD12 with abort. Such as use CMD12 with CMDSTOP. Will this flow works for CMD52 too?

Tesla DeLorean
Guru
May 26, 2020

Pretty sure you're going to have to work through and test these things. You'll need to rationalize​ the SD/MMC specs vs the SDIO/SDMMC peripheral functionality.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..