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:
--> some platform library call
--> malloc_lock (heap_3.c)
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.
OS: FreeRTOS v9.0.0