2021-12-29 09:29 PM
Hi,
I am using FreeRTOS+LWIP on stm32f429zi. All working fine but after some time program control stucks at ethernet_input function. so due to this context switching not happens and other tasks gets affected.
I also tried the below solution obtained from forum, but not working this.
Solution
This code:
Must be replaced with this code:
HAL_StatusTypeDef status;
LOCK_TCPIP_CORE();
status = HAL_ETH_GetReceivedFrame_IT(&EthHandle);
UNLOCK_TCPIP_CORE();
if (status != HAL_OK) {
return NULL;
}
ethernet_input function is :
2021-12-30 12:42 PM
As can be seen on lines 523 and 533 in your screenshot, ST implemented the lock. They did it in a sub-optimal way, but functionally under typical configuration it works. Use one or the other, not both!
You probably already know:
For F1/F2/F4 with RTOS the biggest offenders are ST's link detection and DHCP client code. It breaks lwIP's multi-threading rules and is just completely wrong.