Embedded Software Development Course Notes
Embedded Software Development Course Notes
net/publication/387504626
CITATIONS READS
0 82
1 author:
Youcef Benabderrezak
University of Boumerdes
169 PUBLICATIONS 23 CITATIONS
SEE PROFILE
All content following this page was uploaded by Youcef Benabderrezak on 29 December 2024.
Dr Benabderrezak
Researcher in Cyber Security
Full-stack Web developer 1
Work Plan
1. Introduction to embedded systems
5. Smartphone programming
2
Introduction to Embedded Systems
3
An embedded system
4
Embedded Systems Key Features
● Hardware + Software
● Real-Time
5
Embedded Systems Key Features
Hardware + Software :
6
Embedded Systems Key Features
Real-Time :
7
Embedded Systems Key Features
8
Embedded Systems History
9
History
spacecraft)
10
Embedded Systems Applications
11
Fields of Application
12
Characteristics and Attributes
of Embedded Systems
13
Characteristics and Attributes of Embedded Systems
14
Characteristics and Attributes of Embedded Systems
15
Different Models of the ARM Family
16
Different Models of the ARM Family
ARM (Advanced RISC Machine) is the leading architecture for embedded systems.
Its models include :
17
ARM architecture and core concepts
18
ARM Architecture and Core Concepts - RISC Architecture :
19
ARM Architecture and Core Concepts - Pipeline :
20
ARM Architecture and Core Concepts - Interrupts :
- Status Registers : Hold flags and states, such as zero flags, overflow, etc.
21
Sensors and Actuators
22
Sensors : Devices that measure physical quantities (temperature, light, pressure) and convert
them into electrical signals
23
Actuators : Convert electrical signals into physical actions (movement, sound, etc.).
24
Sensors & Actuators
25
Control and Transfer of Data
26
Control and Transfer of Data
- Data Flow : Managed via buses (data, address, and control buses) in
microcontrollers or microprocessors
27
Communication Interfaces
28
Communication Interfaces
communication interface
29
Interfacing with GSM and GPS
30
Interfacing with GSM and GPS
31
Interfacing with GSM and GPS
32
Data Processing and Display
33
Embedded Systems running
Using Linux & C
34
System Aspects - Memory Management and Allocation
Static Allocation : Memory allocated at compile time, typically for global or static
variables
Dynamic Allocation : Memory allocated during runtime (e.g., using malloc and
free in C)
35
System Aspects -Memory Management in Linux
36
System Aspects - Scheduling
37
System Aspects - Linux Scheduling
Uses Completely Fair Scheduler (CFS) for general processes and Real-Time
Scheduler for critical tasks.
38
System Aspects - Linux Scheduling
39
Timers
Examples in C :
40
Processes and Threads
41
Multi-Threading in C/Linux
42
Semaphores
43
Semaphores
44
Semaphores - Example in C
sem_t semaphore;
sem_init(&semaphore, 0, 1);
sem_wait(&semaphore); // Lock
// Critical Section
sem_post(&semaphore); // Unlock
45
Embedded Software
46
Embedded Software
functionality
47
Examples of Real-Time Applications
48
Embedded Software - Time Constraints
ABS)
49
Different Architectures of Real-Time Embedded Systems
- Monolithic Architecture
- Layered Architecture
- Distributed Systems
50
Different Architectures of Real-Time Embedded Systems
51
Different Architectures of Real-Time Embedded Systems
52
Different Architectures of Real-Time Embedded Systems
via networks
53
Real Time Embedded System Core
54
Real-Time Embedded System Cores
55
Scheduling and Fault Tolerance
- Single-Processor Scheduling
- Multi-Processor Scheduling
- Fault Tolerance
56
Scheduling and Fault Tolerance - Single-Processor Scheduling
Techniques :
- Earliest Deadline First (EDF) : Dynamically prioritizes tasks with the nearest
deadline
57
Scheduling and Fault Tolerance - Multi-Processor Scheduling
58
Hardware and Software Architecture Elements
59
Hardware and Software Architecture Elements
- Kernel
- Bus and Networks
60
Hardware and Software Architecture Elements
Kernel
61
Hardware and Software Architecture Elements
- Bus : Transfers data between hardware components (e.g., I2C, SPI, CAN).
62
Software development tools
63
Software Development Tools for Embedded Systems
Developing software for embedded systems requires specialized tools to ensure that
code is correctly designed, compiled, debugged, and deployed on the hardware.
64
Programming Environment
- C-POSIX
- C language
- Embedded C
65
Programming Environment - C-POSIX
66
C Language
- Widely used for embedded systems due to its low-level hardware interaction
and efficiency
67
Compilation Environment
68
Compilation Environment
Translates source code into machine code for the target hardware
- Cross-Compilers
- Toolchains
69
Compilation Environment
70
Compilation Environment
71
Simulators & Emulators
72
Simulators and Emulators - Simulators
Examples :
73
Simulators and Emulators - Simulators
Advantages :
- Cost-effective.
- Useful in the early development stages when hardware may not be available.
Limitations :
74
Simulators and Emulators - Emulators
- Hardware tools that replicate the functionality of the target system more
accurately than simulators.
- Provide real-time testing and debugging.
75
Simulators and Emulators - Emulators
Examples :
76
ROM Monitor
77
ROM Monitor
78
ROM Monitor - Functions
79
ROM Monitor - Examples
80
JTAG Interface
Joint Test Action Group
81
JTAG Interface
JTAG (Joint Test Action Group) is a standard for testing and debugging embedded
hardware
Functions :
83
JTAG Interface - Advantages
84
Programming and Direct Testing of
ROM/Flash
85
Programming and Direct Testing of ROM/Flash
Programming ROM/Flash :
86
Programming and Direct Testing of ROM/Flash
Direct Testing :
- Involves writing test code into ROM/Flash and running it on the target
hardware.
87
Workflow Summary of developing embedded
software
88
Workflow Summary
1. Develop Code
2. Simulate or Emulate
4. Deploy
89
Workflow Summary
Develop Code : Use an IDE like Keil, Eclipse, or Visual Studio Code. & Write in
C/C++ with POSIX libraries (if applicable)
90
Workflow Summary
Debug and Test : Use JTAG, ROM monitors, or onboard debugging tools
Refine and Repeat : Debug, refine code, and repeat the process until the desired
functionality is achieved.
91
Multitasking and task synchronization
mechanisms
92
Multitasking and Mechanisms of Task Synchronization
This chapter explores the mechanisms, tools, and concepts essential for
implementing multitasking in real-time embedded systems.
93
Use of a Real-Time Executive
94
Use of a Real-Time Executive - Purpose :
Examples :
functionality
96
Functional Breakdown of Embedded Systems - Common Functional Blocks
● Sensor Interface
● Processing Unit
● Actuator Control
● Communication Interface
● User Interface
97
Functional Breakdown of Embedded Systems - Common Functional Blocks
98
Software Architecture of a Control System
Key Components
99
Software Architecture of a Control System - Key Components :
100
Software Architecture of a Control System - Key Components :
Architecture Styles :
logic.
interfaces.
101
Synchronous and Asynchronous
Implementation
102
Synchronous Implementation
Role of Executive :
103
Asynchronous Implementation
Role of Executive :
104
General Structure
of Executive
105
General Structure of an Executive
● Task Scheduler
● Inter-Task Communication
● Resource Manager
● Time Management
● Interrupt Handling
106
General Structure of an Executive
107
General Structure of an Executive
108
Time, Event, and Time Management
Primitives
109
Time Primitives
110
Event Primitives
111
Time Management
- The system tick is the time unit that OS timers and delays are based on.
- i.e. it causes the scheduler to run and may cause a context switch - for example if a timer
112
Smartphone / Mobile programming
113
Smartphone Programming
Android
114
Android Overview
115
Android Unique Features
styles, etc.
116
Android Unique Features
117
Components of a Graphical Interface
- Android UI Components
- XML Layout Files
118
Components of a Graphical Interface - Android UI Components :
119
Components of a Graphical Interface - Android UI Components :
120
Components of a Graphical Interface - Android UI Components :
121
Components of a Graphical Interface - Android UI Components
122
XML Layout Files : Define the visual structure of an app using XML.
123
Event Handling
124
Persistence of Data - Shared Preferences :
125
SQLite Database
- For structured data storage
126
Room Database (Modern Approach):
- Provides abstraction over SQLite.
Example :
@Entity
public class User {
@PrimaryKey(autoGenerate = true)
public int id;
public String name;
}
127
File Storage
Example :
fos.write("Hello, world!".getBytes());
fos.close();
128
Concurrent Programming
On Android
129
Concurrent Programming on Android - Concurrency Needs :
Android applications often perform long-running tasks (e.g., network requests, file
130
Threads :
131
Network Communications
132
Setting Up a Network Communication - Networking Libraries :
133
Handling Permissions
- Android 6.0+ requires runtime permissions for networking.
134
135
Methods of design for embedded
systems
136
Designing embedded systems
Involves precise planning and modeling to meet the system’s functional and
non-functional requirements
This chapter discusses key methods like co-design templates, system modeling
with SysML, and advanced techniques like MARTE and specialized modeling
languages.
137
Co-Design Templates
138
Co-Design Templates - Key Concepts :
Hardware/Software Partitioning :
Iterative Design :
Templates :
139
Co-Design Templates - Examples :
140
System Modeling (SysML)
141
SysML - Needs Analysis and System Specification
Objective :
142
Modeling the System Architecture
Objective :
- Internal Block Diagram (IBD) : Details the internal structure of a block, including
143
Modeling Behavior
Objective :
144
Modeling Transverse Aspects
Key Techniques :
145
MARTE
Modeling and Analysis of Real Time and
Embedded systems
146
What is MARTE ?
147
MARTE Key Features
- Time Modeling : Define timing constraints like deadlines and execution time
components.
148
MARTE Example
149
System Simulation
150
Simulation of Systems by Running Models
Objective :
151
Tools for Simulation
152
Tools for Simulation
Example :
153
Advanced IDM Techniques
154
Definition of a Specialized Modeling Language (DSML)
Example : A DSML for automotive systems might include elements like "ECU"
(Electronic Control Unit) or "CAN bus."
155
Definition of a Specialized Modeling Language (DSML)
Advantages :
156
Code Generator
157
Definition of a Code Generator - Objective :
158
Code Generator Process
Example :
- Generate control logic code for a washing machine directly from its state
diagram.
159
160
View publication stats