Just FYI, I added a latency measurement demo under /demos/various/RT-TEST-Latency. It measures the ISR latency and the thread flyback time.
Output is like this:
Code: Select all
*** Compiled: Mar 19 2020 - 12:30:31
*** Platform: STM32G4 Hi-resolution Line
*** Test Board: STMicroelectronics STM32 Nucleo64-G474RE
*** Architecture: ARMv7E-M
*** Core Variant: Cortex-M4 @ 170MHz
*** Compiler: GCC 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]
ISR activation time latency
Iterations: 1000
Last measurement: 75
Best measurement: 75
Worst measurement: 77
Cumulative time: 75002
Thread fly-back latency
Iterations: 1000
Last measurement: 296
Best measurement: 296
Worst measurement: 296
Cumulative time: 296000
It means that under optimal conditions (highest IRQ priority in the system, no critical sections in background threads, the thread fly-back time is well below 400nS for that platform.
I am thinking to add "noisy threads" to the measurement to assess impact of RTOS activity to those figures. The best approach is to add that measurement to YOUR application and see how much jitter you have in your system.
Giovanni