RCM6700 - Ethernet port locks up after Late Collision event


I have a project which uses a RCM6700 in a somewhat unusual application where the Ethernet port is being used to communicate directly with a network switch which is located a few inches away on the same PCB which the RCM6700 module is mounted to. During testing I found that the RCM6700 network port would sometimes completely lock up, becoming unusable until a software reset was performed. All other functions of the RCM6700 continued as normal, just the Ethernet port failed.

With some debugging I found that when the port locked up the NBTSR register would read as 0x01, rather than 0x80 when it was functioning normally. This seems to indicate a Late Collision status. I’m not surprised that our network setup was generating these since the local Ethernet routing isn’t exactly as recommended. What did surprise me is that there seems to be no handling of this state in DMAEth100.lib or anywhere else in the 10.66 libraries that I could find. A single Late Collision event triggered by improper network cabling or a misbehaving device elsewhere on the network will cause the RCM6700 Ethernet port to become unusable.

I have added the following test for this condition in my software’s main event loop:

      if (BitRdPortI(NBTSR,0) == 1) {
   		WrPortI(NBTCR, NULL, 0x00);   // disable transmitter
   		WrPortI(NBRCR, NULL, 0x00);   // disable receiver
   		WrPortI(NBCR,  NULL, 0x11);   // purge FIFO's
  		WrPortI(NBTCR, NULL, 0x60);   // Enable transmitter, Start Tx FIFO 1/2 full
  		WrPortI(NBRCR, NULL, 0x86);   // Enable receiver, fast FIFO, accept b'cast,

This seems to fix the problem. I would recommend updating DMAEth100.lib to better handle this condition.