Hello,
I have a system around an STM32G0B0 going into sleep and waking up frequently but it shall also wake up by a GPIO edge.
I want to understand closer what is going on under the hood of FreeRTOS.
I did like this:
- disable all FreeRTOS timers and put all but one task into the blocked state by making them wait for a queue
- call vTaskDelay with a duration of 5 sec
- now the system enters sleep which I can see looking at supply current
- after 5 sec the system wakes up, performs one task loop and goes to sleep again, other task remain blocked
all of that works fine
also I configured a GPIO pin to trigger an interrupt on a rising edge. The isr sends a message to a queue belonging to the task that calls vTaskDelay. The xQueueReceive is at some place in the loop that runs after sleep exit.
I output debug messages on a UART. Now what I observe is this: - every 5 sec there is a message from the loop and one right before entry of sleep
- immediately after a rising edge on the GPIO pin a message is sent from inside the isr
- a message is sent that the queue message is processed, but only after the 5sec sleep interval is finished, so maybe up to 4.9 sec after the isr.
How comes this? Sleep is left for the isr. Is the vTaskDelay entered again? How can I make it exit sleep and resume operation either in a 5sec interval or on a GPIO edge?
Thanks for any hint
Martin