[En-Nut-Discussion] NutNetIfConfig() blocks other threads

urbi Urban.Battaglia at ch.TRUMPF.com
Tue May 26 09:00:28 CEST 2009


Hello,

I have a Problem with initializing the ethernet without a physical
connection. In this case the function NutNetIfConfig() is blocking all other
threads. I have tryed to give different priority to the other threads, but
the function NutNetIfConfig() is still blocking.

The reason I found in the function EmacReset(uint32_t tmo) in the module
at91_emac.c. I am using a AT91SAM7x256 microcontroller. If no physical
connection is detected the function is waiting in a while loop. To give the
other threads CPU-time I add a NutSleep(0) statement in this while loop:

        while (--tmo) {
            if (phy_inw(NIC_PHY_BMSR) & NIC_PHY_BMSR_ANCOMPL) {
                break;
            }
            NutSleep(0);
        }

In this way all other threads are not blocked when no physical connation is
detected.
Has anyone else the same problem?

Regardes, Urban

-- 
View this message in context: http://www.nabble.com/NutNetIfConfig%28%29-blocks-other-threads-tp23717701p23717701.html
Sent from the MicroControllers - Ethernut mailing list archive at Nabble.com.




More information about the En-Nut-Discussion mailing list