2020-05-24 08:46 AM
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.
2020-05-24 10:05 AM
SDIO should be compatible with SD. What specification are you seeing that CMD52 is required to abort the transfer?
2020-05-24 07:49 PM
SDIO Simplified specification:
2020-05-24 08:21 PM
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.
2020-05-25 08:07 PM
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?
2020-05-25 11:36 PM
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.
2020-05-26 05:58 AM
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.