[En-Nut-Discussion] Slow booting when ethernet cable is not plugged in
ennut at thezachariasgroup.com
ennut at thezachariasgroup.com
Fri Sep 7 05:25:16 CEST 2007
Paulo,
I changed EMAC_LINK_LOOPS from 1,000,000 (90 Seconds) to 50,000
(4.5 Seconds) and things work well.
I changed it in nut\arch\arm\dev\at91_emac.c . I didn't know it could
be done in the configurator.
If you use DHCP to obtain an IPAddress you might consider putting
that code in a separate thread similar to the stripped down code I've
included below.
This is especially useful after a power failure and the unit needs to
provide functionality immediately.
Please excuse the non-conforming coding style.
u_char ucNetworkStatus;
THREAD(EthernetConnectivity, arg)
{
u_char ucWaitingForTaskCompletion;
ucNetworkStatus = 0;
NutRegisterDevice(&DEV_ETHER, 0, 0); // Register Ethernet controller.
printf("\n\r Configure %s...", DEV_ETHER_NAME);
ucWaitingForTaskCompletion = 1;
while (ucWaitingForTaskCompletion)
{
if (NutDhcpIfConfig(DEV_ETHER_NAME, mac, 15000))
{
NutSleep(60000); // Wait 60 Seconds and try again
}
else // We were configured
{
ucNetworkStatus = 1;
ucWaitingForTaskCompletion = 0;
}
}
while (1)
{
NutSleep(6000000); //
}
}
Paulo Silva schrieb:
> I compiled ethernut and httpd app., for this board, and I saw
that, if I did not insert ethernet cable it does not boot, did you
find this too or Is it a bug in my software or hardware? As this is
a test I am using version 4.3.3 alpha.
>
More information about the En-Nut-Discussion
mailing list