Skip to main content
ismail fatih iltar
Associate III
August 1, 2018
Question

cubemx lan8742a auto negotiation fail

  • August 1, 2018
  • 2 replies
  • 1122 views

Hi everyone, im using stm32f746zgt with lan8742a phy. i manage settings on cubemx. when i set speed and duplex with manually like a 100mbps full duplex my system works well. but when i change it to auto negotiation it returns with timeout. It crashes on below lines that are in stm32f7xx_hal_eth.c

/* Wait until the auto-negotiation will be completed */
 do
 {
 HAL_ETH_ReadPHYRegister(heth, PHY_BSR, &phyreg);
 
 /* Check for the Timeout */
 if((HAL_GetTick() - tickstart ) > ETH_TIMEOUT_AUTONEGO_COMPLETED)
 {
 /* In case of write timeout */
 err = ETH_ERROR;
 
 /* Config MAC and DMA */
 ETH_MACDMAConfig(heth, err);
 
 heth->State= HAL_ETH_STATE_READY;
 
 /* Process Unlocked */
 __HAL_UNLOCK(heth);
 
 return HAL_TIMEOUT;
 }
 
 } while (((phyreg & PHY_AUTONEGO_COMPLETE) != PHY_AUTONEGO_COMPLETE));

i increased ETH_TIMEOUT_AUTONEGO_COMPLETED time but nothing changed. my switch and computer eth settings are auto. What should i check ?

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
August 10, 2018

"It crashes" care to refine that a little?

If you stop the debugger where exactly is it stuck?

Is it generating an interrupt you're not catching?

Is it stuck in a loop waiting for a tick?

Checked clocks to PHY?

SysTick has sufficient priority?

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
SGupt.6
Associate
March 19, 2024

HI,

HAVE YOU GOT SOLUTION FOE YOUR ISSUE..? I AM FAING SAME ISSUE .. IF YOU SUGGEST THAT WILL BE HELPFUL