In order to ease troubleshooting, I’d like to force my ethernet link to run at 10Mbps.
This would permit to observe packets with an affordable oscillocope.
I understand that I should disable auto-negociation and deselect 100Mbps in PHY init.
But I have no idea about doing this.
EthernetInterface doesn’t provide any adequat API.
all the best
Try to make the following modification to the ‘mbed-os\features\netsocket\emac-drivers\TARGET_STM\stm32xx_emac.cpp’ file:
/* Init ETH */
EthHandle.Instance = ETH;
// EthHandle.Init.AutoNegotiation = ETH_AUTONEGOTIATION_ENABLE;
// EthHandle.Init.Speed = ETH_SPEED_100M;
EthHandle.Init.AutoNegotiation = ETH_AUTONEGOTIATION_DISABLE;
EthHandle.Init.Speed = ETH_SPEED_10M;
Sorry for the mbed-newbie question. I am using online compiler.
Is it possible to modify the mbed library ?
If yes, how to ?
I’m afraid not. Try to do it offline either in Mbed Studio or using Mbed CLI.
Best regards, Zoltan
I have tested your recommendation, it works great!
For conveniance, I wrapped your code with an “ETH_FORCE_SPEED_10M” #ifdef (see here below).