• P-ISSN 0974-6846 E-ISSN 0974-5645

Indian Journal of Science and Technology


Indian Journal of Science and Technology

Year: 2021, Volume: 14, Issue: 16, Pages: 1261-1273

Original Article

Benchmarking and Comparison of Two Open-source RTOSs for Embedded Systems Based on ARM Cortex-M4 MCU

Received Date:06 March 2021, Accepted Date:13 April 2021, Published Date:06 May 2021


Objective: To evaluate the performance of two open-source real-time operating systems (RTOSs), Keil RTX5 and FreeRTOS. Besides, a comparison between them has been also established based on four timing metrics: task switching time, pre-emption time, semaphore shuffling time, and inter-task messaging latency. All the tests have been performed on an STM32F429 discovery board based on Cortex-M4 MCUs. Methods: To measure the timing metrics, the ARM cycle counter register implemented in the DWT unit was used. Findings: The DWT cycle counter allows us to capture the number of cycles that occurred in the execution of a part of the code. Therefore, the time measurements of the metrics selected show that FreeRTOS has good performance with the lowest value of switching time, preemption time, and semaphore shuffling time. Instead, Keil RTX5 has fast message passing. Novelty: The study provides an evaluation and comparison of the latest version of the most used open-source RTOSs, Keil RTX5 and FreeRTOS v10.2.0. Furthermore, the timing metrics have been measured accurately with the ARM cycle counter register without using any other hardware or GPIO pin that may disturb the measurement. The comparison is based on four critical timing metrics that affect mostly the performance of any RTOS and define their time capability. Finally, the tests have been made on a low-power ARM MCU.

