[En-Nut-Discussion] detecting an unplugged network cable

Ulrich Prinz uprinz2 at netscape.net
Wed Nov 17 23:09:57 CET 2010


Hi Jasmin!

Am 12.11.2010 15:46, schrieb elbric0:
> Hi Ulrich,
>
>> But I am not sure if the whole registration is done correctly the
>> way you did it. NutRegisterDevice() should not fail, cable
>> connected or not. It initializes the hardware and does basic
>> setup.
>
> I am using Ethernut 4.8.7 on an Olimex SAM7-EX256 board. I observe
> the same behavior with the httpd example and with my own project. In
> both cases, NutRegisterDevice() fails after a little more than three
> minutes.
>
>
> Your plan to handle disconnection with EmacCtl and events seems good.
> I guess it involves moving the auto negotiation to a separate thread?
> Or maybe it's already done in a newer code version?
>
The auto negotiation is done by the PHY itself. What Nut/OS misses is a 
proper handling of these events like disconnecting, connecting and so 
on. So what I plan to do, and have partly done, is to get the emac 
driver request more information from the PHY and react accordingly.

The basic idea is to have some global available events that are 
triggered if such a thing happens. For some applications it might be 
enough to have the connect event handled by the emac driver. For others 
some more needs to be done and they need to be informed about the change.

And making some events or handles available cost only a few bytes of RAM 
without blowing up the code to much.

But my original intention to modify the code was to integrate the emac 
driver for STM32 controllers and I just took the at91_emac code for 
reference of the Nut/OS side of the software. Then I stumbled over the 
PHY code in that driver and here some problem reports popped up the same 
time...
And last not least I moved from one room to another and have to 
reassemble my development system now...

It all comes together, but I am working on it. Hope you all don't need 
that new driver tomorrow :)

Best regards
Ulrich



More information about the En-Nut-Discussion mailing list