How to make LwIP work with CMSIS_V2 in CubeIDE?
Hi,
I have a Nucleo-F439ZI board and I am trying to make a simple application that echoes back a message on a UDP port.
When I generate a project using LwIP raw API, I am able to make that happen with a callback function and a PCB.
However, as soon as I turn CMSIS_V2 RTOS on in the CubeMX configuration perspective and create a few threads (e.g. blinking 2 different LEDs periodically), the execution of the program freezes right after MX_LWIP_Init() is called in "Default thread". I don't even have a chance to initialize a Netconn structure to listen for incoming packets or anything.
If I comment it out, every thread runs as expected, but with thi LwIP initialization function called, the whole execution freezes.
I was wondering if I am missing some trivial step , or this isn't the right way to use LwIP with RTOS, but I am clueless here, since this is the auto-generated code that doesn't work.
Also, in debug mode I get no HardFault or Exception or anything, it seems that the code is running as normal, but the threads are completely frozen.
When MX_LWIP_Init() is called in default thread, every task is frozen.
void StartDefaultTask(void *argument)
{
/* init code for LWIP */
//MX_LWIP_Init();
/* USER CODE BEGIN 5 */
/* Infinite loop */
for(;;)
{
HAL_UART_Transmit(&huart3, "Hello", 6, 1000);
osDelay(1000);
}
/* USER CODE END 5 */
}void StartTask02(void *argument)
{
/* USER CODE BEGIN StartTask02 */
/* Infinite loop */
for(;;)
{
HAL_GPIO_TogglePin(LD1_GPIO_Port, LD1_Pin); //toggle running led
osDelay(500);
}
/* USER CODE END StartTask02 */
}I would really appreciate if someone could tell mewhat I am doing wrong.
