0% found this document useful (0 votes)
12 views50 pages

Chapter 3

Uploaded by

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

Chapter 3

Uploaded by

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

Chapter three: Embedded systems

development life cycles and tools


Design is the process of translating customer requirements into a
working system
Complexity of contemporary systems demands a formal approach
and formal methods.
Working from a formal specification of a problem, we will look at
ways of partitioning the system to developing a functional design
Then examine the process of mapping a functional model on to an
architectural structure and ultimately to a working prototype
1
Chapter three: Embedded systems
development life cycles and tools
Designing and developing embedded systems does raise some
interesting challenges and does require a large number of
decisions
Decisions require knowledge about
The problem
 Tools and techniques that may be available
Methods for approaching the solution

2
Life Cycle Models

Product life cycle of an embedded application is purely a


descriptive representation
It breaks the development process into a series of interrelated
activities
Each activity plays a role of transforming its input (specification)
into an output (a selected solution)
The organization of the steps is done according to a design process
model – the life cycle model
3
Life Cycle Models

There are different models used in the life cycle of embedded


system design and development
They all have similar needs or objectives or goals
This needs are
Find out what the customer wants
Think of a way to give them what they want
Prove it by building and testing
4
Life Cycle Models

Build a lot of them to prove that it wasn’t an accident


Use the product to solve the customer’s problem

5
Common Models

Waterfall
V Cycle
Spiral
Rapid Prototype

6
Common Models

Important point is to understand the meaning and intent of each of


the phases in the process
Addressing reliability and safety early in the requirements
specification and design phases of the life cycle is important
In designing embedded system in addition to four models
mentioned above we should also consider hockey stick model or
curve that is used for time and cost analysis

7
Common Models

Hockey stick model The more delay you make the


more cost you invest
Cost
This cost may not only be
direct cost your are investing it
could also be time value of the
money

Time axis
8
The Waterfall Model

The Waterfall model represents a cycle – specifically, a series of


steps appearing much like a waterfall, sequentially, one below the
next
Successive steps are linked like a chain
Each phase is also connected to the previous phase
That reverse connection provides an essential verification link
backwards to ensure that the solution agrees with and follows from
the specification
9
The Waterfall Model diagram

10
The Waterfall Model

With the Waterfall model, the recognition of problems can be


delayed until later stages of development where the cost of repair is
higher (the hockey stick curve)
The Waterfall model is limited in the sense that it does not consider
the typically iterative nature of real-world design

11
The V Cycle Model

The V Cycle is similar to the Waterfall model except that it places


greater emphasis on the importance of addressing testing activities
up front instead of later in the life cycle
Each stage associates the development activity for that phase with
a test or validation at the same level
Each test phase is identified with its matching development phase

12
The V Cycle Model diagram

13
The V Cycle Model

Each development activity builds a more detailed model of the


system
Each verification step tests a more complete implementation of the
system against the requirements at that phase
The development concludes the design and design-related test
portion of the development cycle of the system with both a
verification and a validation test against the original specification

14
The Spiral Model

The Spiral model was proposed and developed by Barry Boehm in


A Spiral Model of Software Development and Enhancement
(Computer, May 1988)
The model takes a risk-oriented view of the development life cycle
Each spiral addresses the major risks that have been identified

15
The Spiral Model

Its philosophy is
To start small,
Explore the risks,
Develop a plan to deal with the risks and
Commit to an approach for the next iteration
The cycle continues until the product is complete.

16
The Spiral Model diagram

17
Rapid Prototyping – Incremental

The Rapid Prototyping model is intended to provide a rapid


implementation of high-level portions of both the software and the
hardware early in the project
The approach allows developers to construct working portions of
the hardware and software in incremental stages
At each stage through the cycle, one incorporates a little more of
the intended functionality

18
Rapid Prototyping – Incremental

It enables the designer to start early development of major pieces


of the intended functionality of system
It gives opportunity to customer to work with a functional unit much
earlier in the development cycle than with any of the three previous
models
Such feedback is a critical aspect of the approach because it
encourages backwards or reverse flow through the process

19
PROBLEM SOLVING – SIX STEPS TO DESIGN

When we begin the design of a new product or have to incorporate


several new features or capabilities into an existing one, we begin
with a set of requirements
The goal is to map those requirements – the real world – through a
series of transformations into a solution – the abstract world
During the design process, we move from the concrete, real world
into the abstract.
Good system designers and successful projects generally proceed
using a minimum of six steps 20
PROBLEM SOLVING – SIX STEPS TO DESIGN

Requirements definition
System specification
Functional design
Architectural design
Prototyping
Test

21
PROBLEM SOLVING – SIX STEPS TO DESIGN

Traceability in both the forward and reverse directions must be


considered
Traceability captures the relationships between requirements and
all subsequent design data and helps in managing requirements
changes

22
Embedded systems development tools

A real-time operating system (RTOS) is key to many embedded


systems today and, provides a software platform upon which to
build applications
Not all embedded applications are designed with RTOS
 Many embedded systems with moderate-to-large software
applications require some form of scheduling, and these systems
require an RTOS

23
Embedded systems development tools
… Continued
A real-time operating system (RTOS) is a program that
Schedules execution in a timely manner,
Manages system resources, and
Provides a consistent foundation for developing application
code
Application code designed on an RTOS can be quite diverse,
ranging from a simple application for a digital stopwatch to a much
more complex application for aircraft navigation/ remote surgery
24
Embedded systems development tools
… Continued
An RTOS comes in two basic flavors: kernels and full operating
systems
A kernel usually implements the basic task and memory
management functions
A full operating system may have drivers for disk drives, serial
ports, and other common resources

25
Embedded systems development tools
… Continued
Most RTOS kernels contain the following components
Scheduler-is contained within each kernel and follows a set of
algorithms that determines which task executes when
Objects-are special kernel constructs that help developers
create applications for real-time embedded systems
Services-are operations that the kernel performs on an object
or, generally operations such as timing, interrupt handling, and
resource management
26
Embedded systems development tools
… Continued
RTOSs are best suited for real-time, application-specific embedded
systems
Kernels are the core module of every RTOS
Kernels can deploy different algorithms for task scheduling
RTOSs for real-time embedded systems should be reliable,
predictable, high performance, compact, and scalable

27
Logic Analyzer

The logic analyzer is an extremely powerful tool for examining


digital systems
It is used to debug real time embedded system without
“significantly” perturbing the system
The logic analyzer has two basic modes of operation:
 Timing and
 State

28
Logic Analyzer … Continued

In timing mode,


An internal high-speed clock determines when the memory of
the logic analyzer takes a snapshot of the state of the
processor, or processor and other digital signals in the system
A snapshot is just the voltage, or logic level, on every pin of the
processor
Snapshot is taken at a sufficiently high capture rate so that you
can see the timing relationships between the various processor
bus signals 29
Logic Analyzer … Continued

In timing mode,


The logic analyzer clock allows you to measure the transition
times of the various digital signals
To make this recording, you just assign each logic analyzer
probe to one of the pins of the processor intended to be
analyzed

30
Logic Analyzer … Continued

State mode,
Operational mode of the logic analyzer can be changed by
using the microprocessor clock to provide the signal to capture
a state
Each time the processor clock rises from low to high, you
capture the state of the pins of the processor and write that to
the logic analyzer memory
Most logic analyzers are available with software
31
Logic Analyzer … Continued

This software is called disassembler


Capable of reducing the raw data recorded by the logic analyzer
Represent recorded raw data in tabular form as
Assembly language mnemonic instruction,
Address information,
Operand reads and writes, and
Special status information, such as interrupt service instruction cycles
32
Logic Analyzer … Continued

By post-processing the raw trace, either on the host or in the logic analyzer
itself, the information is distilled
From the state of all the processor pins on every clock cycle to
Bus cycles,
Assembly language instructions, and
Finally to C source statements

33
Logic Analyzer … Continued

Like any trace-based debugging, debugging with a logic analyzer trace is


efficient only if the programmer can select which part of the trace to view
Triggers are the basic mechanisms for selectively controlling which part of
the execution history the logic analyzer reports
Trigger system is among the most complex hardware circuitry because the
sequence of code execution states and data values that can lead to a
trigger event of interest also can be extremely complex and convoluted.
The trigger system also must be able to deal with various combinations of
the address, data, and status information 34
Compilers and Programming
Environments
Before starting discussing about programming environment and compilers
it would be good if software architecture and programming languages are
introduced
Embedded system software usually is built on only a few architectural
frameworks
These frameworks are:
Single Polling Loop, State Machine, Multiple State Machines/ Polling
Loop, Incremental State Machine, and RTOS
35
Compilers and Programming
Environments … Continued
Single Polling Loop
Single piece of polling code loops continuously, checking for input from
external devices (such as a keypad) and executing whatever
subroutines are necessary to implement the functionality
This method of coding assumes that all functions are available all the
time

36
Compilers and Programming
Environments … Continued
State Machine
The software is in one state at a time and only those functions that
pertain to the current state are monitored
This method has the advantage of classifying the functionality
Every state has its own unique code and you can change the code for a
particular state without affecting the code for any other state
The disadvantages to this method are that there usually is a lot of
duplication
37
Compilers and Programming
Environments … Continued
Multiple State Machines/ Polling Loop
Each process can have unique states
A polling loop goes to each process, which then branches to code for
the particular state it is in
When done, the process code exits to the next process
The pool timer uses this method for activity status checks based on
timer rollover
What happens after that depends on whether the code is in powerfail,
time set, or normal timekeeping mode (state)
38
Compilers and Programming
Environments … Continued
Incremental State Machine
Each process executes a few steps of whatever operation it performs in
whatever state it is in; it then transfers control to the next process
Each process also keeps track of where in its internal sequence it is
The next time the process is executed, it takes up where it left off and
executes a few more steps
This gives all processes the appearance of executing simultaneously,
although slowly
39
Compilers and Programming
Environments … Continued
RTOSs
RTOS allows the code to manage tasks by starting and stopping them
based on priority or time
For example, the code to communicate with another system might be
activated only if there are data to send

40
Compilers and Programming
Environments … Continued
The Development Language
At system level everything works with machine code, i.e, ones and
zeros
Understanding and recalling machine level language is cumbersome
and difficult to recall
Then a low level programming language is developed to deal with
processor and makes programming a bit handy
This low level programming language that provides access to hardware
is called Assembly language 41
Compilers and Programming
Environments … Continued
Different processors have different sets of instructions used for
assembly language programming
But still the machines are dealing with machine code where translation
of assembly language to machine code is mandatory
The translator that translate assembly code to machine code is
assembler
Understanding and implementing embedded system using assembly
language is big asset for embedded system developer
42
Compilers and Programming
Environments … Continued
For complex design, however, it is difficult to use assembly language for
programming
In addition to that if in future the processor is going to change then it
might require to rewrite the assembly code for the new processor which
is time consuming and requires additional cost
So high-level language like C and C++ … and others are also important
for development of application software for embedded system

43
Compilers and Programming
Environments … Continued
While selecting the programming language the following should be
considered
Processors Supported
Emulator Support
Code/ Storage Size
Optimization
Assembly Support and others
44
Compilers and Programming
Environments … Continued
Any source code written by any language needs to be translated into
machine code, since machine code is the only language the hardware
can directly execute
 All languages except machine language need development tools that
generate the corresponding machine code the hardware will understand
This mechanism usually includes one or some combination of
preprocessing, translation, and/or interpretation of machine code
generation techniques
45
Compilers and Programming
Environments … Continued
The preprocessor’s role is to organize and restructure the source code
to make translation or interpretation of this code easier
Many languages convert source code, either directly or after having
been preprocessed, to target code through the use of a compiler
Compiler is a program which generates some target language, such as
machine code and Java byte code, from the source language, such as
assembly, C and Java.

46
Compilers and Programming
Environments … Continued

47
Compilers and Programming
Environments … Continued
A compiler typically translates all of the source code to a target code at
one time
Most compilers are located on the programmer’s host machine and
generate target code for hardware platforms that differ from the platform
the compiler is actually running on
These compilers are commonly referred to as cross-compilers
In the case of assembly, an assembly compiler is a specialized cross-
compiler referred to as an assembler
48
Compilers and Programming
Environments … Continued
In case of C programming language compiler generates object file
which later on linked with C system libraries to generate executable file
The executable binary file can created either directly onto the board’s
memory or ready to be transferred to the target embedded system’s
memory by a loader

49
Compilers and Programming
Environments … Continued

50

You might also like