S32K3_EMAC_RMII_why the RXCLK is 25Mhz

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

S32K3_EMAC_RMII_why the RXCLK is 25Mhz

Jump to solution
2,379 Views
wuxianlong
Senior Contributor I

Hi, NXP

When using the RMII mode of the EMAC module in S32K3x4, why is it necessary to configure MII_RX_CLK to 25MHz?

image.png

If configured to 50MHz, the data will be abnormal. Is there any more information about this description? I didn't find much description in the S32K3 RM manual. Why is MII_RX_CLK 25MHz in both MII and RMII modes? Is there any special operating principle?
image.png

Best Regards,
xianlong

0 Kudos
Reply
1 Solution
2,368 Views
PavelL
NXP Employee
NXP Employee

Hello @wuxianlong ,

MII works with 4-bit data at 25MHz clock.

RMII works with 2-bit data at 50MHz clock. PHY (like TJA1103) usually works in rev-RMII mode, where PHY generates REF_CLK for MAC (S32K3/EMAC_MII_RMII_TX_CLK). RMII does not use external signal RX_CLK as can be seen on lwip examples.

The trick is that the EMAC processing data on CORE_CLK or AIPS_PLAT_CLK (depends on part number), which has higher frequency. EMAC is Synopsis IP and there are no more other information than in S32K3 RM.

Best regards,

Pavel

View solution in original post

0 Kudos
Reply
3 Replies
2,369 Views
PavelL
NXP Employee
NXP Employee

Hello @wuxianlong ,

MII works with 4-bit data at 25MHz clock.

RMII works with 2-bit data at 50MHz clock. PHY (like TJA1103) usually works in rev-RMII mode, where PHY generates REF_CLK for MAC (S32K3/EMAC_MII_RMII_TX_CLK). RMII does not use external signal RX_CLK as can be seen on lwip examples.

The trick is that the EMAC processing data on CORE_CLK or AIPS_PLAT_CLK (depends on part number), which has higher frequency. EMAC is Synopsis IP and there are no more other information than in S32K3 RM.

Best regards,

Pavel

0 Kudos
Reply
2,352 Views
wuxianlong
Senior Contributor I

Hi ,@PavelL 

 

Yes, I know that the RX clock pin does not need to be used. What I'm confused about is why it needs frequency division by two, and the configuration after frequency division by two is the same as MII.

The following screenshot is from Example Program lwip_baremetal_s32k344

image.png

Best Regards

xianlong

0 Kudos
Reply
2,303 Views
PavelL
NXP Employee
NXP Employee

Hello @wuxianlong ,

that's the condition defined by the IP provider. Notes in Table 550 can be reformulated this way:  both EMAC_TX_CLK and EMAC_RX_CLK should have 25 MHz independently of MII/RMII setup (for 100 Mbps), or 2.5 MHz (for 10 Mbps).

Best regards,

Pavel

%3CLINGO-SUB%20id%3D%22lingo-sub-2048908%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K3_EMAC_RMII_why%20the%20RXCLK%20is%20%2025Mhz%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2048908%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%20NXP%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EWhen%20using%20the%20RMII%20mode%20of%20the%20EMAC%20module%20in%20S32K3x4%2C%20why%20is%20it%20necessary%20to%20configure%20MII_RX_CLK%20to%2025MHz%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20894px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325122iCB17CABC7E961361%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EIf%20configured%20to%2050MHz%2C%20the%20data%20will%20be%20abnormal.%20Is%20there%20any%20more%20information%20about%20this%20description%3F%20I%20didn't%20find%20much%20description%20in%20the%20S32K3%20RM%20manual.%20Why%20is%20MII_RX_CLK%2025MHz%20in%20both%20MII%20and%20RMII%20modes%3F%20Is%20there%20any%20special%20operating%20principle%3F%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325123iA895801C1E8C13FC%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3EBest%20Regards%2C%3CBR%20%2F%3Exianlong%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2050858%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K3_EMAC_RMII_why%20the%20RXCLK%20is%20%2025Mhz%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2050858%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%2F191389%22%20target%3D%22_blank%22%3E%40wuxianlong%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3Ethat's%20the%20condition%20defined%20by%20the%20IP%20provider.%20Notes%20in%20Table%20550%20can%20be%20reformulated%20this%20way%3A%26nbsp%3B%20both%20EMAC_TX_CLK%20and%20EMAC_RX_CLK%20should%20have%2025%20MHz%20independently%20of%20MII%2FRMII%20setup%20(for%20100%20Mbps)%2C%20or%202.5%20MHz%20(for%2010%20Mbps).%3C%2FP%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-2049351%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K3_EMAC_RMII_why%20the%20RXCLK%20is%20%2025Mhz%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2049351%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20%2C%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%3C%2FP%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3E%3CSPAN%3EYes%2C%20I%20know%20that%20the%20RX%20clock%20pin%20does%20not%20need%20to%20be%20used.%20What%20I'm%20confused%20about%20is%20why%20it%20needs%20frequency%20division%20by%20two%2C%20and%20the%20configuration%20after%20frequency%20division%20by%20two%20is%20the%20same%20as%20MII.%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EThe%20following%20screenshot%20is%20from%20Example%20Program%26nbsp%3B%3C%2FSPAN%3Elwip_baremetal_s32k344%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20581px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20581px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325212i675FF77EAAA420EB%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3EBest%20Regards%3CBR%20%2F%3E%3CBR%20%2F%3Exianlong%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2049054%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K3_EMAC_RMII_why%20the%20RXCLK%20is%20%2025Mhz%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2049054%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%2F191389%22%20target%3D%22_blank%22%3E%40wuxianlong%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3EMII%20works%20with%204-bit%20data%20at%2025MHz%20clock.%3C%2FP%3E%0A%3CP%3ERMII%20works%20with%202-bit%20data%20at%2050MHz%20clock.%20PHY%20(like%20TJA1103)%20usually%20works%20in%20rev-RMII%20mode%2C%20where%20PHY%20generates%20REF_CLK%20for%20MAC%20(S32K3%2FEMAC_MII_RMII_TX_CLK).%20RMII%20does%20not%20use%20external%20signal%20RX_CLK%20as%20can%20be%20seen%20on%20lwip%20examples.%3C%2FP%3E%0A%3CP%3EThe%20trick%20is%20that%20the%20EMAC%20processing%20data%20on%20CORE_CLK%20or%20AIPS_PLAT_CLK%20(depends%20on%20part%20number)%2C%20which%20has%20higher%20frequency.%20EMAC%20is%20Synopsis%20IP%20and%20there%20are%20no%20more%20other%20information%20than%20in%20S32K3%20RM.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3C%2FP%3E%0A%3CP%3EPavel%3C%2FP%3E%3C%2FLINGO-BODY%3E