Cable unplugged

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Cable unplugged

Trampas Stern
This is not directly LWIP related but I was wondering if there was a way to detect when cable is unplugged through a GMII/RMII interface? 

Specifically my hardware does not have the carrier sense pin connected to microcontroller and I was wondering if there was a way to poll the GMII/RMII registers to see when a cable is connected or not? 

I did not see anything in the documentation right off but thought I would ask, as maybe I am not looking at the correct registers. 

Thanks
Trampas

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Cable unplugged

lwip-users mailing list
On 11.12.2019 23:55, Trampas Stern wrote:
> This is not directly LWIP related but I was wondering if there was a way to
> detect when cable is unplugged through a GMII/RMII interface?
basic status register (index 1), bit 2.

>
> Specifically my hardware does not have the carrier sense pin connected to
> microcontroller and I was wondering if there was a way to poll the GMII/RMII
> registers to see when a cable is connected or not?
>
> I did not see anything in the documentation right off but thought I would ask,
> as maybe I am not looking at the correct registers.
>
> Thanks
> Trampas
>
> _______________________________________________
> lwip-users mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>

---
  Regards, Sergey



_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Cable unplugged

Trampas Stern
Thanks I was wondering about the "Link Status" but was not sure if you had to try and auto negotiate first. 

Thanks again
Trampas

On Wed, Dec 11, 2019 at 5:14 PM Sergey A. Borshch via Mailing list for lwIP users <[hidden email]> wrote:
On 11.12.2019 23:55, Trampas Stern wrote:
> This is not directly LWIP related but I was wondering if there was a way to
> detect when cable is unplugged through a GMII/RMII interface?
basic status register (index 1), bit 2.
>
> Specifically my hardware does not have the carrier sense pin connected to
> microcontroller and I was wondering if there was a way to poll the GMII/RMII
> registers to see when a cable is connected or not?
>
> I did not see anything in the documentation right off but thought I would ask,
> as maybe I am not looking at the correct registers.
>
> Thanks
> Trampas
>
> _______________________________________________
> lwip-users mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>

---
  Regards, Sergey



_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Cable unplugged

Stephen Cowell
Top posting is a crime!

Here's how I do it in Atmel-ese... no OS, in the main while(1) loop:
<>
         modCount++;
...
         if (!(modCount%0x00080000))// check Ethernet PHY once in a
while to make sure we're connected
         {
             if (ethernetOK != ERR_OK)// only worried about initial try
for connection here.
             {
                 // test for Ethernet OK
                 ethernetOK = init_ethernet();// put skips in place for
second time through
             }
             else // this handles unplug notification... replug should
be automatic after first successful init_ethernet()
             {
                 static bool alarmLamps = false;

                 gmac_enable_management(GMAC, true);    // this is
necessary for direct access
                 gmac_phy_read(GMAC, BOARD_GMAC_PHY_ADDR, GMII_BMSR,
&ul_stat1);// get status from PHY
                 gmac_enable_management(GMAC, false);  // give PHY back
to GMAC

                 if ((ul_stat1 & GMII_LINK_STATUS) == 0)// We are
unplugged, or something
                 {// do something!  blink lamps etc
</>





On 12/11/2019 5:07 PM, Trampas Stern wrote:

> Thanks I was wondering about the "Link Status" but was not sure if you
> had to try and auto negotiate first.
>
> Thanks again
> Trampas
>
> On Wed, Dec 11, 2019 at 5:14 PM Sergey A. Borshch via Mailing list for
> lwIP users <[hidden email] <mailto:[hidden email]>> wrote:
>
>     On 11.12.2019 23:55, Trampas Stern wrote:
>     > This is not directly LWIP related but I was wondering if there
>     was a way to
>     > detect when cable is unplugged through a GMII/RMII interface?
>     basic status register (index 1), bit 2.
>     >
>     > Specifically my hardware does not have the carrier sense pin
>     connected to
>     > microcontroller and I was wondering if there was a way to poll
>     the GMII/RMII
>     > registers to see when a cable is connected or not?
>     >
>     > I did not see anything in the documentation right off but
>     thought I would ask,
>     > as maybe I am not looking at the correct registers.
>     >
>     > Thanks
>     > Trampas
>     >
>     > _______________________________________________
>     > lwip-users mailing list
>     > [hidden email] <mailto:[hidden email]>
>     > https://lists.nongnu.org/mailman/listinfo/lwip-users
>     >
>
>     ---
>       Regards, Sergey
>
>
>
>     _______________________________________________
>     lwip-users mailing list
>     [hidden email] <mailto:[hidden email]>
>     https://lists.nongnu.org/mailman/listinfo/lwip-users
>
>
> _______________________________________________
> lwip-users mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/lwip-users


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users