Hello everyone,
I'm Luiz Villa a researcher on software defined power electronics at the University of Toulouse. My team is working on trying to embed an RTOS onto a micro-controller in order to create a more friendly development process of embedded control in power electronics. We are trying as much as possible to avoid using ISRs for two reasons:
- It makes it easier to collaborate in software development (our project is open-source)
- Interrupts make the code execution time non-deterministic (which we wish to avoid)
We would like to make a benchmark between Zephyr and RIOT-OS in terms of thread speed. We need a code that runs at 20kHz with two to three threads doing :
- ADC acquisition and data averaging
- Mathematical calculations for control (using CMSIS)
- Communication with the outside
Since time is such a critical element for us, we need to know:
- What is the minimum time for executing a thread in Zephyr and RIOT-OS?
- The time required to switch between threads in Zephyr and RIOT-OS?
Our preliminary results show that:
- When testing with a single thread and a sleep time of 0us, Zephyr has a period of 9us and riot 5us
- When testing with a single thread and a sleep time of 10us, Zephyr has a period of 39us and riot 15us
We use a Nucleo-G474RE with the following code: https://gitlab.laas.fr/owntech/zephyr/-/tree/test_adc_g4
We are quite surprised with our results, since we expected both OS to consume much less resources than they do.
What do you think? Have you tried running any of these OS as fast as possible? What were your results? Have you tested Zephyr's thread switching time?
Thanks for reading
Luiz