stm32f7: fix reset of d0_gpio

For the case when the watchdog is triggering a timeout we did not
correctly reset the d0 GPIO.

Without this fix, the SD card can become inaccessible.
This commit is contained in:
Julian Oes 2021-06-25 17:10:11 +02:00 committed by Xiang Xiao
parent 154795a247
commit 665f847760

View File

@ -855,13 +855,9 @@ static void stm32_configwaitints(struct stm32_dev_s *priv, uint32_t waitmask,
flags = enter_critical_section();
#ifdef CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE
if ((waitmask & SDIOWAIT_WRCOMPLETE) != 0)
#if defined(CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE)
if ((waitevents & SDIOWAIT_WRCOMPLETE) != 0)
{
/* Do not use this in STM32_SDMMC_MASK register */
waitmask &= ~SDIOWAIT_WRCOMPLETE;
pinset = priv->d0_gpio & (GPIO_PORT_MASK | GPIO_PIN_MASK | \
GPIO_PUPD_MASK);
pinset |= (GPIO_INPUT | GPIO_EXTI);
@ -1467,8 +1463,13 @@ static void stm32_eventtimeout(wdparm_t arg)
{
/* Yes.. wake up any waiting threads */
#ifdef CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE
stm32_endwait(priv, SDIOWAIT_TIMEOUT |
(priv->waitevents & SDIOWAIT_WRCOMPLETE));
#else
stm32_endwait(priv, SDIOWAIT_TIMEOUT);
mcerr("Timeout: remaining: %d\n", priv->remaining);
#endif
mcerr("Timeout: remaining: %zu\n", priv->remaining);
}
}
@ -2723,7 +2724,9 @@ static void stm32_waitenable(FAR struct sdio_dev_s *dev,
#if defined(CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE)
if ((eventset & SDIOWAIT_WRCOMPLETE) != 0)
{
waitmask = SDIOWAIT_WRCOMPLETE;
/* eventset carries this */
waitmask = 0;
}
else
#endif
@ -2926,7 +2929,7 @@ static void stm32_callbackenable(FAR struct sdio_dev_s *dev,
{
struct stm32_dev_s *priv = (struct stm32_dev_s *)dev;
mcinfo("eventset: %02x\n", eventset);
mcinfo("eventset: %02" PRIx8 "\n", eventset);
DEBUGASSERT(priv != NULL);
priv->cbevents = eventset;