0% found this document useful (0 votes)
34 views43 pages

Embedded Software

The document outlines a course on Embedded Systems, detailing the organization, literature, and assessment methods. It covers key topics such as the definition and architecture of embedded systems, their constraints, real-time operation, and the development environment including hardware and software considerations. Additionally, it discusses the advantages and disadvantages of bare-metal programming versus using an operating system like Linux, as well as the future of embedded systems in various applications.

Uploaded by

Ramiz Karaeski
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views43 pages

Embedded Software

The document outlines a course on Embedded Systems, detailing the organization, literature, and assessment methods. It covers key topics such as the definition and architecture of embedded systems, their constraints, real-time operation, and the development environment including hardware and software considerations. Additionally, it discusses the advantages and disadvantages of bare-metal programming versus using an operating system like Linux, as well as the future of embedded systems in various applications.

Uploaded by

Ramiz Karaeski
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

Embedded Systems

Prof. Dr. Faruk Bağcı


Prof. Dr. Mesut Güneş

Prof. Dr. Faruk Bağcı


ORGANIZATION

Lecture: 2 SWS
Lab: 2 SWS
Lecturers: Prof. Dr. Faruk Bağcı, Prof. Dr. Mesut Güneş

Lab-Support:

Assessment: 20% Lab, 30% Vize, 50% Final

Prof. Dr. Faruk Bağcı


LITERATURE

• Fast and Effective Embedded Systems


Design, 2nd Edition, Rob Toulson and Tim
Wilmshurst

• Embedded Systems Architecture, Daniela


Lacamera

• Essentials of Computer Organization and


Architecture, 5th Edition, Linda Null, Julia
Lobur

• Embedded Linux Primer: A Practical, Real-


World Approach, Second Edition,
Christopher Hallinan
Prof. Dr. Faruk Bağcı
LITERATURE

• Linux Kernel Development, Third


Edition, Robert Love

• Linux Device Drivers, Second Edition

• Mastering Embedded Linux


Programming - Second Edition, Chris
Simmonds

Prof. Dr. Faruk Bağcı


CHAPTER OVERVIEW

• Introduction to Embedded Systems


• Embedded & Real-time Operating Systems
• Linux Kernel
• Peripheral Access
• Threads & Processes
• Memory
• Inter-process Communication
• Real-time Scheduling
• Interrupt Handling
• Advanced Topics

Prof. Dr. Faruk Bağcı


MOTIVATION

According to forecasts, future of IT characterized by


terms such as
• Disappearing computer,
• Ubiquitous computing,
• Pervasive computing,
• Ambient intelligence,
• Post-PC era,
• Cyber-physical systems.
Basic technologies:
• Embedded Systems
• Communication technologies

Prof. Dr. Faruk Bağcı


WHAT IS AN EMBEDDED SYSTEM?

An embedded system is a product which is controlled by a


computer inside it, but whose overall function is not
computing. Examples are near endless, and include
washing machines, office equipment, and car engine
management.

Prof. Dr. Faruk Bağcı


EXAMPLE OF AN EMBEDDED SYSTEM

Prof. Dr. Faruk Bağcı


FURTHER EXAMPLES

Example: Anti-lock Braking System (ABS)

Prof. Dr. Faruk Bağcı


FURTHER EXAMPLES

• For example:
• Artificial eye: several approaches, e.g.:
• Camera attached to glasses; computer worn at
belt; output directly connected to the brain,
“pioneering work by William Dobelle”. Previously at
[www.dobelle.com]

• Translation into sound;


