s32k322 EMAC RMII issue

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

s32k322 EMAC RMII issue

160 Views
YongxiangLi
Contributor I

Hi,

  We are using the NXP S32K322 MCU and experiencing an Ethernet reception issue: TX (transmission) works normally, but RX (reception) does not function. On the hardware side, the RMII interface is directly connected to an Ethernet switch, and we have verified that the PCB trace length matching and impedance control meet the design requirements. For power sequencing, we currently ensure manually that the switch completes its power-up before the S32K322.
During testing, we have the switch send ARP packets and have measured the RX-related signal waveforms with an oscilloscope, all of which appear correct. However, the S32K322 EMAC does not enter the receive interrupt (the same waveforms are successfully received on another ECU platform). We have also checked the EMAC receive and error counters in the registers, and both read as zero. All clock frequency configurations have been confirmed to be correct. Please help provide additional troubleshooting ideas or suggestions.
 
Best regards
Yongxiang Li
Tags (2)
0 Kudos
Reply
4 Replies

121 Views
PavelL
NXP Employee
NXP Employee

Hello @YongxiangLi ,

A few areas look worth checking first. Since TX works but both the RX packet counters and RX error counters remain at 0, I would currently suspect that the EMAC does not recognize valid RMII receive activity at all, rather than receiving frames and dropping them later.
 
The most important checks would be:
 
1) RMII reference clock timing during initialization
Please verify that the external 50 MHz RMII reference clock from the switch is already present and stable at the S32K322 pin before the EMAC/pin/clock initialization is executed. Very likely, you will need to add small delay, as it is recommended on S32K3-T-BOX. Please notice also the very first row in code snippet below:
PavelL_0-1781082817961.png

 

2) RMII clock configuration inside the MCU
For S32K3 RMII, the MAC uses the 50 MHz RMII reference clock on EMAC_MII_RMII_TX_CLK, while the external RX_CLK pin is not used in RMII mode. However, the internal EMAC RX/TX clocks still need to be configured correctly (typically 25 MHz for 100 Mbps, derived from the 50 MHz RMII reference clock). Please double-check the EMAC clock mux/divider settings.

 

3) RMII mode selection

Please confirm that the gmac driver (for EMAC peripheral) is really configured for RMII mode (not MII) and that this selection is done early enough during initialization.

 

4) Switch-side RMII mode
Because your MAC is connected directly to a switch port rather than to a discrete PHY, please also verify that the switch port is truly configured for RMII/rev-RMII operation and is driving the correct 50 MHz reference clock toward the MCU.

 

5) Alternatively, you may compare your project with one of my S32K344 EMAC lwIP projects

S32K Examples

 
To help narrow this down, could you please share:
- What version of S32K3 RTD driver do you use?
- Could you share your project in minimalistic version or mex file at least? 
 

Best regards,

Pavel

0 Kudos
Reply

117 Views
YongxiangLi
Contributor I

Hi @PavelL ,

Thanks for your reply. We have check some points provided.

  1. The MCU is powered on only after the switch is fully up and running (confirmed to be communicating with other ports). We added the delay shown in the figure, but it didn't help.
  2. We checked the clock and reconfigured it, yet the RX counter still shows no new counts.
  3. RMII mode is selected in the peripheral config.
  4. The switch correctly receives and forwards RMII frames from the TX direction to other ports, so the switch config appears correct. We also scoped the TXCLK provide by switch and MCU RX0/RX1 signals, and the waveforms look fine — no obvious issue with frames from the switch.
  5. We are cross-checking against the reference example.
We are on RTD 6.0.0. The test project is attached for verification (apologies in advance for any messy code — this is test firmware).
 
Best regards
Yongxiang Li
0 Kudos
Reply

51 Views
PavelL
NXP Employee
NXP Employee

Hello @YongxiangLi ,

I reviewed your project with big attention to details. I can't see any reason why Rx doesn't work for you. There are small things which can be tuned, but they are so marginal.

What VDD_HV_B do you use?

As a diagnostic step, you may also try enabling promiscuous mode in the GMAC driver.
This will allow the MAC to accept all incoming frames regardless of the destination MAC address filtering, which can help determine whether the issue is related to frame filtering or whether the RX path is not working at a lower level.
If enabling promiscuous mode does not change the behavior and the RX counters still remain at zero, then the issue is more likely below the packet filtering level (for example RMII clocking, RX path initialization, or DMA/descriptor handling).

As another useful debug step, I would recommend stepping back and starting from the standard InternalLoopback example, adapting it to your hardware platform.

First, please verify that the InternalLoopback example works correctly on your board. This helps confirm that the basic GMAC initialization, descriptor handling, buffer configuration, and software flow are working as expected on S32K322.

After that, you can uncheck the internal loopback mode and use the same project as a minimal baseline for communication with the external switch. In other words, keep the example as close as possible to the working reference design and test frame transmission and reception again.

This approach may help isolate whether the issue is related to the hardware interface to the switch (for example RMII timing/clocking) or whether it is caused by some difference in the higher-level software integration of the current project.

Best regards,

Pavel

0 Kudos
Reply

6 Views
YongxiangLi
Contributor I

Hi @PavelL 

Thank you for your patient support. We will continue the investigation over the weekend as per your suggestions and get back to you by next Monday or Tuesday.

Best regards

Yongxiang Li

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2379246%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Es32k322%20EMAC%20RMII%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2379246%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3E%26nbsp%3B%20We%3C%2FSPAN%3E%20%3CSPAN%3Eare%3C%2FSPAN%3E%20%3CSPAN%3Eusing%3C%2FSPAN%3E%20%3CSPAN%3Ethe%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22%22%3E%3CSPAN%3ENXP%3C%2FSPAN%3E%20%3CSPAN%3ES32K322%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3CSPAN%3EMCU%3C%2FSPAN%3E%20%3CSPAN%3Eand%3C%2FSPAN%3E%20%3CSPAN%3Eexperiencing%3C%2FSPAN%3E%20%3CSPAN%3Ean%3C%2FSPAN%3E%20%3CSPAN%3EEthernet%3C%2FSPAN%3E%20%3CSPAN%3Ereception%3C%2FSPAN%3E%20%3CSPAN%3Eissue%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22%22%3E%3CSPAN%3ETX%3C%2FSPAN%3E%20%3CSPAN%3E(transmission)%3C%2FSPAN%3E%20%3CSPAN%3Eworks%3C%2FSPAN%3E%20%3CSPAN%3Enormally%2C%3C%2FSPAN%3E%20%3CSPAN%3Ebut%3C%2FSPAN%3E%20%3CSPAN%3ERX%3C%2FSPAN%3E%20%3CSPAN%3E(reception)%3C%2FSPAN%3E%20%3CSPAN%3Edoes%3C%2FSPAN%3E%20%3CSPAN%3Enot%3C%2FSPAN%3E%20%3CSPAN%3Efunction%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%20%3CSPAN%3EOn%3C%2FSPAN%3E%20%3CSPAN%3Ethe%3C%2FSPAN%3E%20%3CSPAN%3Ehardware%3C%2FSPAN%3E%20%3CSPAN%3Eside%2C%3C%2FSPAN%3E%20%3CSPAN%3Ethe%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22%22%3E%3CSPAN%3ERMII%3C%2FSPAN%3E%20%3CSPAN%3Einterface%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3CSPAN%3Eis%3C%2FSPAN%3E%20%3CSPAN%3Edirectly%3C%2FSPAN%3E%20%3CSPAN%3Econnected%3C%2FSPAN%3E%20%3CSPAN%3Eto%3C%2FSPAN%3E%20%3CSPAN%3Ean%3C%2FSPAN%3E%20%3CSPAN%3EEthernet%3C%2FSPAN%3E%20%3CSPAN%3Eswitch%2C%3C%2FSPAN%3E%20%3CSPAN%3Eand%3C%2FSPAN%3E%20%3CSPAN%3Ewe%3C%2FSPAN%3E%20%3CSPAN%3Ehave%3C%2FSPAN%3E%20%3CSPAN%3Everified%3C%2FSPAN%3E%20%3CSPAN%3Ethat%3C%2FSPAN%3E%20%3CSPAN%3Ethe%3C%2FSPAN%3E%20%3CSPAN%3EPCB%3C%2FSPAN%3E%20%3CSPAN%3Etrace%3C%2FSPAN%3E%20%3CSPAN%3Elength%3C%2FSPAN%3E%20%3CSPAN%3Ematching%3C%2FSPAN%3E%20%3CSPAN%3Eand%3C%2FSPAN%3E%20%3CSPAN%3Eimpedance%3C%2FSPAN%3E%20%3CSPAN%3Econtrol%3C%2FSPAN%3E%20%3CSPAN%3Emeet%3C%2FSPAN%3E%20%3CSPAN%3Ethe%3C%2FSPAN%3E%20%3CSPAN%3Edesign%3C%2FSPAN%3E%20%3CSPAN%3Erequirements.%3C%2FSPAN%3E%20%3CSPAN%3EFor%3C%2FSPAN%3E%20%3CSPAN%3Epower%3C%2FSPAN%3E%20%3CSPAN%3Esequencing%2C%3C%2FSPAN%3E%20%3CSPAN%3Ewe%3C%2FSPAN%3E%20%3CSPAN%3Ecurrently%3C%2FSPAN%3E%20%3CSPAN%3Eensure%3C%2FSPAN%3E%20%3CSPAN%3Emanually%3C%2FSPAN%3E%20%3CSPAN%3Ethat%3C%2FSPAN%3E%20%3CSPAN%3Ethe%3C%2FSPAN%3E%20%3CSPAN%3Eswitch%3C%2FSPAN%3E%20%3CSPAN%3Ecompletes%3C%2FSPAN%3E%20%3CSPAN%3Eits%3C%2FSPAN%3E%20%3CSPAN%3Epower-up%3C%2FSPAN%3E%20%3CSPAN%3Ebefore%3C%2FSPAN%3E%20%3CSPAN%3Ethe%3C%2FSPAN%3E%20%3CSPAN%3ES32K322.%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3EDuring%3C%2FSPAN%3E%20%3CSPAN%3Etesting%2C%3C%2FSPAN%3E%20%3CSPAN%3Ewe%3C%2FSPAN%3E%20%3CSPAN%3Ehave%3C%2FSPAN%3E%20%3CSPAN%3Ethe%3C%2FSPAN%3E%20%3CSPAN%3Eswitch%3C%2FSPAN%3E%20%3CSPAN%3Esend%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22%22%3E%3CSPAN%3EARP%3C%2FSPAN%3E%20%3CSPAN%3Epackets%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3CSPAN%3Eand%3C%2FSPAN%3E%20%3CSPAN%3Ehave%3C%2FSPAN%3E%20%3CSPAN%3Emeasured%3C%2FSPAN%3E%20%3CSPAN%3Ethe%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22%22%3E%3CSPAN%3ERX-related%3C%2FSPAN%3E%20%3CSPAN%3Esignal%3C%2FSPAN%3E%20%3CSPAN%3Ewaveforms%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3CSPAN%3Ewith%3C%2FSPAN%3E%20%3CSPAN%3Ean%3C%2FSPAN%3E%20%3CSPAN%3Eoscilloscope%2C%3C%2FSPAN%3E%20%3CSPAN%3Eall%3C%2FSPAN%3E%20%3CSPAN%3Eof%3C%2FSPAN%3E%20%3CSPAN%3Ewhich%3C%2FSPAN%3E%20%3CSPAN%3Eappear%3C%2FSPAN%3E%20%3CSPAN%3Ecorrect.%3C%2FSPAN%3E%20%3CSPAN%3EHowever%2C%3C%2FSPAN%3E%20%3CSPAN%3Ethe%3C%2FSPAN%3E%20%3CSPAN%3ES32K322%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22%22%3E%3CSPAN%3EEMAC%3C%2FSPAN%3E%20%3CSPAN%3Edoes%3C%2FSPAN%3E%20%3CSPAN%3Enot%3C%2FSPAN%3E%20%3CSPAN%3Eenter%3C%2FSPAN%3E%20%3CSPAN%3Ethe%3C%2FSPAN%3E%20%3CSPAN%3Ereceive%3C%2FSPAN%3E%20%3CSPAN%3Einterrupt%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3CSPAN%3E(the%3C%2FSPAN%3E%20%3CSPAN%3Esame%3C%2FSPAN%3E%20%3CSPAN%3Ewaveforms%3C%2FSPAN%3E%20%3CSPAN%3Eare%3C%2FSPAN%3E%20%3CSPAN%3Esuccessfully%3C%2FSPAN%3E%20%3CSPAN%3Ereceived%3C%2FSPAN%3E%20%3CSPAN%3Eon%3C%2FSPAN%3E%20%3CSPAN%3Eanother%3C%2FSPAN%3E%20%3CSPAN%3EECU%3C%2FSPAN%3E%20%3CSPAN%3Eplatform).%3C%2FSPAN%3E%20%3CSPAN%3EWe%3C%2FSPAN%3E%20%3CSPAN%3Ehave%3C%2FSPAN%3E%20%3CSPAN%3Ealso%3C%2FSPAN%3E%20%3CSPAN%3Echecked%3C%2FSPAN%3E%20%3CSPAN%3Ethe%3C%2FSPAN%3E%20%3CSPAN%3EEMAC%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22%22%3E%3CSPAN%3Ereceive%3C%2FSPAN%3E%20%3CSPAN%3Eand%3C%2FSPAN%3E%20%3CSPAN%3Eerror%3C%2FSPAN%3E%20%3CSPAN%3Ecounters%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3CSPAN%3Ein%3C%2FSPAN%3E%20%3CSPAN%3Ethe%3C%2FSPAN%3E%20%3CSPAN%3Eregisters%2C%3C%2FSPAN%3E%20%3CSPAN%3Eand%3C%2FSPAN%3E%20%3CSPAN%3Eboth%3C%2FSPAN%3E%20%3CSPAN%3Eread%3C%2FSPAN%3E%20%3CSPAN%3Eas%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22%22%3E%3CSPAN%3Ezero%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%20%3CSPAN%3EAll%3C%2FSPAN%3E%20%3CSPAN%3Eclock%3C%2FSPAN%3E%20%3CSPAN%3Efrequency%3C%2FSPAN%3E%20%3CSPAN%3Econfigurations%3C%2FSPAN%3E%20%3CSPAN%3Ehave%3C%2FSPAN%3E%20%3CSPAN%3Ebeen%3C%2FSPAN%3E%20%3CSPAN%3Econfirmed%3C%2FSPAN%3E%20%3CSPAN%3Eto%3C%2FSPAN%3E%20%3CSPAN%3Ebe%3C%2FSPAN%3E%20%3CSPAN%3Ecorrect.%3C%2FSPAN%3E%20%3CSPAN%3EPlease%3C%2FSPAN%3E%20%3CSPAN%3Ehelp%3C%2FSPAN%3E%20%3CSPAN%3Eprovide%3C%2FSPAN%3E%20%3CSPAN%3Eadditional%3C%2FSPAN%3E%20%3CSPAN%3Etroubleshooting%3C%2FSPAN%3E%20%3CSPAN%3Eideas%3C%2FSPAN%3E%20%3CSPAN%3Eor%3C%2FSPAN%3E%20%3CSPAN%3Esuggestions.%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3EBest%20regards%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3EYongxiang%20Li%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2379458%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k322%20EMAC%20RMII%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2379458%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F233505%22%20target%3D%22_blank%22%3E%40PavelL%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3EThanks%20for%20your%20reply.%20We%20have%20check%20some%20points%20provided.%3C%2FP%3E%3COL%3E%3CLI%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3EThe%20MCU%20is%20powered%20on%20only%20after%20the%20switch%20is%20fully%20up%20and%20running%20(confirmed%20to%20be%20communicating%20with%20other%20ports).%20We%20added%20the%20delay%20shown%20in%20the%20figure%2C%20but%20it%20didn't%20help.%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLI%3E%3CLI%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3EWe%20checked%20the%20clock%20and%20reconfigured%20it%2C%20yet%20the%20RX%20counter%20still%20shows%20no%20new%20counts.%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLI%3E%3CLI%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3ERMII%20mode%20is%20selected%20in%20the%20peripheral%20config.%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLI%3E%3CLI%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3EThe%20switch%20correctly%20receives%20and%20forwards%20RMII%20frames%20from%20the%20TX%20direction%20to%20other%20ports%2C%20so%20the%20switch%20config%20appears%20correct.%20We%20also%20scoped%20the%20TXCLK%20provide%20by%20switch%20and%20MCU%20RX0%2FRX1%20signals%2C%20and%20the%20waveforms%20look%20fine%20%E2%80%94%20no%20obvious%20issue%20with%20frames%20from%20the%20switch.%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLI%3E%3CLI%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3EWe%20are%20cross-checking%20against%20the%20reference%20example.%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLI%3E%3C%2FOL%3E%3CDIV%20class%3D%22%22%3EWe%20are%20on%20RTD%206.0.0.%20The%20test%20project%20is%20attached%20for%20verification%20(apologies%20in%20advance%20for%20any%20messy%20code%20%E2%80%94%20this%20is%20test%20firmware).%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3EBest%20regards%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3EYongxiang%20Li%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2379420%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k322%20EMAC%20RMII%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2379420%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F263626%22%20target%3D%22_blank%22%3E%40YongxiangLi%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CSPAN%3EA%20few%20areas%20look%20worth%20checking%20first.%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3ESince%20TX%20works%20but%20both%20the%20RX%20packet%20counters%20and%20RX%20error%20counters%20remain%20at%200%2C%20I%20would%20currently%20suspect%20that%20the%20EMAC%20does%20not%20recognize%20valid%20RMII%20receive%20activity%20at%20all%2C%20rather%20than%20receiving%20frames%20and%20dropping%20them%20later.%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CSPAN%3EThe%20most%20important%20checks%20would%20be%3A%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CSPAN%3E1)%20RMII%20reference%20clock%20timing%20during%20initialization%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CSPAN%3EPlease%20verify%20that%20the%20external%2050%20MHz%20RMII%20reference%20clock%20from%20the%20switch%20is%20already%20present%20and%20stable%20at%20the%20S32K322%20pin%20before%20the%20EMAC%2Fpin%2Fclock%20initialization%20is%20executed.%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BVery%20likely%2C%20you%20will%20need%20to%20add%20small%20delay%2C%20as%20it%20is%20recommended%20on%20S32K3-T-BOX.%20Please%20notice%20also%20the%20very%20first%20row%20in%20code%20snippet%20below%3A%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22PavelL_0-1781082817961.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22PavelL_0-1781082817961.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22PavelL_0-1781082817961.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F388501i6782A97DE023CC68%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22PavelL_0-1781082817961.png%22%20alt%3D%22PavelL_0-1781082817961.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3C%2FDIV%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CSPAN%3E2)%20RMII%20clock%20configuration%20inside%20the%20MCU%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CSPAN%3EFor%20S32K3%20RMII%2C%20the%20MAC%20uses%20the%2050%20MHz%20RMII%20reference%20clock%20on%20EMAC_MII_RMII_TX_CLK%2C%20while%20the%20external%20RX_CLK%20pin%20is%20not%20used%20in%20RMII%20mode.%20However%2C%20the%20internal%20EMAC%20RX%2FTX%20clocks%20still%20need%20to%20be%20configured%20correctly%20(typically%2025%20MHz%20for%20100%20Mbps%2C%20derived%20from%20the%2050%20MHz%20RMII%20reference%20clock).%20Please%20double-check%20the%20EMAC%20clock%20mux%2Fdivider%20settings.%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2FRMII-clock-for-S32K3%2Ftd-p%2F2053530%22%20target%3D%22_blank%22%3ERMII%20clock%20for%20S32K3%3C%2FA%3E%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSPAN%3E3)%20RMII%20mode%20selection%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CSPAN%3EPlease%20confirm%20that%20the%20gmac%20driver%20(for%20EMAC%20peripheral)%20is%20really%20configured%20for%20RMII%20mode%20(not%20MII)%20and%20that%20this%20selection%20is%20done%20early%20enough%20during%20initialization.%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CSPAN%3E4)%20Switch-side%20RMII%20mode%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CSPAN%3EBecause%20your%20MAC%20is%20connected%20directly%20to%20a%20switch%20port%20rather%20than%20to%20a%20discrete%20PHY%2C%20please%20also%20verify%20that%20the%20switch%20port%20is%20truly%20configured%20for%20RMII%2Frev-RMII%20operation%20and%20is%20driving%20the%20correct%2050%20MHz%20reference%20clock%20toward%20the%20MCU.%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E5)%20Alternatively%2C%20you%20may%20compare%20your%20project%20with%20one%20of%20my%20S32K344%20EMAC%20lwIP%20projects%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FS32K-Examples%2Fta-p%2F1108990%22%20target%3D%22_blank%22%3ES32K%20Examples%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CSPAN%3ETo%20help%20narrow%20this%20down%2C%20could%20you%20please%20share%3A%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CSPAN%3E-%20What%20version%20of%20S32K3%20RTD%20driver%20do%20you%20use%3F%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CSPAN%3E-%20Could%20you%20share%20your%20project%20in%20minimalistic%20version%20or%20mex%20file%20at%20least%3F%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3EBest%20regards%2C%3C%2FP%3E%0A%3CP%3EPavel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2380198%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k322%20EMAC%20RMII%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2380198%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F263626%22%20target%3D%22_blank%22%3E%40YongxiangLi%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3EI%20reviewed%20your%20project%20with%20big%20attention%20to%20details.%20I%20can't%20see%20any%20reason%20why%20Rx%20doesn't%20work%20for%20you.%20There%20are%20small%20things%20which%20can%20be%20tuned%2C%20but%20they%20are%20so%20marginal.%3C%2FP%3E%0A%3CP%3EWhat%20VDD_HV_B%20do%20you%20use%3F%3C%2FP%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CSPAN%3EAs%20a%20diagnostic%20step%2C%20you%20may%20also%20try%20enabling%20promiscuous%20mode%20in%20the%20GMAC%20driver.%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CSPAN%3EThis%20will%20allow%20the%20MAC%20to%20accept%20all%20incoming%20frames%20regardless%20of%20the%20destination%20MAC%20address%20filtering%2C%20which%20can%20help%20determine%20whether%20the%20issue%20is%20related%20to%20frame%20filtering%20or%20whether%20the%20RX%20path%20is%20not%20working%20at%20a%20lower%20level.%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CSPAN%3EIf%20enabling%20promiscuous%20mode%20does%20not%20change%20the%20behavior%20and%20the%20RX%20counters%20still%20remain%20at%20zero%2C%20then%20the%20issue%20is%20more%20likely%20below%20the%20packet%20filtering%20level%20(for%20example%20RMII%20clocking%2C%20RX%20path%20initialization%2C%20or%20DMA%2Fdescriptor%20handling).%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CP%3E%3CLI-WRAPPER%3E%3C%2FLI-WRAPPER%3E%3C%2FP%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CSPAN%3EAs%20another%20useful%20debug%20step%2C%20I%20would%20recommend%20stepping%20back%20and%20starting%20from%20the%20standard%20InternalLoopback%20example%2C%20adapting%20it%20to%20your%20hardware%20platform.%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%3EFirst%2C%20please%20verify%20that%20the%20InternalLoopback%20example%20works%20correctly%20on%20your%20board.%20This%20helps%20confirm%20that%20the%20basic%20GMAC%20initialization%2C%20descriptor%20handling%2C%20buffer%20configuration%2C%20and%20software%20flow%20are%20working%20as%20expected%20on%20S32K322.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CSPAN%3EAfter%20that%2C%20you%20can%20uncheck%20the%20internal%20loopback%20mode%20and%20use%20the%20same%20project%20as%20a%20minimal%20baseline%20for%20communication%20with%20the%20external%20switch.%20In%20other%20words%2C%20keep%20the%20example%20as%20close%20as%20possible%20to%20the%20working%20reference%20design%20and%20test%20frame%20transmission%20and%20reception%20again.%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%3EThis%20approach%20may%20help%20isolate%20whether%20the%20issue%20is%20related%20to%20the%20hardware%20interface%20to%20the%20switch%20(for%20example%20RMII%20timing%2Fclocking)%20or%20whether%20it%20is%20caused%20by%20some%20difference%20in%20the%20higher-level%20software%20integration%20of%20the%20current%20project.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CLI-WRAPPER%3E%3C%2FLI-WRAPPER%3E%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3C%2FP%3E%0A%3CP%3EPavel%3C%2FP%3E%3C%2FLINGO-BODY%3E