I know that the implementation for the QTicker AO is provided in qf_actq.cpp. This file, however, should not be used for the FreeRTOS port, which is explicitly mentioned in the "Ports" section of the documentation.
I was wondering (consequently) why an implementation of QTicker for FreeRTOS is not provided? Am I missing something?
Kind regards,
Sander Huijsen
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Sander,
The QTicker Active Object's purpose is to move Time Event processing from the interrupt level down to the thread level. This might help to meet hard real-time deadlines in the high-priority AOs/threads that run above the priority assigned to QTicker. The QTicker optimization generally makes sense only in kernels, where Active Object is inexpensive and efficient, which is the case of all built-in kernels (QV, QK, QXK).
However, when QP runs on top of 3rd-party kernels, like FreeRTOS, every Active Object requires the whole thread of execution with the private stack, task-control-block, etc., which is rather expensive. Additionally, 3rd-party kernels generally provide their own time management mechanisms that are more efficient than threads.
Specifically to the QP-port to FreeRTOS, the provided examples demonstrate just one of the many possibilities of servicing the QP Time Events. The demonstrated option is based on the FreeRTOS tick hook vApplicationTickHook(), which runs in the ISR context. If you wish to move the QP Time Event processing down to the thread level, you should probably use the FreeRTOS Software Timer instead. (The timer callback should inovke QTIMEEVT_TICK_X() rather than QTIMEEVT_TICK_FROM_ISR() because FreeRTOS executes this callback in the thread context.)
Either way, the QTicker Active Object is not useful in all QP ports to traditional blocking 3rd-party kernels (embOS, ThreadX, uC/OS-II, Zephyr).
I hope that my comments make sense to you.
--MMS
Last edit: Quantum Leaps 2024-03-11
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I know that the implementation for the
QTicker
AO is provided inqf_actq.cpp
. This file, however, should not be used for the FreeRTOS port, which is explicitly mentioned in the "Ports" section of the documentation.I was wondering (consequently) why an implementation of
QTicker
for FreeRTOS is not provided? Am I missing something?Kind regards,
Sander Huijsen
Hi Sander,
The QTicker Active Object's purpose is to move Time Event processing from the interrupt level down to the thread level. This might help to meet hard real-time deadlines in the high-priority AOs/threads that run above the priority assigned to QTicker. The QTicker optimization generally makes sense only in kernels, where Active Object is inexpensive and efficient, which is the case of all built-in kernels (QV, QK, QXK).
However, when QP runs on top of 3rd-party kernels, like FreeRTOS, every Active Object requires the whole thread of execution with the private stack, task-control-block, etc., which is rather expensive. Additionally, 3rd-party kernels generally provide their own time management mechanisms that are more efficient than threads.
Specifically to the QP-port to FreeRTOS, the provided examples demonstrate just one of the many possibilities of servicing the QP Time Events. The demonstrated option is based on the FreeRTOS tick hook
vApplicationTickHook()
, which runs in the ISR context. If you wish to move the QP Time Event processing down to the thread level, you should probably use the FreeRTOS Software Timer instead. (The timer callback should inovkeQTIMEEVT_TICK_X()
rather thanQTIMEEVT_TICK_FROM_ISR()
because FreeRTOS executes this callback in the thread context.)Either way, the QTicker Active Object is not useful in all QP ports to traditional blocking 3rd-party kernels (embOS, ThreadX, uC/OS-II, Zephyr).
I hope that my comments make sense to you.
--MMS
Last edit: Quantum Leaps 2024-03-11
Thanks Miro, that makes indeed total sense to me.