Hello,
The RMII interface is used between port 3 of the switch, and the MPU. Ports 1 and 2 of the switch are attached to other Ethernet devices (differential signals, magnetics, etc.). The switch is the source of a 50MHz clock, and bits 6, and 7 of the gmii_sel register are set. All RMII pins of the MPU are configured properly. The switch does not implement the RX_ER output signal, so the MPU input is configured for an external pulldown.
From time to time frames observed on ports 1 ans 2 of the switch, and were supposed to be received by the MPU are lost. The code was instrumented to check for any discards/hardware errors on both sides. Neither the switch nor the MPU report any. As a part of troubleshooting a scope was connected to the RMII signals. It seems like frames are lost when there is a short CRS_DV glitch during preamble (see the attachment, green=CRS_DV, the other 2 are RXD0, RXD1). There is a suspicion that there is a problem detecting the start frame delimiter though according to the RM the glitch should not cause any problem. From 14.3.5.1 RMII Receive (RX):
The CPRMII can accept receive packets with shortened preambles, but 0x55 followed by a 0x5d is the
shortest preamble that will be recognized (1 preamble byte with the start of frame byte). At least one byte
of preamble with the start of frame indicator is required to begin a packet. An asserted RMII_CRS_DV
without at least a single correct preamble byte followed by the start of frame indicator will be ignored.
So far we could not find anything in the documentation that would explain why an incomplete (?) preamble may be a problem, or what to change in the EMAC configuration to avoid it.