Unit 3 Embedded Firmware Design Approaches
Unit 3 Embedded Firmware Design Approaches
1
At the end of this session, you will be able to
02/27/2025 2
Embedded Firmware Design Approaches
• The firmware design approaches for embedded product is purely dependent on the
complexity of the functions to be performed, the speed of operation required, etc.
• Two basic approaches are used for Embedded firmware design.
1. Super loop based approach or ‘Conventional Procedural Based Firmware Design’
2. ‘ Embedded Operating System (OS) Based Design’.
• The conventional procedural based design is also known as ‘Super Loop Model’.
02/27/2025 3
The Super Loop Based Approach
• The Super Loop based firmware development approach is adopted for applications that
are not time critical and where the response time is not so important
• It is very similar to a conventional procedural programming where the code is executed
task by task
• The task listed at the top of the program code is executed first and the tasks just below
the top are executed after completing the first task.
• This is a true procedural one.
• In a multiple task based system, each task is executed in serial
in this approach.
02/27/2025 4
Continue….
The firmware execution flow for this will be
1. Configure the common parameters and perform initialization for various hardware
components memory, registers, etc.
2. Start the first task and execute it
3. Execute the second task
4. Execute the next task
5.:
6. :
7. Execute the last defined task
8. Jump back to the first task and follow the same flow
02/27/2025 5
Continue….
• All tasks in embedded applications are non-ending and are repeated infinitely throughout
the operation.
• From the above ‘C’ code you can see that the tasks 1 to n are performed one after another
and when the last task (nth task) is executed, the firmware execution is again re-directed to
Task 1 and it is repeated forever in the loop.
• This repetition is achieved by using an infinite loop. Here the while (1) { } loop. This
approach is also referred as ‘Super loop based Approach’
• Since the tasks are running inside an infinite loop, the only way to come out of the loop is
either a hardware reset or an interrupt assertion.
• The ‘Super loop based design’ doesn’t require an operating system, since there is no need
for scheduling which task is to be executed and assigning priority to each task.
• In a super loop based design, the priorities are fixed and the order in which the tasks to be
executed are also fixed.
visualize the operational sequence listed above in
02/27/2025
terms of a ‘C’ program code 6
Continue….
• The ‘Super loop based design’ doesn’t require an operating system, since there is no
need for scheduling which task is to be executed and assigning priority to each task.
• In a super loop based design, the priorities are fixed and the order in which the tasks to
be executed are also fixed. Hence the code for performing these tasks will be residing
in the code memory without an operating system image.
• This type of design is deployed in low-cost embedded products and products where
response time is not time critical. Some embedded products demands this type of
approach if some tasks itself are sequential. For example, reading/writing data to and
from a card using a card reader requires a sequence of operations like checking the
02/27/2025
presence of card, authenticating the operation, reading/writing, etc. 7
Example of a ‘Super loop based’
• An electronic video game toy containing keypad and display unit.
• The program running inside the product may be designed in such a way that it reads
the keys to detect whether the user has given any input and if any key press is detected
the graphic display is updated. The keyboard scanning and display updating happens
at a reasonably high rate.
• Even if the application misses a key press, it won’t create any critical issues; rather it
will be treated as a bug in the firmware
• It is not economical to embed an OS into low cost products and it is an utter waste to
02/27/2025
do so if the response requirements are not crucial. 8
Advantages of the ‘Super loop
02/27/2025 9
The Embedded Operating System (OS) Based Approach
• The Operating System (OS) based approach contains operating systems, which can be either a General
Purpose Operating System (GPOS) or a Real Time Operating System (RTOS) to host the user written
application firmware.
• The General Purpose OS (GPOS) based design is very similar to a conventional PC based application
development where the device contains an operating system (Windows/Unix/ Linux, etc. for Desktop
PCs) and you will be creating and running user applications on top of it.
• Example of a GPOS used in embedded product development is Microsoft® Windows Embedded 8.1
which offers customization to use with a range of industry devices like Handhelds, Point of Sale
Terminals, Patient Monitoring Systems, etc.
• Use of GPOS in embedded products merges the demarcation of Embedded Systems and general
computing systems in terms of OS. For Developing applications on top of the OS, the OS supported
APIs are used. Similar to the different hardware specific drivers, OS based applications also require
02/27/2025
‘Driver software’ for different hardware present on the board to communicate with them. 10
The Embedded Operating System (OS) Based Approach conti….
• Real Time Operating System (RTOS) based design approach is employed in
embedded products demanding Real-time response
• RTOS respond in a timely and predictable manner to events.
• Real Time operating system contains a Real Time kernel responsible for performing
pre-emptive multitasking, scheduler for scheduling tasks, multiple threads, etc.
• A Real Time Operating System (RTOS) allows flexible scheduling of system resources
like the CPU and memory and offers some way to communicate between tasks.
• ‘Windows Embedded Compact’, ‘pSOS’, ‘VxWorks’, ‘ThreadX’, ‘MicroC/OS-III’,
‘Embedded Linux’, ‘Symbian’ etc are examples of RTOS employed in embedded
02/27/2025 product development. 11
THANK YOU
12