Timeout functionality in tickless mode

Calling xQueueReceive with timeout argument 1000 and sys tick frequency 1ms will cause the function to timeout after 1000 ms.

In a tickless mode, the ticks are suppressed.
How is the xQueueReceive expected to behave in this case?

How does the function know when to timeout if the sys tick is suppressed?

Systick is not suppressed forever. The RTOS calculates the time at which next event (in your case, receive timeout) will happen and tick is suppressed only for that duration. Take a look at the xExpectedIdleTime here - FreeRTOS-Kernel/tasks.c at main · FreeRTOS/FreeRTOS-Kernel · GitHub

How would that work if I wanted a timeout time more than a minute?
For example 120 or 150 seconds? Or even hours?

Would that be possible ?

Yes, that’s possible. But remember, whether tickless idle is enabled or not, there is a limit to the timeout duration you can specify. For example, with 16-bit ticks and a 1000 Hz tick rate, you can specify up to 65.5 seconds of timeout (0xFFFF ticks). With 32-bit ticks an 1000 Hz tick rate, you can specify up to 49.7 days of timeout (0xFFFFFFFF ticks).

During a long delay with tickless idle enabled, the idle task executes as many tickless periods as necessary to conduct the long delay.

Thank you very much!