Another version of CF Lite, another problem arises...

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Another version of CF Lite, another problem arises...

2,123 Views
vier_kuifjes
Senior Contributor I
Yesterday I noticed that a new version of Coldfire Lite is available for download (version 3.2), so I promptly downloaded it and started trying it out with my current application. There seems to be quite a bit of code change in the network related parts of the program. On the positive side, the startup time is now much shorter compared to CFL version 3.0 when using DHCP.

But I noticed some bad stuff too (well, at least one item...) :
When the ethernet cable is disconnected, the CPU resets itself. This means the application is reset also and loses all of it's data. And this is something I cannot live with.

I found that the reset of the board is issued by the ephy_interrupt handler when it detects a link down. I was able to fix this by patching in the ephy_interrupt handler of CFL version 3.0, which worked. But the remaining issue is that all tasks stop working when the link is broken. I haven't figured out why that is yet, but I think this is unacceptable.

It looks like I'm going to have to stick with CFL 3.0 for now. Thanks to the information provided by bkatt, I just managed to fix all my DHCP-related problems (re-negotiating IP address after broken link returns active/becomes available...), but these fixes make no sense with CFL 3.2 if it resets the CPU when the link is broken.
Labels (1)
0 Kudos
6 Replies

550 Views
vier_kuifjes
Senior Contributor I
I found a work-around for my "big" problem, it's as simple as commenting out one single source code line.

In the file MCF52235_sysinit.c (I'm using the 5223x CPUs in my projects) there's a line that enables PHY interrupts:

Code:
/********************************************************************/
// Init ePHY
/********************************************************************/
void mcf5223x_ePHY_init(void)
{
 uint32 myctr, i;     //generic counter variable
 static uint16 mymrdata, mymwdata;   //temp variable for MII read/write data
   uint16 reg0=0;
:
:
:
 //turn on the EPHY - latches ANDIS in EPHY...note clocks not enabled yet.
 //MCF_EPHY_EPHYCTL0 |= MCF_EPHY_EPHYCTL0_EPHYIEN;  //FSL enable PHY interrupts
 MCF_EPHY_EPHYCTL0 |= MCF_EPHY_EPHYCTL0_EPHYEN;
 
By commenting out the line marked in red above, the PHY will no longer generate an interrupt when the network connection is lost and the application will keep running as if nothing happened (except that it has no network communication of course). There's no re-negotiation when the link returns, but that was also the case with Coldfire Lite 2.0 and 3.0. But that shouldn't be a problem as in most cases, when the link returns, it will probably be the same link as before (disconnect/reconnect cable or power-cycling switch/router).
0 Kudos

550 Views
DrSeuss
Contributor I
Sorry that this has caused you so much time.

We had many customers asking how to identify an active Ethernet connection. ePHY interrupt was added to show how to detect that a cable status change. Without knowing more about the end application we could not re-initialized tasks or recover the application so we just reset the MCU and started over.

You correctly identified that this reset can be prevented by disabling the ePHY interrupt.
0 Kudos

550 Views
vier_kuifjes
Senior Contributor I

What I find curious is that, when I remove the actual instruction that causes the software reset in the ePHY interrupt routine, all tasks seem to stop working when the interrupt routine is called.

 

It looks to me as if the routine was originally written to re-initialise the ePHY when the link got broken, but because of a problem with the tasks no longer working after the interrupt was called, this re-initialisation is conditionally compiled out and replaced by a soft reset.

 

Anyway, that's just what it appears like to me...

0 Kudos

550 Views
ak_mnpp
Contributor I

Hello!

I use a custom board with PoE and MCF52233 and Niche TCP/IP V3.2 patched by Marc. When I disable the Ethernet connector power is lostWhen I connect Ethernet jack power appears, but the link does not appear. If I apply a hardware reset, the link appears. How can I solve this problem?

Thank you!

0 Kudos

550 Views
vier_kuifjes
Senior Contributor I

This sounds a bit like a power-on reset problem to me. Does the processor start running when you reconnect the ethernet connector? If you have a serial port on your board, does it transmit anything?

0 Kudos

550 Views
ak_mnpp
Contributor I

Prior to performing a hard reset to the serial data is not transmitted. Monitoring by oscilloscope shows that the microcontroller continually restarts.

0 Kudos