Skip to main content
Visitor II
October 24, 2024
Question

lwIP stuck at xSemaphoreTake

  • October 24, 2024
  • 1 reply
  • 1624 views

Hi, i have STM32F767 and im using FreeRTOS V2 and lwIP. Im facing known bug which should be fixed in FW_F7 V1.17 and im using FW_F7 V1.17.2 and still facing this.

When i connect the ethernet cable, after 2 seconds FW is stuck at following place:

Petr3_0-1729778893981.png

I tried to disable DHCP everyting is ok, but when i try to ping the board the result is the same.

 

Can you help me to solve this issue?

    This topic has been closed for replies.

    1 reply

    ST Employee
    October 24, 2024

    Hello @Petr3,

    are you sure you are using the latest version of CubeFirmware as you can see that this fix is available on GitHub 
    Release v1.17.2 · STMicroelectronics/STM32CubeF7@767d083 

    in the new version the fix is as follows :

    do
     {
     if(HAL_ETH_Transmit_IT(&EthHandle, &TxConfig) == HAL_OK)
     {
     errval = ERR_OK;
     }
     else
     {
    
     if(HAL_ETH_GetError(&EthHandle) & HAL_ETH_ERROR_BUSY)
     {
     /* Wait for descriptors to become available */
     osSemaphoreWait( TxPktSemaphore, ETHIF_TX_TIMEOUT);
     HAL_ETH_ReleaseTxPacket(&EthHandle);
     errval = ERR_BUF;
     }
     else
     {
     /* Other error */
     pbuf_free(p);
     errval = ERR_IF;
     }
     }
     }while(errval == ERR_BUF);

    the fix is related to LWIP application and not Ethernet and it is present in V1.17.2 and here are the changes:

    • LwIP Applications
      • Use RCC_HSE_BYPASS value in SystemClock_Config() API for NUCLEO-F767ZI related projects, and adjust PLL parameters when needed, to comply to technical documentation.
      • Fix Wrong use of DHCP API in application code & ethernet_link_thread.
      • Fix Ethernet low_level_init() API to handle return code from LAN8742_init() and DP83848_init() APIs.
      • Fix mismatch in linker section names between linker file and source file.
      • Fix DeadLock in the transmit output.
      • Adjust iPerf bandwidth higher than 90Mbs.

    Regards

    Petr3Author
    Visitor II
    October 24, 2024

    Hello STea,

    i hope im using latest version of FW pack:

    Petr3_0-1729785225997.png

     but the lwIP code seems to be different:

    Petr3_2-1729785357446.png

    where i can update lwIP for latest version? I thought it is part of FW pack for F7 family.

     

    ST Employee
    October 24, 2024

    Hello @Petr3 ,

     

    you are right, the generated code with MX is generated with the old Ethernetif.c template I'm able to reproduce this and I reported it internally (ticket number 194996 internal reference only) for investigation
    in the meanwhile, I suggest you make those changes to your code manually and you should be good to go.
    Regards