LoRaWAN_End_Node_FreeRTOS application: configASSERT() in tasks.c when calling osDelay() function
Hello community,
We are using STM32WL V1.2.0 to develop an application based on the example application "LoRaWAN_End_Node_FreeRTOS". Board: Nucleo-WL55JC1. The example application works.
However, as soon as we add the function "osDelay(2000)" in a thread, the application gets stuck in tasks.c, line 2581:
configASSERT( ( xTickCount + xTicksToJump ) <= xNextTaskUnblockTime );Steps to reproduce: LoRaWAN_End_Node_FreeRTOS, lora_app.c, line 439: add code:
APP_LOG(TS_ON, VLEVEL_M, "before osDelay(2000)\r\n");
osDelay(2000);
APP_LOG(TS_ON, VLEVEL_M, "after osDelay(2000)\r\n");We suspect that the ticks are not updated correctly, so that after waking up from sleep, configASSERT() is hit because the system thinks it has missed xNextTaskUnblockTime.
When using FreeRTOS timers osTimerNew(), osTimerStart(), the same happens. The original example application uses neither osDelay() nor osTimerNew(), but only osThreadFlagsWait/Set() functions, and therefore works fine.
FreeRTOS configuration: as in the example application, most notably configUSE_TICKLESS_IDLE = 1.
Any ideas what could be wrong?
Thanks!
