cancel
Showing results for 
Search instead for 
Did you mean: 

Ethernet Link Status is not working

RKuma.7.302
Associate II

Hi Team,

I need you support, I am using STM32F429zi, CubeMx Version 5.3.0, STM32Cube_FW_F4_V1.24.1, REERTOS_version  10.0.1 and Platform is atollic truestudio.

Issue: Ethernet UP/Down Link status

I enable,

#define LWIP_NETIF_STATUS_CALLBACK 1

#define LWIP_NETIF_LINK_CALLBACK 1

observation: Ethernet INT4 is not enable or is not heating.

1 ACCEPTED SOLUTION

Accepted Solutions
Piranha
Chief II
  1. Use "Code Snippet" feature, when posting code.
  2. Provide information about the board used.
  3. Debug the code.

Probably the PHY address is wrong...

View solution in original post

4 REPLIES 4
Tomas DRESLER
Senior II

Hello, are you speaking about PHY ETH4 IRQ line? It's not enabled by the ETH low level driver, neither the stack sets up any external interrupt on any GPIO pin.

You have to do this manually.

LWIP/ST implementation uses a thread to check the status of PHY by polling.

RKuma.7.302
Associate II

Thank you sir for replay, Yes , I mean PHY ETH4 IRQ line

I checked LWIP status thread , But there also i am not getting the Link down or up status but thread is running.

LWIP thread code :-

void ethernetif_set_link(void const *argument)

{

 uint32_t regvalue = 0;

 struct link_str *link_arg = (struct link_str *)argument;

  

 for(;;)

 {

  /* Read PHY_BSR*/

  HAL_ETH_ReadPHYRegister(&heth, PHY_BSR, &regvalue);

   

  regvalue &= PHY_LINKED_STATUS;

   

  /* Check whether the netif link down and the PHY link is up */

  if(!netif_is_link_up(link_arg->netif) && (regvalue))

  {

   /* network cable is connected */ 

   netif_set_link_up(link_arg->netif);     

  }

  else if(netif_is_link_up(link_arg->netif) && (!regvalue))

  {

   /* network cable is dis-connected */

   netif_set_link_down(link_arg->netif);

  }

  

  /* Suspend thread for 200 ms */

  osDelay(200);

 }

}

Piranha
Chief II
  1. Use "Code Snippet" feature, when posting code.
  2. Provide information about the board used.
  3. Debug the code.

Probably the PHY address is wrong...

Yes you are write, I changed the PHY Address and stated working. PHY_ADDRESS 0.

Thanks..