cancel
Showing results for 
Search instead for 
Did you mean: 

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

diverger
Senior

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.

6 REPLIES 6
TDK
Guru

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".
diverger
Senior

SDIO Simplified specification:

0693W000001pLkfQAE.png

TDK
Guru

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".

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?

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
Up vote any posts that you find helpful, it shows what's working..

I haven't done this, but it seems like the SDMMC peripheral is fully capable of handling the SDIO commands. Could be wrong. As clive1 says, you're going to have to test it.

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