• No results found

Building Embedded Systems

N/A
N/A
Protected

Academic year: 2021

Share "Building Embedded Systems"

Copied!
32
0
0

Loading.... (view fulltext now)

Full text

(1)

Andreas Knirsch | [email protected]

Building Embedded Systems

(2)

fbi

Fachbereich Informatik

h_da

Agenda

• Motivation

• Startup

• Memory

• Optimization

(3)

icm

fbi

Fachbereich Informatik

h_da

Motivation

Why is the startup of ES

so important?

Building Embedded Systems

(4)

fbi

Fachbereich Informatik

h_da

Available „instant on“!

"Embedded software is software integrated

with physical processes."

[Lee, 2006]

However, the software must not have negative effect on

the physical process. This applies in particular to the

(5)

icm

fbi

Fachbereich Informatik

h_da

Startup

How does an

embedded system startup?

Building Embedded Systems

(6)

fbi

Fachbereich Informatik

h_da

Startup time is important.

But how …

• … does a system start?

• … to optimize the startup?

• … to implement this?

fundamentals

application

approach

(7)

icm

fbi

Fachbereich Informatik

h_da

When is a system up and running?

"When you can use it!“

(8)

fbi

Fachbereich Informatik

h_da

How does a System Start?

Reset Vector

Startup Code

OS

Application

1

2

3

4

(9)

icm

fbi

Fachbereich Informatik

h_da

Phase #1

Reset Vector

1

power-on, initialize hardware

(10)

fbi

Fachbereich Informatik

h_da

Phase #2

Startup Code

2

initialize further HW

(11)

icm

fbi

Fachbereich Informatik

h_da

Phase #3

OS

3

startup OS-kernel


(12)

fbi

Fachbereich Informatik

h_da

Phase #4

Application

4

the system 


becomes usable

(13)

icm

fbi

Fachbereich Informatik

h_da

Startup Overview

• Init HW

• Load* and start OS

• Init (even more) HW

• Load and start App(s)

(14)

fbi

Fachbereich Informatik

h_da

Memory

Copy data is an essential part

during system start.

Building Embedded Systems

(15)

icm

fbi

Fachbereich Informatik

h_da

Hyper

visor

OS 0

OS 1

Startup in detail

RBL

MMC

uboot

OS

UART

USB

NAND

APP

SPL

secondary program loader

ROM boot loader

(16)

fbi

Fachbereich Informatik

h_da

Load & Start the Kernel

CPU

RAM

FLASH

Power

Data

Addr

kernel initrd

(17)

IN-CAR MULTIMEDIA LABS, Andreas Knirsch | Building Embedded Systems

icm

In-Car Multimedia Labs

!

Hochschule Darmstadt www.h-da.de

fbi

Fachbereich Informatik

h_da

Flash != Flash: NAND / NOR

Toshiba NAND vs. NOR Flash Memory Technology Overview Page 2

Fig. 1 Comparison of NOR and NAND Flash

File Storage Use

Code Execution Read Speed Write Speed Capacity NOR NAND Cost-per-bit Active Power (*) Standby Power High Low Hard Easy Easy High Low High High Low High Low Low (*) :

Dependant on how memory is used. NOR is typically slow on writes and consumes more power than NAND. NOR is typically fast on reads, which consume less power.

The History of Flash Memory

As a recognized pioneer in flash technology, Toshiba was a principal innovator of both

NOR-type and NAND-NOR-type Flash technology in the 1980’s. These new memories were developed to

address the need for a non-volatile memory that is easily reprogrammable within a system. Some

kind of non-volatile memory is necessary for computing systems so that the system does not

erase all data every time it is powered down, or following a power failure. Both NOR and

NAND Flash systems are electrically erasable solutions, and can write and erase data many

times, but do not lose stored data when the power is turned off.

NAND and NOR Flash Memory Architecture

In the internal circuit configuration of NOR Flash, the individual memory cells are connected in