Keywords: realtime operation system; embedded system; FreeRTOS; Keil RTX5; benchmarking metric; ARM MCU


  1. Jheng GC, Duh DR, Lai CN. Real-time reconfigurable cache for low-power embedded systems. International Journal of Embedded Systems. 2010;4(3/4):235–247. Available from: https://dx.doi.org/10.1504/ijes.2010.039027
  2. Tan TK, Raghunathan A, Jha NK. Energy macromodeling of embedded operating systems. ACM Transactions on Embedded Computing Systems. 2005;4(1):231–254. Available from: https://dx.doi.org/10.1145/1053271.1053281
  3. Oliveira L, Mattos JCB, Brisolara L. Survey of Memory Optimization Techniques for Embedded Systems. 2013 III Brazilian Symposium on Computing Systems Engineering. 2013;p. 65–70. doi: 10.1109/SBESC.2013.35
  4. Shukla AK, Sharma R, Muhuri PK. A Review of the Scopes and Challenges of the Modern Real-Time Operating Systems. International Journal of Embedded and Real-Time Communication Systems. 2018;9(1):66–82. Available from: https://dx.doi.org/10.4018/ijertcs.2018010104
  5. Fei Y, Ravi S, Raghunathan A, Jha NK. Energy-optimizing source code transformations for operating system-driven embedded software. ACM Transactions on Embedded Computing Systems. 2007;7(1):1–26. Available from: https://dx.doi.org/10.1145/1324969.1324971
  6. Kouty SY, Mishra S. Virtual Integration in Avionics Systems‐RTOS. INCOSE International Symposium. 2019;29(S1):180–193. Available from: https://dx.doi.org/10.1002/j.2334-5837.2019.00678.x
  7. Tan S, Anh TNB. Real-time operating system (RTOS) for small (16-bit) microcontroller. 2009 IEEE 13th International Symposium on Consumer Electronics. 2009;p. 1007–1011. doi: 10.1109/ISCE.2009.5156833
  8. Atmadja W, Liawatimena S, Lukas J, Nata EPL, Alexander I. Hydroponic system design with real time OS based on ARM Cortex-M microcontroller. IOP Conference Series: Earth and Environmental Science. 2017;109(1):012017. Available from: https://dx.doi.org/10.1088/1755-1315/109/1/012017
  9. Choi Y. Model checking Trampoline OS: a case study on safety analysis for automotive software. Software Testing, Verification and Reliability. 2014;24(1):38–60. Available from: https://doi.org/10.1002/stvr.1482
  10. ZHANG H, AOKI T, CHIBA Y. Verifying OSEK/VDX Applications: A Sequentialization-Based Model Checking Approach. IEICE Transactions on Information and Systems. 2015;98(10):1765–1776. Available from: https://dx.doi.org/10.1587/transinf.2015edp7043
  11. Dietrich C, Hoffmann M, Lohmann D. Global Optimization of Fixed-Priority Real-Time Systems by RTOS-Aware Control-Flow Analysis. ACM Transactions on Embedded Computing Systems. 2017;16(2):1–35. Available from: https://dx.doi.org/10.1145/2950053
  12. Belleza RR, Freitas EPD. Performance study of real-time operating systems for internet of things devices. IET Software. 2018;12(3):176–182.
  13. Yu C, Ma X, Fang F, Qian K, Yao S, Zou Y. Design of controller system for industrial robot based on RTOS Xenomai. 2017 12th IEEE Conference on Industrial Electronics and Applications (ICIEA). 2017;p. 221–226. doi: 10.1109/ICIEA.2017.8282846
  14. Murikipudi A, Prakash V, Vigneswaran T. Performance Analysis of Real Time Operating System with General Purpose Operating System for Mobile Robotic System. Indian Journal of Science and Technology. 2015;8(19):1–6. Available from: https://dx.doi.org/10.17485/ijst/2015/v8i19/77017
  15. Martin T. ARMv8-M. In: TM., ed. The Designer’s Guide to the Cortex-M Processor Family. (pp. 445-455) 2016.
  16. Ferreira JF, He G, Qin S. Automated Verification of the FreeRTOS Scheduler in HIP/SLEEK. 2012 Sixth International Symposium on Theoretical Aspects of Software Engineering. 2012;p. 51–58. doi: 10.1109/TASE.2012.45
  17. Shao L, Wang C, Chu C, Song Y, Hu H, Yang Y, et al. Design and implementation of real-time robot operating system based on freertos. J. Phys.: Conf. Ser. 2020;1449:12115. doi: 10.1088/1742-6596/1449/1/012115
  18. Peng L, Guan F, Perneel L, Timmerman M. Behaviour and performance comparison between FreeRTOS and µC/OS-III. International Journal of Embedded Systems. 2016;8(4):300. Available from: https://dx.doi.org/10.1504/ijes.2016.077774
  19. Renaux DPB, Pöttker F. Performance evaluation of CMSIS-RTOS: benchmarks and comparison. International Journal of Embedded Systems. 2016;8(5-6):452–463. doi: 10.1504/IJES.2016.080389
  20. Ungurean I, Gaitan NC. Performance analysis of tasks synchronization for real time operating systems. 2018 International Conference on Development and Application Systems (DAS). 2018;p. 63–66. doi: 10.1109/DAAS.2018.8396072
  21. Yogaraj A, Sivanthiram CS, Dhananjeyan S, Suresh S. Keil Rtos Based Embedded Web Server For Real Time Industrial Monitoring. International Journal of Mechanical Engineering and Technology. 2017;8(10):553–560. Available from: https://iaeme.com/MasterAdmin/Journal_uploads/IJMET/VOLUME_8_ISSUE_10/IJMET_08_10_062.pdf
  22. Wang W, Xie T, Hu X. Design of power well cover wireless monitoring system based on freeRTOS and NB-IoT technology. IOP Conf. Ser.: Mater. Sci. Eng. 2020;853:12038. doi: 10.1088/1757-899X/853/1/012038


© 2021 Mazzi et al.This is an open-access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited. Published By Indian Society for Education and Environment (iSee)


Subscribe now for latest articles and news.