Author Topic: mcf52259 FEC RXF ISR stops sometimes  (Read 3201 times)

Offline alager

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
mcf52259 FEC RXF ISR stops sometimes
« on: March 11, 2015, 05:13:23 PM »
We have a project where after some unknown event happens, the FEC stops triggering the RXF interrupt.  It could be minutes, could be days before the event happens.  Wiresharking hasn't shown anything suspicious. Tx is still working, in fact, our clue that there is a problem is that the device is refreshing its ARP table on its 20 minute boundary but doesn't listen to the response.
 
Things I've checked when this occurs:
EBERR is 0
RXF is 0
RXB is usually 1, but that mask is not set
ETHR_EN is 1
RDAR is 1
 
 
Also, not every device seems to do this.  Out of 100 devices probably 5-10 exhibit this behavior.
 
Any help in how to trouble shoot this would be great.
Thanks,
Aaron

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3069
    • View Profile
    • uTasker
Re: mcf52259 FEC RXF ISR stops sometimes
« Reply #1 on: March 11, 2015, 09:47:43 PM »
Hi Aaron

I recommend looking at the MIB counters in the EMAC since they may give some indication of what the problem could be; specifically the count of dropped frames.

Also check the buffer descriptors used by the receiver. See whether they have their "empty" bits set or not. If the SW hasn't read out reception data it will mean that the EMAC can't use them to save new frames to and so it will drop frames (without an Rx Frame interrupt but there will be a counter in the MIBs that will record this).

Also check the MAC, multicast and other filter settings to ensure that they haven't been overwritten to reject all receptions.

Check such things with a unit that is operating normally and compare when it stops and you may find a difference that explains something.

Good luck

Regards

Mark

P.S. I haven't heard of reception stopping forever but did have a case when the Tx wouldn't send any more. This turned out to a frame length being set with 0 - normally the Tx will pad a Tx frame to its minimum size of 60 bytes with zeros but a zero cound caused it to not send anything and cause the buffer descriptor to be left in a ready state but not sending.
Of course it is not normal to send zero length frames (which was the result of another problem due to sending frames from an interrupt routine but not protecting data) but I previousy didn't know that this would actually cause the tx to block.










Offline alager

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Re: mcf52259 FEC RXF ISR stops sometimes
« Reply #2 on: March 17, 2015, 06:59:20 PM »
Mark,

Thanks for the pointers.  Here are some screen shots showing the buffer descriptors and the FEC registers.  One, registers only, from "working" and a full CW screen shot for non-working.  From what I can see (if I'm reading this correctly), there are no dropped frames, and all the receive buffers have the E bit set, so they are empty. But I'm still not getting the interrupt.
If this shows any clues that I'm not seeing, that would be great to know.

Thanks,
Aaron
« Last Edit: March 17, 2015, 07:35:30 PM by alager »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3069
    • View Profile
    • uTasker
Re: mcf52259 FEC RXF ISR stops sometimes
« Reply #3 on: March 20, 2015, 03:58:45 PM »
Hi Aaron

All buffer descriptors look to be ready to accept data and there is no indication that the EMAC has had to drop a frame due to having no destination available for it. Furthermore you haven't seen any indication of the engine having a problem (indicating errors that could make it stall).

This would suggest that the EMAC is not receiving frames from the PHY so I would monitor the MII lines to check the activity which would either confirm or exclude this possibility. Maybe the error is at the PHY Rx rather than in the EMAC in the Coldfire (?)

You could also add some measures to attempt to recover (such as resetting the PHY or resetting the EMAC, or parts of it) when you detect that you are in the state. If something proves to be successful it may then help to close in on the part that can cause a difficulty.

Regards

Mark

Offline alager

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Re: mcf52259 FEC RXF ISR stops sometimes
« Reply #4 on: March 20, 2015, 05:03:18 PM »
Mark,

Thanks for the reply.  It turns out that the  issue was actually a bad solder joint on this unit.
Here is a link to the thread on freescale where I was working with Tom on this.
https://community.freescale.com/message/495639?et=watches.email.thread#495639

Although it turned out to be a hardware issue, through the investigation we did find an issue with the MII_SPEED setting, so I'm sure that will improve overall reliability in our products.

Aaron