µTasker Forum

µTasker Forum => NXPTM M522XX, KINETIS and i.MX RT => Topic started by: izzz on March 21, 2011, 05:04:03 PM

Title: Problems with uTasker & Ethernet/PHY in a MCF52235
Post by: izzz on March 21, 2011, 05:04:03 PM
I'm using a MCF52235 microcontroller with uTasker as OS. I have a project with Ethernet support but I have problems when using it.

My project needs Ethernet because is partly based on a Website but, for example, if I turn on my board without Ethernet cable connected, my program gets stuck. I have seen that it stops in a while-loop waiting for a bit to set. That happens inside the fnMIIread function where the program waits until the MII flag of EIR is set. So it gets trapped ad-infinitum in this while-loop. I need to avoid it. Even if there're no Ethernet, my program can't get stuck!.

When the Ethernet cable is connected, there're no problems, it works fine. Are there a way to solve or avoid this behaviour?
Title: Re: Problems with uTasker & Ethernet/PHY in a MCF52235
Post by: mark on March 21, 2011, 11:06:03 PM
Hi

Whether the Ethernet cable is connected or not shouldn't affect the read of the MII. I have never heard of such a problem before with any M522XX projects.

The polling of the MII bit in the EIR register should be very short, just waiting for the management interface transfer to complete:

while (!(EIR & MII)) {};                                             // wait until the read has completed

Is it possible that the MII module clock has been disabled somehow? Check that the module is powered up when thsi happens [CDEPHY in PPMRH]

Regards

Mark