2014-06-14 03:19 AM
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-problem2014-06-14 09:14 AM
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.
2014-06-15 11:57 PM
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....2014-06-16 05:53 AM
I'm not familiar with your board design or component choices.
2014-06-18 02:53 AM
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....2014-06-24 12:07 AM
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,Mikey2014-06-24 02:19 AM
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.
2014-06-25 10:17 PM
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...