cancel
Showing results for 
Search instead for 
Did you mean: 

LAN8742 how to force 10 Mbps mode ?

eak
Associate

Hello, 

Can someone tell me me how to force 10 Mbps Full Duplex mode of the LAN8742 Phy with an STM32F767.

So far I tried pull up/down resistors on MODE[2:0] pins , and also delete all 100 Mbps modes in ANAR register. But no luck so far. I'm able to get it advertised as 10 Mbps Full Duplex in Windows but ping is not working... picture below

2025-03-11 09_46_39-Windows PowerShell.png

4 REPLIES 4
Guillaume K
ST Employee

Hi

when you say "force 10 Mbps full duplex", do you mean "disable auto-negotiation and force 10 Mbps full duplex on the STM32 board" ?

If yes, then when you disable auto negotiation, it must be disabled on both sides. You have to disable it on the PC too (in the Windows driver settings).

 

Hi Guillaume,

I guess we both speak french, but let's keep in english. I would prefere not touching the auto-neg. process and anything in Windows, normally, in ANAR register of the LAN8742 we can set available speeds and modes, so auto-neg is running ok, but since I let know only 10Mbps FD is available, auto-neg should choose that mode and all should work ok, but it doesn't.

2025-03-11 10_34_26-Small Footprint RMII 10_100 Ethernet Transceiver with HP Auto-MDIX and flexPWR® .png

Guillaume K
ST Employee

So you are in the situation where auto-neogtiation is enabled on both sides but you want to restrict the abilities advertised by the LAN8742.

Did you set the register with your own code or did you use the function LAN8742_SetLinkState() provided in Cube F7  Drivers/BSP/components/lan8742/lan8742.c ?

If you indicate a specific speed/duplex mode with this function, it disables auto-negotiation.

Correct.

I tried SetLinkState, but didn't work neither and it disables auto-neg as you say, so not good choice.

So I simply added these two lines in INIT portion of the "ethernet_link_thread"

2025-03-11 14_43_06-MVG_MCU-32F767 - MVG_MCU_Template_testETHspeed_Src_ethernetif.c - STM32CubeIDE.png

Basically I'm just writing to ANAR register data to restrict modes.

so to allows 10baseT in FD and HD the value is 0b001100001 first bit is for IEEE standard (see selector field in previous post). In this case auto-neg in windows is OK to be base 10 in Full Duplex , but no ping.

If I modify the value to any 100baseT e.g. 0b010000001 (half duplex 100 Mbps), everything is working just perfect , windows sees right mode and I have ping.