Program Flow in Embedded Applications
Program Flow in Embedded Applications
Image from
Embedded Systems Architecture, A Comprehensive Guide for Engineers and Programmers
by Tammy Noergaard
2.5.3 Multi-tasking systems (contd.)
• An RTOS allows multiple processes to be executed concurrently, by dividing
the processor’s time into time slots and allocating the time slots to the
processes that require services.
• A timer is needed to handle the timekeeping for the RTOS, and
• at the end of each time slot, the timer generates a timer interrupt, which
triggers the task scheduler, and
• It decides if context switching should be carried out.
• (click here for a detailed example of context switching)
• If yes, the current executing process is suspended and the processor
executes another process.
• Besides task scheduling, RTOSs also have many other features such as
semaphores, queues, message passing, etc.
• There are many RTOSs developed for the Cortex-M processors, and many
of them are completely free of charge (e.g. FreeRTOS).