[En-Nut-Discussion] How to make "Ethernut Device registration" more save??

Dominik Schröder dominik.schroeder at bh-informativ.de
Thu Aug 12 18:03:30 CEST 2010


Ah ok.

I found this code in \nut\arch\arm\dev\at91_emac.c:

/* Handle auto negotiation if configured. */
    phyval = phy_inw(NIC_PHY_BMCR);
    if (phyval & NIC_PHY_BMCR_ANEGENA) {
        /* Wait for auto negotiation completed. */
        phy_inw(NIC_PHY_BMSR);  /* Discard previously latched status. */
        while (--tmo) {
            if (phy_inw(NIC_PHY_BMSR) & NIC_PHY_BMSR_ANCOMPL) {
                break;
            }
        }
        /* Return error on link timeout. */
        if (tmo == 0) {
            outr(EMAC_NCR, inr(EMAC_NCR) & ~EMAC_MPE);
            return -1;
        }

Is this the code "problem code"? I think there will be an Error in case of
an Timeout... ??
But it seems not to work... :-(
Anyone an idea how to solve this problem?

Best regards

Dominik



-----Ursprüngliche Nachricht-----
Von: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] Im Auftrag von Thiago A. Corrêa
Gesendet: Donnerstag, 12. August 2010 17:52
An: Ethernut User Chat (English)
Betreff: Re: [En-Nut-Discussion] How to make "Ethernut Device registration"
more save??

Hi,

On Thu, Aug 12, 2010 at 11:19 AM, Dominik Schröder
<dominik.schroeder at bh-informativ.de> wrote:
>
> My problem is, when I disconnect the Ethernet cable and then put on the
> system, the hole system seems to hang of. I don`t get any debug prompts on
> UART. After some time my external Watchdog forces the system to reset and
so
> on and so on...
>
> If the system starts with an connected Ethernet cable, everything works
> fine.
>
> Is there anybody how knows an solution for this?
>

I belive that's a known issue. During the EMAC initialization,
ethernut does the link speed negotioation and doesn't return until
it's complete.

To fix this issue, we need to rewrite the initialization of the
EMAC/Phy in the network driver. I'm not aware of a work around at the
moment.

Kind Regards,
    Thiago A. Correa
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion



More information about the En-Nut-Discussion mailing list