parallel, which enables the device to achieve random access. This configuration enables the

short read times required for the random access of microprocessor instructions. NOR Flash is

ideal for lower-density, high-speed read applications, which are mostly read only, often referred

to as code-storage applications.

NAND Flash was developed as an alternative optimized for high-density data storage, giving up

random access capability in a tradeoff to achieve a smaller cell size, which translates to a smaller

chip size and lower cost-per-bit. This was achieved by creating an array of eight memory

transistors connected in a series. Utilizing the NAND Flash architecture’s high storage density

and smaller cell size, NAND Flash systems enable faster write and erase by programming blocks

of data. NAND Flash is ideal for low-cost, high-density, high-speed program/erase applications,

often referred to as data-storage applications.

(18)

IN-CAR MULTIMEDIA LABS, Andreas Knirsch | Building Embedded Systems

icm

In-Car Multimedia Labs

!

Hochschule Darmstadt www.h-da.de

fbi

Fachbereich Informatik

h_da

Flash != Flash: NAND / NOR

[THOSHIBA: NAND vs. NOR Memory Technology Overview. White Paper.]

Toshiba NAND vs. NOR Flash Memory Technology Overview Page 3

NOR vs. NAND Flash Density

For any given lithography process, the density of the NAND Flash memory array will always be higher than NOR Flash. In theory, the highest density NAND will be at least twice the density of NOR, for the same process technology and chip size. In reality, market forces determine the

highest density that will be commercially produced. Today, comparing only single chip memory with one bit per cell (also called Single Level Cell, or SLC), the highest density NOR

commercially available is 256 megabit1 (Mb), while NAND is available in densities of 4 gigabit2 (Gb). Because cost-per-bit, which is closely related to the silicon real estate required, is one of the most important characteristics of memory, the small cell size characteristic of NAND Flash is a significant factor.

Choosing NAND vs. NOR

Toshiba continues to make both types of Flash memory, and recognizes that both forms have their own unique merits.

When should one choose NAND Flash over NOR Flash? The answer depends on the system

requirements. Figure 4 below compares NAND Flash with asynchronous NOR Flash in terms of various operating and performance characteristics:

SLC NAND Flash (x8) MLC NAND Flash (x8)

MLC NOR Flash (x16)

Density 512 Mbits1 – 4 Gbits2 1Gbit to 16Gbit 16Mbit to 1Gbit Read Speed 24 MB/s3 18.6 MB/s 103MB/s

Write Speed 8.0 MB/s 2.4 MB/s 0.47 MB/s Erase Time 2.0 mSec 2.0mSec 900mSec Interface I/O – indirect access I/O – indirect

access

Random access

Application Program/Data mass

storage

Program/Data mass storage

eXecuteInPlace

Figure 4: NAND and NOR Flash Operating Specifications

The characteristics of NAND Flash are: high density, medium read speed, high write speed, high erase speed, and an indirect or I/O like access. The characteristics of NOR Flash are lower

density, high read speed, slow write speed, slow erase speed, and a random access interface.

For a system that needs to boot out of Flash, execute code from the Flash, or if read latency is an issue, NOR Flash may be the answer. However, for storage applications, NAND Flash’s higher density, and high programming and erase speeds make it the best choice. While the benefit of high programming speed in high-density Flash devices is obvious, erase performance is equally important, though less obvious. Unlike magnetic memory systems (hard disk drives and tape drives), Flash memory requires a separate erasing step in order to turn all bits back to the “1” state before the device is programmed.

(19)

icm

fbi

Fachbereich Informatik

h_da

Optimization

How accelerate the

startup?

Building Embedded Systems

(20)

fbi

Fachbereich Informatik

h_da

How to accelerate the startup?

Upgrade

hard- and software

Avoidance

only the necessary

Parallelizing

utilize hardware

Prioritization

essentials first

Optimization

Knowledge

(21)

icm

fbi

