Skip to main content
JBive.1
Associate II
November 7, 2022
Solved

LoRaWAN_End_Node_FreeRTOS application: configASSERT() in tasks.c when calling osDelay() function

  • November 7, 2022
  • 4 replies
  • 2261 views

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!

This topic has been closed for replies.
Best answer by Louis AUDOLY

Hello @JBive.1​ , Welcome to the community,

Thank you for your post, we already encounter this issue and we fix it in the next release.

I attach the corrected file.

Best regards

Louis

When your question is answered, please close this topic by choosing Select as Best.

4 replies

Louis AUDOLY
Louis AUDOLYBest answer
ST Employee
November 7, 2022

Hello @JBive.1​ , Welcome to the community,

Thank you for your post, we already encounter this issue and we fix it in the next release.

I attach the corrected file.

Best regards

Louis

When your question is answered, please close this topic by choosing Select as Best.

JBive.1
JBive.1Author
Associate II
November 8, 2022

Hello Louis,

Perfect, the new file app_freertos.c solved the issue.

Do you know when the next release will be published? We are waiting for it :)

Thanks a lot!

Louis AUDOLY
ST Employee
December 2, 2022

Hello @JBive.1​ ,

The new release 1.3.0 is now publish on st.com, you can download it here !

Have a good day

Louis

JBive.1
JBive.1Author
Associate II
December 2, 2022

Thanks Louis & team! Have a great day, too,

J