Showing results for 
Search instead for 
Did you mean: 

Trouble with TCP/IP on STM32F407ZET6 and LAN8742A


I've managed to get tcp/ip working just fine on the NUCLEO-429ZI board, but I'm unable to make similar code work on the 407ZET6 chip, despite using what I believe to be a nearly identical circuit with the LA8742A chip.  I suspected it had something to do with the circuitry, so I sent a trouble ticket to Microchip and they confirmed that there was a small error which I have since corrected.  This allows the chip itself to make a link with the router, but I'm not getting any communication between the ST chip and the ethernet controller chip.

Current setup is using CubeIDE and configuring FreeRTOS, ETH, and LWIP in both DHCP and Static modes. The firmware never seems to come back from the MX_LWIP_Init routine.  I've been diving into the libs to see where the problem is, and it seems like the issue is when low_level_init calls HAL_ETH_Init(), from which it never returns.

Digging deeper, it seems to crash inside ETH_MACDMAConfig();

I've spent so many hours trying to debug this.  Any help would be greatly appreciated. What could be causing this to hang during initialization?




Then dig even deeper and check where ETH_MACDMAConfig() fails.

That is the function where all the STM32 internal ethernet registers are set up,
AND communication with the PHY starts to get info (by triggering auto-negotiation) about the connection concerning speed and duplex mode to set up these internal registers.
That's what you should look at.

It looks like the system is getting hung up on the HAL_Delay().  I'm not sure why that is broken, but I have seen that issue before.  Would you suggest finding a new timer to use for it and just re-writing the delay function, which is defined as __weak?


Check your interrupt priorities, HAL_Delay() is using SysTick, which should have highest priority (which is HAL default, I think).

So don't give any other interrupt the priority "0, 0".

Is that HAL_Delay() used when waiting for the PHY to complete auto-negotiation?