Fachbereich Informatik

h_da

Approach: architecture

• Identify building blocks 


know the dependencies

!

• Order the tasks 


prioritization & avoidance

!

• Describe and visualize


UML, SysML etc.

(22)

fbi

Fachbereich Informatik

h_da

Approach: hardware

• Direct Memory Access (DMA) 


parallelize

!

• Simultaneous Multi-Threading (SMT) 


and Multicore


(23)

icm

fbi

Fachbereich Informatik

h_da

Approach: operating system

• Customize 


avoid unnecessary initialization/abstraction

• postpone the load of specific driver


prioritization

• utilize Hyper-Threading and SMP


parallelization

• Resume from image


avoid initialization

• exectue in place (XIP)


avoid copy to memory

(24)

fbi

Fachbereich Informatik

h_da

Approach: user application

• Customize libraries


avoid/disable unnecessary features

• Customize toolchain


make use of specific compiler and flags

• Multithread/-process


parallelization

• Resume from image


avoid initialization

(25)

icm

fbi

Fachbereich Informatik

h_da

Approach: system development

Strip-Down

(26)

fbi

Fachbereich Informatik

h_da

Approach: system development

• QNX System Builder


creates a well defined target system

• Linux From Scratch


step-by-step manual to build a Linux system

• Debian debootstrap


assembles a root system from prebuilt packages

• Buildroot


builds a toolchain, rootfs, kernel, bootloader-image

• openEmbedded (YOCTO)


(27)

icm

fbi

Fachbereich Informatik

h_da

Architecture

Hardware

Bootloader

Kernel

Libraries

Framework

Application(s)

Tools

1

2

3

4

(28)

fbi

Fachbereich Informatik

h_da

Recap: How does a System Start?

Reset Vector

Startup Code

OS

Application

1

2

3

4

(29)

icm

fbi

Fachbereich Informatik

h_da

Analyze

Hardware

Bootloader

Kernel

Libraries

Framework

Application(s)

Tools

1

2

3

4

t

cb wwarby (flickr.com)

(30)

fbi

Fachbereich Informatik

h_da

Low Hanging Fruits

• identify where optimization is most efficient


• do the „easy targets“ first


„... premature optimization is

the root of all evil ...“

(Donald E. Knuth, 1974)

(31)

icm

fbi

Fachbereich Informatik

h_da

References

Building Embedded Systems

(32)

Andreas Knirsch | [email protected]

Building Embedded Systems

References

Related documents

A multipage cell architecture for high-speed programming multilevel NAND flash memories, Solid-State Circuits, IEEE Journal of, vol. Fast parallel programming of multi-level NAND

 LogFS stores the tree structure in the flash device so that mounting time does not depend on the used capacity..  UBIFS mounting time is not affected by the

In this way, data end will be shifted by the number of invalid blocks reached during the programming (from that reason there is padding area used if partitioning)?.

• We offer free, expert guidance on the currency markets and help customers make transactions at the right time, offering highly competitive exchange rates.. • Our

High Speed Rail Assessment Project 2010 – 2012 http://www.jernbaneverket.no/no/Prosjekter/Hoyhastighetsutredningen / Tom Stillesby Project Manager Stavanger

U tim ranim danima, nasilje koje sam iskusila kao dete, kom- binovano sa osećanjem bezvrednosti koje sam tokom godina izgradila, privlačilo je muškarce koji su me

Achieving this initial weight loss goal will help to lower your risk for heart disease and other conditions, including high blood pressure, type 2 diabetes, osteoporosis, and

L: .IJIKLM KVMI TWLT KIQNUIJT ONTNeIJQ LKI TLSL\MI 9J NJO9YI RK9Y LMM Q9VKOIQ XNTWNJ .IJIKLM KVMI TWLT KIQNUIJT ONTNeIJQ LKI TLSL\MI 9J NJO9YI RK9Y LMM Q9VKOIQ XNTWNJ LJU