2022-08-08 03:17 AM
Hi ST guys,
There seems to be an issue with the "ethernet_link_thread" generated for my particular use-case from CubeMX. As generated,the Ethernet link will not restore the link UP state after being disconnected during run time. My .ioc and workaround are attached below.
Cheers,
Trifon
if(linkchanged)
{
osSemaphoreRelease(RxPktSemaphore); // in some cases the semaphores were stuck taken...
osSemaphoreRelease(TxPktSemaphore); // ...so force-release them here
linkchanged = 0; // linkchanged was never given zero value after intialization
/* Get MAC Config MAC */
HAL_ETH_GetMACConfig(&heth, &MACConf);
MACConf.DuplexMode = duplex;
MACConf.Speed = speed;
HAL_ETH_SetMACConfig(&heth, &MACConf);
HAL_ETH_Start_IT(&heth); // My project uses FreeRTOS, but code was generated with HAL_ETH_Start(&heth);
netif_set_up(netif);
netif_set_link_up(netif);
}
2022-08-09 04:09 AM
Sticking something random on a broken code will not make it correct. Wasting a time on such a things is useless...
2023-01-18 03:33 AM
2023-01-26 05:10 PM
I will just remind that ST fixed just one (absolutely trivial) of many issues with that code:
https://community.st.com/s/question/0D53W00001sGiChSAK/cubemx-lwip-ethernetlinkthread-bug