cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 Ethernet issue with Cube FW_F4 V1.27.1

TTsek.2
Associate

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);

   }

3 REPLIES 3
Piranha
Chief II

Sticking something random on a broken code will not make it correct. Wasting a time on such a things is useless...

https://community.st.com/s/question/0D50X0000BOtfhnSQB/how-to-make-ethernet-and-lwip-working-on-stm32

MWB_CHa
ST Employee

Hi @TTsek.2​ ,

The problem has been fixed starting from STM32CubeMX 6.7.0.

You can find attached the fixed ethernetif.c according to your ioc configuration.

I hope it helps ?

Kind Regards,

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