diff --git a/arch/arm/src/stm32f7/chip/stm32_ethernet.h b/arch/arm/src/stm32f7/chip/stm32_ethernet.h index 962cb6d9220..dfb3a34745c 100644 --- a/arch/arm/src/stm32f7/chip/stm32_ethernet.h +++ b/arch/arm/src/stm32f7/chip/stm32_ethernet.h @@ -47,7 +47,7 @@ * families */ -#if defined(CONFIG_STM32F7_STM32F74XX) || defined(CONFIG_STM32F7_STM32F75XX) \ +#if defined(CONFIG_STM32F7_STM32F74XX) || defined(CONFIG_STM32F7_STM32F75XX) || \ defined(CONFIG_STM32F7_STM32F76XX) || defined(CONFIG_STM32F7_STM32F77XX) /**************************************************************************************************** diff --git a/arch/arm/src/stm32f7/stm32_ethernet.c b/arch/arm/src/stm32f7/stm32_ethernet.c index 3573100631c..dac4787a8c9 100644 --- a/arch/arm/src/stm32f7/stm32_ethernet.c +++ b/arch/arm/src/stm32f7/stm32_ethernet.c @@ -82,6 +82,11 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + +/* Memory synchronization */ + +#define MEMORY_SYNC() do { ARM_DSB(); ARM_ISB(); } while (0) + /* Configuration ************************************************************/ /* See configs/stm3240g-eval/README.txt for an explanation of the configuration * settings. @@ -1219,6 +1224,8 @@ static int stm32_transmit(struct stm32_ethmac_s *priv) /* Check if the TX Buffer unavailable flag is set */ + MEMORY_SYNC(); + if ((stm32_getreg(STM32_ETH_DMASR) & ETH_DMAINT_TBUI) != 0) { /* Clear TX Buffer unavailable flag */ @@ -2210,6 +2217,8 @@ static int stm32_interrupt(int irq, void *context, FAR void *arg) wd_cancel(priv->txtimeout); } + DEBUGASSERT(work_available(&priv->irqwork)); + /* Schedule to perform the interrupt processing on the worker thread. */ work_queue(ETHWORK, &priv->irqwork, stm32_interrupt_work, priv, 0); @@ -2287,6 +2296,8 @@ static void stm32_txtimeout_expiry(int argc, uint32_t arg, ...) /* Schedule to perform the TX timeout processing on the worker thread. */ + DEBUGASSERT(work_available(&priv->irqwork)); + work_queue(ETHWORK, &priv->irqwork, stm32_txtimeout_work, priv, 0); } @@ -2386,7 +2397,14 @@ static void stm32_poll_expiry(int argc, uint32_t arg, ...) /* Schedule to perform the interrupt processing on the worker thread. */ - work_queue(ETHWORK, &priv->pollwork, stm32_poll_work, priv, 0); + if (work_available(&priv->pollwork)) + { + work_queue(ETHWORK, &priv->pollwork, stm32_poll_work, priv, 0); + } + else + { + (void)wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, priv); + } } /**************************************************************************** diff --git a/configs/nucleo-144/include/board.h b/configs/nucleo-144/include/board.h index 18d2727502b..1027e514ec4 100644 --- a/configs/nucleo-144/include/board.h +++ b/configs/nucleo-144/include/board.h @@ -449,7 +449,7 @@ * -------- ------------ ------------- * PG11 RMII_TX_EN TXEN * PG13 RMII_TXD0 TXD0 - * PG14 RMII_TXD1 TXD1 + * PB13 RMII_TXD1 TXD1 * PC4 RMII_RXD0 RXD0/MODE0 * PC5 RMII_RXD1 RXD1/MODE1 * PG2 RMII_RXER RXER/PHYAD0 -- Not used @@ -466,7 +466,7 @@ #define GPIO_ETH_RMII_TX_EN GPIO_ETH_RMII_TX_EN_2 #define GPIO_ETH_RMII_TXD0 GPIO_ETH_RMII_TXD0_2 -#define GPIO_ETH_RMII_TXD1 GPIO_ETH_RMII_TXD1_2 +#define GPIO_ETH_RMII_TXD1 GPIO_ETH_RMII_TXD1_1 /************************************************************************************ * Public Data