The vTaskSuspendAll() suspends scheduler. It is called in many places in internal
freeRtos files (e.g. queue.c, task.c, heap_4.c)
The problem is that if scheduler is suspended and the IRQ occur and inside this IRQ I call
some API from freertos (e.g. xSemaphoreGiveFromISR or xQueueSendFromISR) then this call is
triggering following assert:
Two are in event_groups.c, so I have not looked at those. Two are in queue.c.
One of the two in queue.c is in xQueueGenericReceive(), and the other is in xQueueGenericSend() - but neither of those functions should get called in an ISR. xSemaphoreGiveFromISR() calls xQueueGiveFromISR() (or probably xQueueSendFromISR() in your version).
So I don’t know why you would hit those asserts - other than to say it looks like a non-ISR safe function is being called from an ISR.
I would recommend stopping on the debugger when the assert has been hit and looking at the call stack to see the sequence of function calls that took you to the assert.
From: Real Time Engineers ltd. [mailto:rtel@users.sf.net]
Sent: Tuesday, April 7, 2015 9:54 PM
To: [freertos:discussion]
Subject: [freertos:discussion] vTaskSuspendAll() is causing assert in queue.c
I just searched the source files (V8.2.1, not V8.0.0 admittedly) and can find four
occurrences of:
Two are in event_groups.c, so I have not looked at those. Two are in queue.c.
One of the two in queue.c is in xQueueGenericReceive(), and the other is in
xQueueGenericSend() - but neither of those functions should get called in an ISR.
xSemaphoreGiveFromISR() calls xQueueGiveFromISR() (or probably xQueueSendFromISR() in your
version).
So I don’t know why you would hit those asserts - other than to say it looks like a
non-ISR safe function is being called from an ISR.
I would recommend stopping on the debugger when the assert has been hit and looking at the
call stack to see the sequence of function calls that took you to the assert.