Skip to content

Commit

Permalink
stm32h7:sdmmc It is not an error if no wait was needed
Browse files Browse the repository at this point in the history
   If the CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE is enabled and the
   card is found to be ready in the waitenable call. Then
   we do not need a Watchdog nor to configure the pin for
   IRQ to detect ready.

   This was reported as an error, and it is not, it simply means
   we do not have to wait.
  • Loading branch information
davids5 authored and xiaoxiang781216 committed May 9, 2023
1 parent fcb6c6f commit 8068dc0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions arch/arm/src/stm32h7/stm32_sdmmc.c
Expand Up @@ -2797,7 +2797,7 @@ static void stm32_waitenable(struct sdio_dev_s *dev,
#if defined(CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE)
if ((eventset & SDIOWAIT_WRCOMPLETE) != 0)
{
/* Read pin to see if ready (true) skip timeout */
/* Read pin to see if ready (true) skip timeout and the pin IRQ */

if (stm32_gpioread(priv->d0_gpio))
{
Expand Down Expand Up @@ -2894,13 +2894,15 @@ static sdio_eventset_t stm32_eventwait(struct sdio_dev_s *dev)
flags = enter_critical_section();

#if defined(CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE)
/* A card ejected while in SDIOWAIT_WRCOMPLETE can lead to a
/* A call to stm32_waitenable that finds the card ready or
* a card ejected while in SDIOWAIT_WRCOMPLETE can lead to a
* condition where there is no waitevents set and no wkupevent
* This simply means we should not wait.
*/

if (priv->waitevents == 0 && priv->wkupevent == 0)
{
wkupevent = SDIOWAIT_ERROR;
wkupevent = 0;
goto errout_with_waitints;
}

Expand Down

0 comments on commit 8068dc0

Please sign in to comment.