- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Interesting issue. I am trying to call vEventGroupDelete to remove an event group and reset a app thread to a know state but I am finding that I am hitting an assert in FreeRTOS queue.c, specifically the xQeueGenericReceive function:
configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
With the debugger, I have captured the call stack:
vEventGroupDelete
--> vPortFree
--> free
--> some platform library call
--> malloc_lock (heap_3.c)
-->xSemaphoreTakeRecursive
-->xQueueGenericReceive
Since the FreeRTOS heap_3.c has been modified from stock FreeRTOS v9 to provide reentrancy for malloc/free calls, the malloc_lock function uses a mutex with a delay of portMAX_Delay, to wait until malloc or free can be called.
The problem appears to be that xQueueGenericReceive depends on the scheduler to provide a timeout (xTicksToWait). The first line in vEventGroupDelete suspends the scheduler.
Not exactly sure how to proceed, other than to shift from a dynamic EventGroup to a static EventGroup.
Anyone know other workarounds or what else this issue may impact.
Platform: CYW43907
OS: FreeRTOS v9.0.0
SDK: 6.2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Based on the description, I'm not sure how the issue can be reproduced. Please share your application code where you can observe the issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The actual failure came from the AWS OTA agent library. I assume this can be replicated by making a simple FreeRTOS application with a task running a loop that dynamically creates an EventGroup and then deletes it with vEventGroupDelete.