Skip to main content
Visitor II
August 8, 2022
Question

STM32F4 Ethernet issue with Cube FW_F4 V1.27.1

  • August 8, 2022
  • 2 replies
  • 2810 views

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

   }

    This topic has been closed for replies.

    2 replies

    Graduate II
    August 9, 2022

    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

    ST Employee
    January 18, 2023

    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,

    Graduate II
    January 27, 2023

    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