10Mbps with LAN8720 and K70 - Communication with 10Mbps does not work

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

10Mbps with LAN8720 and K70 - Communication with 10Mbps does not work

1,773 Views
klausconzelmann
Contributor I

Hello,

We work with a proprietary board with CPU K70F120M, PHY LAN8720A, MQX 4.1.1 and Keil uVision MDK Kinetis CortexM 5.12

Communication with 100Mbps on a 100Mbps-switch works correctly. The green Link-LED is ON. ping is answered. ftp commands are acknowledged.

The MQX functions ENET_get_speed (ehandle); reports correctly "100" Mbps.

ENET_link_status (ehandle); reports "link active".

If we connect a 10Mbps-hub in between, the green link-LED is OFF. ping is not answered by the controller. ftp commands are not acknowledged.

The MQX functions ENET_get_speed (ehandle); reports correctly "10" Mbps.

ENET_link_status (ehandle); reports "link active".

The automatic detection of 10 or 100 Mbps seem to be correctly. But no communication is possible

What is to do, to go 10 or 100 Mbps automatically?

Thanks

Klaus

Labels (1)
Tags (3)
0 Kudos
5 Replies

841 Views
mjbcswitzerland
Specialist V

Hi Klaus

When using RMII mode it is important that the EMAC is set according to the link state (speed and duplex). Therefore ensure that your code is handling the PHY's link state changes accordingly.

Moving from a 100M switch to 10M hub means that the link state wil be changing speed and also duplex setting. A change in duplex setting requires a restart of the Ethernet controller's buffer decriptor handling (flush old BDs, resynchronise and restart).

Regards

Mark

Kinetis: µTasker Kinetis support

K70: µTasker Kinetis TWR-K70F120M support

For the complete "out-of-the-box" Kinetis experience and faster time to market

0 Kudos

841 Views
klausconzelmann
Contributor I

Hi,

Thank you for your reply. OK so far. RMII is active.


In the function MACNET_initialize () in macnet_init.c a fixed definition of speed and duplex to 10 or 100 Mbps and full or half duplex occurs.

Where is in MQX 4.1.1 the function Auto Negotiate from us will activated, so speed and duplex are automatically detected and adjusted?
How does the continuous detection of link state changes in MQX 4.1.1 and reinitialization?

Or is auto-negotiate and link status detection in MQX 4.1.1 not realized and must be added yourself?


Thanks and Regards


Klaus

0 Kudos

841 Views
mjbcswitzerland
Specialist V

Hi Klaus

If it may be related to missing functionality in MQX I would use the forum at: MQX Software Solutions

Regards

Mark

Kinetis: µTasker Kinetis support

K70: µTasker Kinetis TWR-K70F120M support

For the complete "out-of-the-box" Kinetis experience and faster time to market


0 Kudos

841 Views
klausconzelmann
Contributor I

Hi Mark,

Thank you for your reply.
I understand that so so that no auto-negotiate and link status detection in MQX 4.1.1 are implemented and we need to integrate this yourself.
Thanks for the advice. I'll look in the forum.
Regards

Klaus

0 Kudos

841 Views
RadekS
NXP Employee
NXP Employee

About 10Mbit/100Mbit autonegotiation)

For proper work Ethernet module and phy have to work with the same speed/duplex settings.

Problem is that some of PHYs don’t have any wire or any other way how phy could directly inform MCU about changed parameters.

Only way is that MCU use MDC/MDIO communication for reading phy status. Unfortunately this reading is executed during Ethernet mode initialization only in case of MII interface. RMII use default setting is 100Mbit, full duplex.10Mbit speed is now used only in rare cases when very old infrastructure.

So, basic ways how to add support for autonegotiation is adding task with periodic reads (e.g. once per seccond) of phy status (we will get speed and duplex PHY settings).

Second issue is that kinetis enet module do not offer speed change in runtime for RMII. We have to disable this module (ENET_ECR- ETHEREN=0), set new speed (ENET_RCR-RMII_10T) and enable it again.

On base of new settings from PHY we should call ENET_shutdown() modify speed settings and call ENET_Init() again.

I hope it helps you.

Have a great day,
RadekS

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