• claiming much better resolution.
[http://www.seeingwithsound.com/etumble.htm]

Prof. Dr. Faruk Bağcı


MORE APPLICATION AREAS

• Railways
• Telecommunication
• Consumer electronics
• Robotics
• Public safety
• Smart homes
• Military systems

Mostly cyber-physical

Prof. Dr. Faruk Bağcı


ARCHITECTURE OF AN EMBEDDED SYSTEM

Prof. Dr. Faruk Bağcı


THE MICROCONTROLLER

A microcontroller takes the essential features of the computer


• adds to these the features that are needed for it to perform its control functions
• made up of three parts: core, memory and peripherals

Prof. Dr. Faruk Bağcı


EMBEDDED SYSTEM CONSTRAINTS

• Small size, low weight


• Basic requirement for handheld devices
• Low power
• Battery power typically last for a few hours
• Limited cooling and system cost may limit power even if AC power is available
• Harsh environment
• Heat, vibration, shock, water, corrosion, physical abuse, power fluctuations, RF
interference, lightning, etc
• Safety critical operation
• Must function correctly
• Must not function incorrectly
• Extreme cost sensitivity
• A penny adds up over 1,000,000 units

Prof. Dr. Faruk Bağcı


CHARACTERISTICS OF ES

• Sophisticated functionality
• Real-time operation
• Low manufacturing cost
• Application dependent processor
• Restricted memory
• Low power

Prof. Dr. Faruk Bağcı


REAL-TIME OPERATION

• Timing correctness is part of system correctness


• Must finish operations by deadlines
• Hard real-time: missing deadline causes failure
• Soft real-time: missing deadline results in degraded
performance
• Real-time != “Real fast”

Prof. Dr. Faruk Bağcı


DEPENDABILITY

• ES must be dependable,
• Reliability R(t) = probability of system working correctly provided that it
was working at t=0
• Maintainability M(d) = probability of system working correctly d time
units after error occurred.
• Availability A(t): probability of system working at time t
• Safety: no harm to be caused
• Security: confidential and authentic communication

• Even perfectly designed systems can fail if the assumptions about the
workload and possible errors turn out to be wrong.
• Making the system dependable must not be an afterthought, it must be
considered from the very beginning
Prof. Dr. Faruk Bağcı
EFFICIENCY

• ES must be efficient
• Code-size efficient (especially for systems on a chip)
• Run-time efficient
• Weight efficient
• Cost efficient
• Energy efficient

Prof. Dr. Faruk Bağcı


ES IMPLEMENTATION

• Hardware
• Processing element
• Peripherals
• Input and output devices
• Interfacing sensors and actuators
• Interfacing protocols
• Memory
• Bus
• Software
• System software
• Application
Prof. Dr. Faruk Bağcı
HARDWARE EVOLUTION

• Systems-on-Chip
• Application-specific processors
• DSPs
• General-purpose
microprocessors and
microcontrollers

- Faster clock rate


- Higher degree of
integration
Prof. Dr. Faruk Bağcı
SOC – SYSTEM ON CHIP

• A collection of all kinds of components and/or subsystems that


are appropriately interconnected to perform the specified
functions for end users
• A SoC design is a “product creation process” which
• Starts at identifying the end-user needs
• Ends at delivering a product with enough functional satisfaction to
overcome the payment from the end-user

Prof. Dr. Faruk Bağcı


SOC – SYSTEM ON CHIP

• Also named System-on-a Chip, System LSI, System-on-Silicon,


System-on-…
• It is used to be System-on-aboard, or System-in-a cabinet, or
System-in-package (SIP)
• System Hardware
• Analog : ADC/DAC, PLL, TxRx, RF
• Digital : Processor, Interface, Accelerator
• Storage : SRAM, DRAM, FLASH, ROM
• Software : RTOS, IP Device Driver, Application

Prof. Dr. Faruk Bağcı


EMBEDDED SYSTEM VS SOC

• System-on-Chip is basically an Embedded System


• SoC is fully integrated on one chip
• SoC can contain both digital and analog circuits
• Most Embedded Systems are built around an SoC
• Can contain external peripherals

Prof. Dr. Faruk Bağcı


EMBEDDED SYSTEMS DESIGN

• A complex set of tradeoffs:


• Consider more than just the computer
• Take into account more than just initial product design
• Optimize for more than just speed

Prof. Dr. Faruk Bağcı


DESIGN & DEVELOPMENT PROCESS

Prof. Dr. Faruk Bağcı


TOP-DOWN VS BOTTOM-UP

• Top-down Design:
• Start from most abstract description
• Work to most details
• Bottom-up Design:
• Work from small components to big system
• Real designs typically use both techniques

Prof. Dr. Faruk Bağcı


BARE-METAL VS OPERATING SYSTEM

• Bare-Metal programming:
• Refers to run a program or a software directly on hardware
level
• Without support of any operating system
• Low-level method of programming specific to the hardware
• Program a microcontroller directly with C or Assembler-code
• Alternative: Embedded Linux
• User space applications with support of a kernel
• Later more detailed information!

Prof. Dr. Faruk Bağcı


ADVANTAGES AND DISADVANTAGES OF BARE-METAL

• Bare Metal advantages:


• Better performance with the same HW (100 to 1.000 faster than w. Linux)
• Easy and fast for small applications
• Reliability
• Bare Metal drawbacks:
• Complexity increase exponentially with the system size and functionalities
• Basic and standard functions have to be programmed and adapted to the
specific HW
• No multi-threading possibilities in one core

Prof. Dr. Faruk Bağcı


ADVANTAGES AND DISADVANTAGES OF LINUX

• Linux advantages:
• Easily scalable
• HW-independent (Portability)
• Multi-threading and priorities
• Free prebuilt drivers available (faster development)
• Less bugs (mature OS code rather than new own code)
• Community support
• Linux drawbacks:
• Complex for small applications
• steeper learning curve than bare metal
• Require a minimum (powerful) hardware to run the Kernel
• Security protection needed
• Updates of the system may be needed
Prof. Dr. Faruk Bağcı
DEVELOPMENT ENVIRONMENT

• Linux advantages:
• Easily scalable
• HW-independent (Portability)
• Multi-threading and priorities
• Free prebuilt drivers available (faster development)
• Less bugs (mature OS code rather than new own code)
• Community support
• Linux drawbacks:
• Complex for small applications
• steeper learning curve than bare metal
• Require a minimum (powerful) hardware to run the Kernel
• Security protection needed
• Updates of the system may be needed
Prof. Dr. Faruk Bağcı
EMBEDDED SYSTEMS VS GENERAL-PURPOSE SYSTEMS

• Embedded Systems • General-purpose Computing


• Few applications that are • Broad class of applications
known at design-time • Programmable by end user
• Not programmable by end • Faster is better
user • Criteria:
• Fixed run-time requirements • Cost
(additional computing power • Average speed
not useful)
• Criteria:
• Cost
• Power consumption
• Predictability
• etc
Prof. Dr. Faruk Bağcı
FUTURE OF EMBEDDED SYSTEMS

• Embedded Systems overtook market of PCs


• E.g. Ubiquitous and pervasive computing:
• Information anytime, anywhere; building ambient intelligence into our
environment; internet of things:
• Wearable computers
• “Smart Labels” on consumer products
• Intelligent buildings
• Environmental Monitoring
• Traffic control and communicating automobiles
• Augmented Reality
• Embedded systems provide the basic technology

Prof. Dr. Faruk Bağcı


DEVELOPMENT ENVIRONMENT

• Building the firmware image of an embedded system relies on a set


of tools,
• can produce firmware images for specific targets, called a toolchain
• Common sets of tools required to write software in C and produce
programs
• are directly executable on the machine that compiled them
• Workflow must then be extended and adapted to integrate the
toolchain components, and produce executable code for the target
platform.

Prof. Dr. Faruk Bağcı


COMPILER

• The C compiler is a tool responsible for translating source code into


machine code, which can be interpreted by a specific CPU
• The native compiler included in most GNU/Linux distributions is the
GNU Compiler Collection, commonly known as GCC
• The GCC compiler takes source code files as input, with .c extension,
and produces object files, with .o extensions
• containing the functions and the initial values of the variables
• The compiler can be configured to perform additional optimization steps,
which are specific for the target platform,
• and insert debug data to facilitate debugging at a later stage

Prof. Dr. Faruk Bağcı


CROSS-COMPILER

• Architecture-specific compilers exist, which provide compilers


creating machine instructions for a specific target, different from the
building machine
• The process of generating code for a different target is called cross-
compilation
• The cross-compiler runs on a development machine, the host, to
produce machine-specific code that can execute on the target.

Prof. Dr. Faruk Bağcı


LINKER

• The linker is a tool that can compose an executable program


• resolving all the dependencies among the symbols used by the modules,
represented by the collection of object files provided as input
• The linker produces an ELF executable
• Executable and Linkable Format (ELF) is the default standard format for
programs, objects, and shared libraries
• ELF files are divided into sections
• each corresponding to specific areas in memory needed by the program to
execute
• The ELF file starts with a header, containing the pointer to the various
sections within the file itself, containing the program's code and data

Prof. Dr. Faruk Bağcı


BUILD AUTOMATION

• Make is the standard UNIX tool to automate the steps required to


create the required binary images from the sources, checking the
dependencies for each component, and executing the steps in the
right order.
• Make is a standard POSIX tool, and it is part of many UNIX-like
systems.
• When linking a bare-metal application for embedded platforms, the
makefile must be modified accordingly

Prof. Dr. Faruk Bağcı


DEBUGGER

• Debugging an application that runs on top of the operating system is done by


running a debugger tool
• The default debugging option provided by the GCC suite is called GDB, an
acronym for the GNU Debugger
• When the software to debug is running on a remote platform, remote debug is
performed
• A debug session on a remote target requires an intermediate tool that is
configured to translate GDB commands into actual actions on the core CPU,
and the related hardware infrastructure
• Some embedded platforms provide hardware breakpoints, which are used to
trigger system exceptions every time the selected instructions are executed

Prof. Dr. Faruk Bağcı


EMBEDDED WORKFLOW

Typical life cycle of application development

Prof. Dr. Faruk Bağcı


EMBEDDED WORKFLOW
The embedded development life cycle

Prof. Dr. Faruk Bağcı


POSIX

• POSIX: Stands for Portable Operating System Interface


• a group of standards that defines an API to maintain compatibility
between different operating Systems
• Posix for Unix-like operating systems was first made up of one
document for core programming interface, later it has grown to
19 document (POSIX.1, POSIX.2…etc.)
• However, nowadays most of Posix parts are combined into a
single standard

Prof. Dr. Faruk Bağcı


POSIX COMMAND LINE AND SCRIPTING

• Standard command line and scripting interface were based on


Korn shell.
• Also, many user-level programs services and utilities were
standardized along with program-level services (I/O, terminal,
network)

Prof. Dr. Faruk Bağcı


THREADING

• Posix defines a special threading library API which is supported


by most modern operating system
• POSIX Threads, usually referred to as Pthreads
• Implementations of the API are available on many Unix-like
POSIX-conformant operating systems such as GNU/Linux, Mac
OS X and Solaris
• Pthreads defines a set of C programming language types,
functions and constants
• It is implemented with a library.

Prof. Dr. Faruk Bağcı

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy