Skip to content

Commit a5996ed

Browse files
committed
stm32/eth: Permanently register netif with lwip during startup.
This restructures LWIP initialization and removes blocking PHY loops to support static IP configuration before active(True) and eliminate timeouts when starting without cable. Changes: - Split netif init into eth_netif_init_early() and eth_lwip_init() - Initialize netif structure in eth_init() for early IP config - Move netif stack registration to eth_start() - Remove blocking PHY autonegotiation loop from eth_mac_init() - Add eth_phy_configure_autoneg() for non-blocking setup - Add eth_phy_link_status_poll() for link state management - Only start DHCP if no static IP configured (0.0.0.0) - Use default MAC speed/duplex config until autoneg completes Benefits: - Static IP can be configured before active(True) - active(True) succeeds immediately without cable - No more 10-second timeout on startup - Link detection works properly when cable plugged later Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
1 parent 5944bce commit a5996ed

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

ports/stm32/eth.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -273,22 +273,10 @@ static int eth_mac_init(eth_t *self) {
273273

274274
#if defined(STM32H5)
275275
__HAL_RCC_ETH_RELEASE_RESET();
276-
277-
__HAL_RCC_ETH_CLK_SLEEP_DISABLE();
278-
__HAL_RCC_ETHTX_CLK_SLEEP_DISABLE();
279-
__HAL_RCC_ETHRX_CLK_SLEEP_DISABLE();
280276
#elif defined(STM32H7)
281277
__HAL_RCC_ETH1MAC_RELEASE_RESET();
282-
283-
__HAL_RCC_ETH1MAC_CLK_SLEEP_DISABLE();
284-
__HAL_RCC_ETH1TX_CLK_SLEEP_DISABLE();
285-
__HAL_RCC_ETH1RX_CLK_SLEEP_DISABLE();
286278
#else
287279
__HAL_RCC_ETHMAC_RELEASE_RESET();
288-
289-
__HAL_RCC_ETHMAC_CLK_SLEEP_DISABLE();
290-
__HAL_RCC_ETHMACTX_CLK_SLEEP_DISABLE();
291-
__HAL_RCC_ETHMACRX_CLK_SLEEP_DISABLE();
292280
#endif
293281

294282
// Do a soft reset of the MAC core

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy