2024-02-11 03:34 AM
Hi
I see sleep/awake cmd is implemeneted in HAL fpr STM32H7only.
Now I ported it myself to Stm32f446 myself successfully. However instead of while loop below, i inserted a HAL_Delay(1);
H7 has a SDMMC but Stm32f446 has a SDIO.
In the H/ HAL bit SDMMC_FLAG_BUSYD0END flag is checked to check when device is ready.
SDMMC_FLAG_BUSYD0END is bit 20 in SDMMC status register (SDMMC_STAR)
This bit how ever does not exist in SDIO status register (SDIO_STA).
How can I implement this on Stm32f446 ?
Its is about this while loop which i need to rewrite:
Thx
/* Wait that the device is ready by checking the D0 line */
while ((!__HAL_MMC_GET_FLAG(hmmc, SDMMC_FLAG_BUSYD0END)) && (errorstate == HAL_MMC_ERROR_NONE))
{
if ((HAL_GetTick() - tickstart) >= timeout)
{
errorstate = SDMMC_ERROR_TIMEOUT;
}
}
/* Clear the flag corresponding to end D0 bus line */
__HAL_MMC_CLEAR_FLAG(hmmc, SDMMC_FLAG_BUSYD0END);
Solved! Go to Solution.
2024-05-02 03:26 AM - edited 2024-05-02 05:19 AM
hello @MK..1
To get the state of MultiMediaCards, the API that should be used is HAL_MMC_GetCardState().
To get the state of SD cards, the API that should be used is HAL_SD_GetCardState().
.
2024-04-30 08:53 AM
Hello @MK..1
To check the state of the SD card, you can use the API HAL_MMC_GetCardState().
2024-04-30 09:12 AM
Hi
I am talking about a EMMC not SD card. Does that apply to EMMC as well?
2024-05-02 03:26 AM - edited 2024-05-02 05:19 AM
hello @MK..1
To get the state of MultiMediaCards, the API that should be used is HAL_MMC_GetCardState().
To get the state of SD cards, the API that should be used is HAL_SD_GetCardState().
.
2024-05-07 01:28 AM
Hello @MK..1
Please mark my answer as best by clicking on the "Accept as Solution" button if it fully answered your question. This will help other users find this solution faster.
Thanks for your contribution.
Omar