cancel
Showing results for 
Search instead for 
Did you mean: 

Ethernet Connectivity problem

rags
Associate II
Posted on June 14, 2014 at 12:19

Hi Everyone,

We are developing Vibration Analyzer. As a part of communication we are using Ethernet[STM32F107RCT6]. It is working fine but problem is when we unplug LAN cable from the system and plug it after 20 seconds communication doesn't work. we have to restart whole system once, then it gets connected. Please give us a solution for this ASAP.

thanks in advance.....

#ethernet-connectivity-problem #ethernet-plugin-problem #ethernet-connectivity-problem #ethernet-connectivity-problem #ethernet-connectivity-problem
7 REPLIES 7
Posted on June 14, 2014 at 18:14

I think you need to configure the interrupt signal on the PHY, and have the interrupt handler reconfigure/renegotiate the connection when the cable is plugged back in. This would also need to initiate a reset in the stack, and DHCP request for an IP address, etc.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
rags
Associate II
Posted on June 16, 2014 at 08:57

Hi Clive,

Thanks for reply,

I am not able to understand which interrupt on PHY to be configured? As you said i can initiate RESET in DHCP request for IP address.

Thanks in advance....

Posted on June 16, 2014 at 14:53

I'm not familiar with your board design or component choices.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
rags
Associate II
Posted on June 18, 2014 at 11:53

Hi Clive1,

I tried what you said earlier. I am attaching my code. Please check it once and help ASAP. Controller- STM32107RBT6 with DP83848CVV as physical layer device.

 /*-------------------- PHY initialization and configuration ----------------*/

  /* Put the PHY in reset mode */

  if(!(ETH_WritePHYRegister(PHYAddress, PHY_BCR, PHY_Reset)))

  {

    /* Return ERROR in case of write timeout */

    return ETH_ERROR;

  }

  

  /* Delay to assure PHY reset */

  _eth_delay_(PHY_ResetDelay);

  

    

  if(ETH_InitStruct->ETH_AutoNegotiation != ETH_AutoNegotiation_Disable)

  {  

    /* We wait for linked satus... */

    do

    {

      timeout++;

    } while (!(ETH_ReadPHYRegister(PHYAddress, PHY_BSR) & PHY_Linked_Status) && (timeout < PHY_READ_TO));

    /* Return ERROR in case of timeout */

    if(timeout == PHY_READ_TO)

    {

      return ETH_ERROR;

    }

    /* Reset Timeout counter */

    timeout = 0;

    

    /* Enable Auto-Negotiation */

    if(!(ETH_WritePHYRegister(PHYAddress, PHY_BCR, PHY_AutoNegotiation)))

    {

      /* Return ERROR in case of write timeout */

      return ETH_ERROR;

    }

    

    /* Wait until the autonegotiation will be completed */

    do

    {

      timeout++;

    } while (!(ETH_ReadPHYRegister(PHYAddress, PHY_BSR) & PHY_AutoNego_Complete) && (timeout < (uint32_t)PHY_READ_TO));  

    /* Return ERROR in case of timeout */

    if(timeout == PHY_READ_TO)

    {

      return ETH_ERROR;

    }

    /* Reset Timeout counter */

    timeout = 0;

    

    /* Read the result of the autonegotiation */

    RegValue = ETH_ReadPHYRegister(PHYAddress, PHY_SR);

  

    /* Configure the MAC with the Duplex Mode fixed by the autonegotiation process */

    if((RegValue & PHY_Duplex_Status) != (uint32_t)RESET)

    {

      /* Set Ethernet duplex mode to FullDuplex following the autonegotiation */

      ETH_InitStruct->ETH_Mode = ETH_Mode_FullDuplex;

            

    }

    else

    {

      /* Set Ethernet duplex mode to HalfDuplex following the autonegotiation */

      ETH_InitStruct->ETH_Mode = ETH_Mode_HalfDuplex;           

    }

    /* Configure the MAC with the speed fixed by the autonegotiation process */

    if(RegValue & PHY_Speed_Status)

    {  

      /* Set Ethernet speed to 10M following the autonegotiation */    

      ETH_InitStruct->ETH_Speed = ETH_Speed_10M; 

    }

    else

    {   

      /* Set Ethernet speed to 100M following the autonegotiation */ 

      ETH_InitStruct->ETH_Speed = ETH_Speed_100M;      

    }    

  }

  else

  {

    if(!ETH_WritePHYRegister(PHYAddress, PHY_BCR, ((uint16_t)(ETH_InitStruct->ETH_Mode >> 3) |

                                                   (uint16_t)(ETH_InitStruct->ETH_Speed >> 1))))

    {

      /* Return ERROR in case of write timeout */

      return ETH_ERROR;

    }

    /* Delay to assure PHY configuration */

    _eth_delay_(PHY_ConfigDelay);

    

  }

thanks in advance....

rags
Associate II
Posted on June 24, 2014 at 09:07

Hi everyone, 

Can anyone help me out with this problem ASAP. I am still waiting.. I am not able to sort out this problem.

Regards,

Mikey

frankmeyer9
Associate II
Posted on June 24, 2014 at 11:19

Can anyone help me out with this problem ASAP. I am still waiting..

 

Not sure if this is helpful.

This is a public user forum, and you can hardly expect others to solve your problems for free.

Consider approaching ST or one of their consultants for help.

rags
Associate II
Posted on June 26, 2014 at 07:17

Hi,

I tried 4 to 5 times submitting my request for help regarding Ethernet Connectivity problem in Technical support ST. No one replied till now. Can any1 helpme out. 

thanks in advance...