Ethernet MAC to MAC - i.MX RT 1020

cancel
Showing results for 
Search instead for 
Did you mean: 

Ethernet MAC to MAC - i.MX RT 1020

Jump to solution
314 Views
Contributor III

Hello,

I want to use the ENET peripheral to connect to a switch (KSZ8794CNX) via RMII with a i.MX RT 1020.

All examples connects to a PHY and they init a PHY interface (ethernetif_phy_init), which (I think) doesn't work to init a MAC to MAC interface (or else I have another issue).

(Running the lwip_dhcp example returns a "Cannot initialize PHY".)

Where should I start to achieve a MAC to MAC communication with my switch?

Thank you,

Best regards,

Benjamin

Labels (1)
0 Kudos
1 Solution
25 Views
Contributor III

Hi jeremyzhou

Got it working.

In RMII MAC-to-MAC, the behaviour is the same as in MAC-to-PHY, i.e. the switch RMII port is considered a PHY port, and the PHY address is 4, in my case (the switch has 3 PHYs at addresses 1-2-3 and one MAC at 4). It is a bit hidden in the docs, can't remember where I found that exactly.

And I had one strap option wrong, or more precisely a pull-down resistor value was too high (750 ohms, I guess it needs less than 450 ohms to read a zero). Not a fan of these multi-purpose I/Os, especially when they are critical config option inputs and LED outputs right after!

Anyway, it seems to work fine now.

Have a nice day,

Best Regards,

Benjamin

View solution in original post

4 Replies
26 Views
Contributor III

Hi jeremyzhou

Got it working.

In RMII MAC-to-MAC, the behaviour is the same as in MAC-to-PHY, i.e. the switch RMII port is considered a PHY port, and the PHY address is 4, in my case (the switch has 3 PHYs at addresses 1-2-3 and one MAC at 4). It is a bit hidden in the docs, can't remember where I found that exactly.

And I had one strap option wrong, or more precisely a pull-down resistor value was too high (750 ohms, I guess it needs less than 450 ohms to read a zero). Not a fan of these multi-purpose I/Os, especially when they are critical config option inputs and LED outputs right after!

Anyway, it seems to work fine now.

Have a nice day,

Best Regards,

Benjamin

View solution in original post

25 Views
NXP TechSupport
NXP TechSupport

Hi Benjamin Balga,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
1) "Cannot initialize PHY" indicates that the initialization process of the KSZ8081RNB is a bit different from theKSZ8794CNX, I'd like to suggest you spend more time to review their's datasheet to figure it out.
2) Where should I start to achieve a MAC to MAC communication with my switch?
-- Actually, I'm very clear with this question, whether you mean that the frame transmits between the Data Link layer directly.

pastedImage_1.png

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
25 Views
Contributor III

Hi jeremyzhou‌,

Thank you for your reply.

Sorry for the confusion. What I have is a switch (KSZ8794CNX) with a RMII link to the RT1021. The example code suggests that it is initialising a PHY interface specifically (call to PHY_Init()), and that doesn't seems suited for a switch interface (which is not a PHY).

So before spending more time fiddling with the example code, I am wondering if the example should work at all or not with a switch? (with the PHY_Init() procedure)

e.g. In the example code there is EXAMPLE_PHY_ADDRESS that is used in initialisation (I guess it match the PHYAD register/pin config of the KSZ8081), but there is no such address to select for my switch. Which suggests to me that I should use a totally different init procedure that the one used in the example code.

I hope I'm clearing any confusion,

Thanks,

Benjamin

0 Kudos
25 Views
NXP TechSupport
NXP TechSupport

Hi Benjamin Balga,

Thanks for your clarification.
The original PHY_Init() procedure is not suited for the KSZ8794CNX, however, I think it can fit for the KSZ8794CNX after doing a modification. To make it, I'd like to suggest you spend some time to review the datasheet of KSZ8081RNB and KSZ8794CNX.

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos