From 282ab797bf689faaefacc080c45c2ee8e3d44e41 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 8 Jul 2021 13:13:16 -0700 Subject: [PATCH] stm32h7:Ethernet Add some delays so that ifup() does not hog the CPU. --- arch/arm/src/stm32h7/stm32_ethernet.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/src/stm32h7/stm32_ethernet.c b/arch/arm/src/stm32h7/stm32_ethernet.c index ae731f2330..49a3eae706 100644 --- a/arch/arm/src/stm32h7/stm32_ethernet.c +++ b/arch/arm/src/stm32h7/stm32_ethernet.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -295,7 +296,7 @@ #define PHY_READ_TIMEOUT (0x0004ffff) #define PHY_WRITE_TIMEOUT (0x0004ffff) -#define PHY_RETRY_TIMEOUT (0x0004ffff) +#define PHY_RETRY_TIMEOUT (0x0001998) /* MAC reset ready delays in loop counts */ @@ -3553,6 +3554,8 @@ static int stm32_phyinit(struct stm32_ethmac_s *priv) { break; } + + nxsig_usleep(100); } if (timeout >= PHY_RETRY_TIMEOUT) @@ -3585,6 +3588,8 @@ static int stm32_phyinit(struct stm32_ethmac_s *priv) { break; } + + nxsig_usleep(100); } if (timeout >= PHY_RETRY_TIMEOUT)