embed your ideas

163
© 1 Embedded Software Made Easy Embed your Ideas

Upload: julio-guerra

Post on 15-Apr-2017

89 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Embed your Ideas

© 1

Embedded Software Made Easy

Embed your Ideas

Page 2: Embed your Ideas

Embedded Software Made Easy

A connected chief hat reading you a recipe you selected by voice control and waiting you at each step with a voice signal before continuing to the next one.

Let’s take an example

2

Page 3: Embed your Ideas

Embedded Software Made Easy

The following content is • Under the software point-of-view. • Is simplified for a broader audience. • Opinionated by 25 years of farjump’s team

experience.

Warning

3

Page 4: Embed your Ideas

Embedded Software Made Easy 4

Before we get started: Hardware vs Software

Hardware

Page 5: Embed your Ideas

Embedded Software Made Easy 4

Before we get started: Hardware vs Software

Hardware

General-PurposeSingle-Purpose

Page 6: Embed your Ideas

Embedded Software Made Easy 4

Before we get started: Hardware vs Software

Hardware

CPUMCUASIC GPU

General-Purpose

DSP

Single-Purpose

I/O Peripheral

Page 7: Embed your Ideas

Embedded Software Made Easy 4

Before we get started: Hardware vs Software

Hardware

CPUMCUASIC GPU

General-Purpose

DSP

Single-Purpose

I/O Peripheral

May contain a General-Purpose CPU

Page 8: Embed your Ideas

Embedded Software Made Easy 5

Before we get started: Hardware vs Software

Hardware

Page 9: Embed your Ideas

Embedded Software Made Easy 5

Before we get started: Hardware vs Software

Hardware

ComputingI/O

Page 10: Embed your Ideas

Embedded Software Made Easy 5

Before we get started: Hardware vs Software

Hardware

ASIC GPU

Computing

DSP

I/O

I/O Peripheral

Page 11: Embed your Ideas

Embedded Software Made Easy 5

Before we get started: Hardware vs Software

Hardware

CPUMCUASIC GPU

Computing

DSP

I/O

I/O Peripheral

Page 12: Embed your Ideas

Embedded Software Made Easy 5

Before we get started: Hardware vs Software

Hardware

CPUMCUASIC GPU

Computing

DSP

The Hardware/Software Interface (HSI)

I/O

I/O Peripheral

Page 13: Embed your Ideas

Embedded Software Made Easy 5

Before we get started: Hardware vs Software

Hardware

CPUMCUASIC GPU

Computing

DSP

The Hardware/Software Interface (HSI)

I/O

We (the software people) are here

I/O Peripheral

Page 14: Embed your Ideas

Embedded Software Made Easy 5

Before we get started: Hardware vs Software

Hardware

CPUMCUASIC GPU

Computing

DSP

The Hardware/Software Interface (HSI)

I/O

We (the software people) are here

I/O Peripheral

Managed by internal (embedded) software

Page 15: Embed your Ideas

Embedded Software Made Easy 5

Before we get started: Hardware vs Software

Hardware

CPUMCUASIC GPU

Computing

DSP

The Hardware/Software Interface (HSI)

I/O

We (the software people) are here

I/O Peripheral

Managed by internal (embedded) softwareExternally controlled by

Computing Hardware

Page 16: Embed your Ideas

Embedded Software Made Easy

System-on-Chip (SoC)

Before we get started: Hardware vs Software

T h e g e n e r a l - p u r p o s e computing hardware you deal with is in fact compound of many specialised sub-units.

CPU

I/OCoreI/O

6

Tree map of usual sub-units in a SoC

MCU

CPU

I/OCoreI/O

Tree map of usual sub-units in a MCU

Memory

Page 17: Embed your Ideas

Embedded Software Made Easy

System-on-Chip (SoC)

Before we get started: Hardware vs Software

T h e g e n e r a l - p u r p o s e computing hardware you deal with is in fact compound of many specialised sub-units.

CPU

I/OCoreI/O

6

Tree map of usual sub-units in a SoC

Somehow, this is your software which specialises it. Once it is

embedded in a closed system, its purpose is fixed.

MCU

CPU

I/OCoreI/O

Tree map of usual sub-units in a MCU

Memory

Page 18: Embed your Ideas

Embedded Software Made Easy 7

Before we get started: Hardware vs Software

Example of an ARM SoC

Page 19: Embed your Ideas

Embedded Software Made Easy 8

Before we get started: Hardware vs Software

Example of the Intel 8021 Microcontroller

Page 20: Embed your Ideas

Embedded Software Made Easy 9

Before we get started: Hardware vs Software

HSI

Level of Software

Abstraction

Hardware

Page 21: Embed your Ideas

Embedded Software Made Easy 9

Before we get started: Hardware vs Software

Low-Level Software

HSI

Level of Software

Abstraction

Hardware

Page 22: Embed your Ideas

Embedded Software Made Easy 9

Before we get started: Hardware vs Software

Low-Level Software

HSI

FirmwareBare-metal

Level of Software

AbstractionSystem Call

Operating System

Hardware

Page 23: Embed your Ideas

Embedded Software Made Easy 9

Before we get started: Hardware vs Software

Low-Level Software

HSI

FirmwareBare-metal

Level of Software

Abstraction

API

System Call

Runtime SystemLibrary

Operating System

Hardware

OS Service

Page 24: Embed your Ideas

Embedded Software Made Easy 9

Before we get started: Hardware vs Software

Low-Level Software

HSI

FirmwareBare-metal

Level of Software

Abstraction

API

System Call

Runtime SystemLibrary

Program

Operating System

Hardware

OS Service

Page 25: Embed your Ideas

Embedded Software Made Easy 9

Before we get started: Hardware vs Software

Low-Level Software

HSI

FirmwareBare-metal

Level of Software

Abstraction

API

System Call

Runtime SystemLibrary

Program

Operating System

Hardware

Be very careful with that…

OS Service

Page 26: Embed your Ideas

Embedded Software Made Easy

Challenge #1 - How do I know what should be software and hardware?

10

Page 27: Embed your Ideas

Embedded Software Made Easy

We need to break down the idea.

Challenge #1 - How do I know what should be software and hardware?

10

Page 28: Embed your Ideas

Embedded Software Made Easy

We need to break down the idea.

Challenge #1 - How do I know what should be software and hardware?

10

Page 29: Embed your Ideas

Embedded Software Made Easy

We need to break down the idea.

Challenge #1 - How do I know what should be software and hardware?

10

Recipe Search Recipe ReadingPower Button

Page 30: Embed your Ideas

Embedded Software Made Easy

We need to break down the idea.

Challenge #1 - How do I know what should be software and hardware?

10

Recipe Search Recipe ReadingPower Button

Note that these are the user interfaces…

Is that enough…?

Page 31: Embed your Ideas

Embedded Software Made Easy

Challenge #1 - How do I know what should be software and hardware?

11

Recipe Search

Page 32: Embed your Ideas

Embedded Software Made Easy

Challenge #1 - How do I know what should be software and hardware?

11

Speech Recognition

Recipe Search

Text-to-Speech

Page 33: Embed your Ideas

Embedded Software Made Easy

Challenge #1 - How do I know what should be software and hardware?

11

Speech Recognition

Recipe Search

Text-to-Speech

Microphone

Page 34: Embed your Ideas

Embedded Software Made Easy

Challenge #1 - How do I know what should be software and hardware?

11

Speech Recognition

Speaker

Recipe Search

Text-to-Speech

Microphone

Page 35: Embed your Ideas

Embedded Software Made Easy

Challenge #1 - How do I know what should be software and hardware?

11

Speech Recognition

Speaker

Recipe Search

Text-to-Speech

Microphone

Hardware

Software

Page 36: Embed your Ideas

Embedded Software Made Easy

Hardware

Software

Challenge #1 - How do I know what should be software and hardware?

12

Recipe Reading

Speech Recognition

Speaker

Step-by-Step Processing

Text-to-Speech

Microphone

Page 37: Embed your Ideas

Embedded Software Made Easy

Software

Hardware

Challenge #1 - How do I know what should be software and hardware?

13

Power Button

Boot Usually handled by an OS driver

Power On Power Off

Power Unit

Power Events

Usually handled by a firmware and

bootloader

Page 38: Embed your Ideas

Embedded Software Made Easy

Challenge #1 - How do I know what should be software and hardware?

14

The basic general picture for now

Page 39: Embed your Ideas

Embedded Software Made Easy

Challenge #1 - How do I know what should be software and hardware?

14

Drivers

Power Button Speaker Microphone

CPU

Text-to-Speech Speech Recognition

HSI

The basic general picture for now

Recipe Search Recipe Reading

Page 40: Embed your Ideas

Embedded Software Made Easy

Hardware

Challenge #1 - How do I know what should be software and hardware?

14

Drivers

Power Button Speaker Microphone

CPU

Text-to-Speech Speech Recognition

HSI

The basic general picture for now

Recipe Search Recipe Reading

Page 41: Embed your Ideas

Embedded Software Made Easy

Hardware

I/Os

Challenge #1 - How do I know what should be software and hardware?

14

Drivers

Power Button Speaker Microphone

CPU

Text-to-Speech Speech Recognition

HSI

The basic general picture for now

Recipe Search Recipe Reading

Page 42: Embed your Ideas

Embedded Software Made Easy

Hardware

Computing

I/Os

Challenge #1 - How do I know what should be software and hardware?

14

Drivers

Power Button Speaker Microphone

CPU

Text-to-Speech Speech Recognition

HSI

The basic general picture for now

Recipe Search Recipe Reading

Page 43: Embed your Ideas

Embedded Software Made Easy

Software

Hardware

Computing

I/Os

Challenge #1 - How do I know what should be software and hardware?

14

Drivers

Power Button Speaker Microphone

CPU

Text-to-Speech Speech Recognition

HSI

The basic general picture for now

Recipe Search Recipe Reading

Page 44: Embed your Ideas

Embedded Software Made Easy

Software

Hardware

Computing

I/Os

Challenge #1 - How do I know what should be software and hardware?

14

Drivers

Power Button Speaker Microphone

CPU

Text-to-Speech Speech Recognition

HSI

Executed by a CPU

The basic general picture for now

Recipe Search Recipe Reading

Page 45: Embed your Ideas

Embedded Software Made Easy

Software

Hardware

Computing

I/Os

Challenge #1 - How do I know what should be software and hardware?

14

Drivers

Power Button Speaker Microphone

CPU

Text-to-Speech Speech Recognition

HSI

Managed by drivers

Executed by a CPU

The basic general picture for now

Recipe Search Recipe Reading

Page 46: Embed your Ideas

Embedded Software Made Easy

Software

Hardware

Computing

I/Os

Challenge #1 - How do I know what should be software and hardware?

15

Drivers

Power Button Speaker Microphone

CPU

Text-to-Speech Speech Recognition

HSI

But we still don’t know what it exactly looks like…

Recipe Search Recipe Reading

Page 47: Embed your Ideas

Embedded Software Made Easy

Software

Hardware

Computing

I/Os

Challenge #1 - How do I know what should be software and hardware?

15

Drivers

Power Button Speaker Microphone

CPU

Text-to-Speech Speech Recognition

HSI

Which exact I/Os?

But we still don’t know what it exactly looks like…

Recipe Search Recipe Reading

Page 48: Embed your Ideas

Embedded Software Made Easy

Software

Hardware

Computing

I/Os

Challenge #1 - How do I know what should be software and hardware?

15

Drivers

Power Button Speaker Microphone

CPU

Text-to-Speech Speech Recognition

HSI

Which exact CPU? Which exact I/Os?

But we still don’t know what it exactly looks like…

Recipe Search Recipe Reading

Page 49: Embed your Ideas

Embedded Software Made Easy 16

We need to scale the hardware to our precise needs.

Challenge #2 - How do I select the hardware?

Page 50: Embed your Ideas

Embedded Software Made Easy 16

We need to scale the hardware to our precise needs.

Challenge #2 - How do I select the hardware?

Having a « chicken and egg » problem?

Page 51: Embed your Ideas

Embedded Software Made Easy 17

Challenge #2 - How do I select the hardware?

Page 52: Embed your Ideas

Embedded Software Made Easy 17

Use an empirical approach by prototyping starting from the first observations & deductions. Then test & evaluate and repeat further specifying your hardware until you reach your local optimum.

Challenge #2 - How do I select the hardware?

Page 53: Embed your Ideas

Embedded Software Made Easy 17

Use an empirical approach by prototyping starting from the first observations & deductions. Then test & evaluate and repeat further specifying your hardware until you reach your local optimum.

Challenge #2 - How do I select the hardware?

Page 54: Embed your Ideas

Embedded Software Made Easy 17

Use an empirical approach by prototyping starting from the first observations & deductions. Then test & evaluate and repeat further specifying your hardware until you reach your local optimum.

When you have no idea of a starting point, start with an XXL superset of hardware, rich enough to run your idea, and create a functional prototype.

Challenge #2 - How do I select the hardware?

Page 55: Embed your Ideas

Embedded Software Made Easy 18

Challenge #2 - How do I select the hardware?

Page 56: Embed your Ideas

Embedded Software Made Easy 18

Note that:• This process can be endless. It only depends on

what you are trying to accomplish. So be as lean as possible here ;-)

Challenge #2 - How do I select the hardware?

Page 57: Embed your Ideas

Embedded Software Made Easy 18

Note that:• This process can be endless. It only depends on

what you are trying to accomplish. So be as lean as possible here ;-)

• This is the moment where you may start doing hardware development in parallel of your software development: once the hardware chosen, the hardware team keeps further specifying it while you can start the software development.

Challenge #2 - How do I select the hardware?

Page 58: Embed your Ideas

Embedded Software Made Easy 19

Challenge #2 - How do I select the hardware?

Page 59: Embed your Ideas

Embedded Software Made Easy 19

In any case, the overall goal here is to make compromises between:

Challenge #2 - How do I select the hardware?

Page 60: Embed your Ideas

Embedded Software Made Easy 19

In any case, the overall goal here is to make compromises between:

• Your physical constraints (space, weight, power, etc.).

Challenge #2 - How do I select the hardware?

Page 61: Embed your Ideas

Embedded Software Made Easy 19

In any case, the overall goal here is to make compromises between:

• Your physical constraints (space, weight, power, etc.).• Your I/O requirements, including the interfaces with the

CPU.

Challenge #2 - How do I select the hardware?

Page 62: Embed your Ideas

Embedded Software Made Easy 19

In any case, the overall goal here is to make compromises between:

• Your physical constraints (space, weight, power, etc.).• Your I/O requirements, including the interfaces with the

CPU.• Your computing requirements.

Challenge #2 - How do I select the hardware?

Page 63: Embed your Ideas

Embedded Software Made Easy 19

In any case, the overall goal here is to make compromises between:

• Your physical constraints (space, weight, power, etc.).• Your I/O requirements, including the interfaces with the

CPU.• Your computing requirements.

And only targeting the current stage of your product:

Challenge #2 - How do I select the hardware?

Page 64: Embed your Ideas

Embedded Software Made Easy 19

In any case, the overall goal here is to make compromises between:

• Your physical constraints (space, weight, power, etc.).• Your I/O requirements, including the interfaces with the

CPU.• Your computing requirements.

And only targeting the current stage of your product:

1. Research

Challenge #2 - How do I select the hardware?

Page 65: Embed your Ideas

Embedded Software Made Easy 19

In any case, the overall goal here is to make compromises between:

• Your physical constraints (space, weight, power, etc.).• Your I/O requirements, including the interfaces with the

CPU.• Your computing requirements.

And only targeting the current stage of your product:

1. Research

2. Development

Challenge #2 - How do I select the hardware?

Page 66: Embed your Ideas

Embedded Software Made Easy 19

In any case, the overall goal here is to make compromises between:

• Your physical constraints (space, weight, power, etc.).• Your I/O requirements, including the interfaces with the

CPU.• Your computing requirements.

And only targeting the current stage of your product:

1. Research

2. Development

3. Production

Challenge #2 - How do I select the hardware?

Page 67: Embed your Ideas

Embedded Software Made Easy 20

Challenge #2 - How do I select the hardware?

Page 68: Embed your Ideas

Embedded Software Made Easy 20

The IoT gives us a very unique chance in the embedded world: it has the same I/O interfaces and peripheral as our mainstream general-purpose personal computers.

Challenge #2 - How do I select the hardware?

Page 69: Embed your Ideas

Embedded Software Made Easy 20

The IoT gives us a very unique chance in the embedded world: it has the same I/O interfaces and peripheral as our mainstream general-purpose personal computers.

Which means that you can connect your IoT I/O peripherals to your own workstation to start prototyping!

Challenge #2 - How do I select the hardware?

Functional Prototype

Your OS

Your Workstation

Text-to-Speech Speech Recognition

Hardware

Recipe Search Recipe Reading

Software

Page 70: Embed your Ideas

Embedded Software Made Easy 20

The IoT gives us a very unique chance in the embedded world: it has the same I/O interfaces and peripheral as our mainstream general-purpose personal computers.

Which means that you can connect your IoT I/O peripherals to your own workstation to start prototyping!

Challenge #2 - How do I select the hardware?

Functional Prototype

Your OS

Your Workstation

Text-to-Speech Speech Recognition

Hardware

Recipe Search Recipe Reading

Software

Assuming your OS has the driver (otherwise

implement it?)…

Page 71: Embed your Ideas

Embedded Software Made Easy 21

Going back to our chief hat!

Challenge #2 - How do I select the hardware?

Page 72: Embed your Ideas

Embedded Software Made Easy 22

I/O Requirements

Challenge #2 - How do I select the hardware?

Page 73: Embed your Ideas

Embedded Software Made Easy

Challenge #2 - How do I select the hardware?

23

It is made of single-purpose hardware which are selected according to their characteristics and our requirements.

I/OsPower Button Speaker Microphone

Page 74: Embed your Ideas

Embedded Software Made Easy

Challenge #2 - How do I select the hardware?

23

It is made of single-purpose hardware which are selected according to their characteristics and our requirements.

I/OsPower Button Speaker Microphone

A push button A speaker for human ears…

A mic for human sounds…

Page 75: Embed your Ideas

Embedded Software Made Easy

Challenge #2 - How do I select the hardware?

24

I/OsPower Button Speaker Microphone

A push button A speaker for human ears…

A mic for human sounds…

Page 76: Embed your Ideas

Embedded Software Made Easy

Challenge #2 - How do I select the hardware?

24

It gives us our first CPU requirements:

I/OsPower Button Speaker Microphone

A push button A speaker for human ears…

A mic for human sounds…

Page 77: Embed your Ideas

Embedded Software Made Easy

Challenge #2 - How do I select the hardware?

24

It gives us our first CPU requirements:• They must be somehow connected to the CPU

using their interfaces (SPI, USB, PCIe…).

I/OsPower Button Speaker Microphone

A push button A speaker for human ears…

A mic for human sounds…

Page 78: Embed your Ideas

Embedded Software Made Easy

Challenge #2 - How do I select the hardware?

24

It gives us our first CPU requirements:• They must be somehow connected to the CPU

using their interfaces (SPI, USB, PCIe…).• They have bandwidth requirements of several

kbits/s.

I/OsPower Button Speaker Microphone

A push button A speaker for human ears…

A mic for human sounds…

Page 79: Embed your Ideas

Embedded Software Made Easy 25

Computing Requirements

Challenge #2 - How do I select the hardware?

Page 80: Embed your Ideas

Embedded Software Made Easy 26

Challenge #2 - How do I select the hardware?

Page 81: Embed your Ideas

Embedded Software Made Easy 26

Select a processor according to: • The kind of software you need to execute. • Your I/Os requirements. • Your physical constraints (power

consumption, temperature, etc.).

Challenge #2 - How do I select the hardware?

Page 82: Embed your Ideas

Embedded Software Made Easy 27

Challenge #2 - How do I select the hardware?

Page 83: Embed your Ideas

Embedded Software Made Easy 27

There are two main kind of processors:

Challenge #2 - How do I select the hardware?

Page 84: Embed your Ideas

Embedded Software Made Easy 27

There are two main kind of processors:• Computing-oriented: fast CPU with lots of

fast memory for CPU-bound programs (e.g., image processing).

Challenge #2 - How do I select the hardware?

Page 85: Embed your Ideas

Embedded Software Made Easy 27

There are two main kind of processors:• Computing-oriented: fast CPU with lots of

fast memory for CPU-bound programs (e.g., image processing).

• I/O-oriented: large I/O bandwidth, optimised I/O bridge for I/O-bound programs (e.g., a web server).

Challenge #2 - How do I select the hardware?

Page 86: Embed your Ideas

Embedded Software Made Easy 28

• CPU-bound programs scale according to the computing power of the CPU.

• I/O-bound programs scale according to the power of the CPU required to manage these I/Os.

Challenge #2 - How do I select the hardware?

Page 87: Embed your Ideas

Embedded Software Made Easy 29

So what kind of software do we run?

Challenge #2 - How do I select the hardware?

Drivers

Text-to-Speech Speech Recognition

Recipe Search Recipe ReadingAt run-time, most of the execution time will be probably spent in the speech algorithms. Which makes this software CPU-bound.

Page 88: Embed your Ideas

Embedded Software Made Easy 30

So what kind of software do we run?

Challenge #2 - How do I select the hardware?

Drivers

Text-to-Speech Speech Recognition

Recipe Search Recipe ReadingOr not? Speech recognition is complex enough to require a huge amount of computing power we can’t afford in our embedded system. So let’s make benefit from the « I » of IoT and let’s implement this unit in the cloud.

Page 89: Embed your Ideas

Embedded Software Made Easy 31

So what kind of software do we run?

Challenge #2 - How do I select the hardware?

Drivers

Text-to-Speech Speech Recognition

Recipe Search Recipe ReadingSo now, most of its execution time is spent waiting for I/Os to complete: sending requests to a speech server in the cloud and driving the speakers & microphone. Our software is I/O-bound.

Page 90: Embed your Ideas

Embedded Software Made Easy 32

And don’t forget about the new hardware and

software now required:

Challenge #2 - How do I select the hardware?

Software

Hardware

Computing

I/Os

Drivers

Power Button Speaker Microphone

CPU

Text-to-Speech Speech Recognition

HSI

Recipe Search Recipe Reading

Network Interface Controller

Network Stack

Page 91: Embed your Ideas

Embedded Software Made Easy 33

Challenge #2 - How do I select the hardware?

Page 92: Embed your Ideas

Embedded Software Made Easy 33

Our CPU should include:

Challenge #2 - How do I select the hardware?

Page 93: Embed your Ideas

Embedded Software Made Easy 33

Our CPU should include:• The interfaces required to connect with our I/

O peripherals, unless already present in the selected CPU/SoC/MCU.

Challenge #2 - How do I select the hardware?

Page 94: Embed your Ideas

Embedded Software Made Easy 33

Our CPU should include:• The interfaces required to connect with our I/

O peripherals, unless already present in the selected CPU/SoC/MCU.

• Enough computing and I/O power to run our peripherals and our software fast enough for audio processing.

Challenge #2 - How do I select the hardware?

Page 95: Embed your Ideas

Embedded Software Made Easy 34

Running benchmarks are necessary when you have to further refine your assumptions to get closer to the perfect hardware set.

Challenge #2 - How do I select the hardware?

Page 96: Embed your Ideas

Embedded Software Made Easy 35

Challenge #2 - How do I select the hardware?

Page 97: Embed your Ideas

Embedded Software Made Easy 35

Running benchmarks in a bare-metal execution environment is a good practice to:

Challenge #2 - How do I select the hardware?

Page 98: Embed your Ideas

Embedded Software Made Easy 35

Running benchmarks in a bare-metal execution environment is a good practice to:

• Be alone in the CPU and get rid of hardware side-effects coming from concurrent or parallel software.

Challenge #2 - How do I select the hardware?

Page 99: Embed your Ideas

Embedded Software Made Easy 35

Running benchmarks in a bare-metal execution environment is a good practice to:

• Be alone in the CPU and get rid of hardware side-effects coming from concurrent or parallel software.

• Be at the lowest software abstraction level, above the HSI, to fully understand what’s going on during the benchmark.

Challenge #2 - How do I select the hardware?

Page 100: Embed your Ideas

Embedded Software Made Easy 35

Running benchmarks in a bare-metal execution environment is a good practice to:

• Be alone in the CPU and get rid of hardware side-effects coming from concurrent or parallel software.

• Be at the lowest software abstraction level, above the HSI, to fully understand what’s going on during the benchmark.

• Do whatever you want.

Challenge #2 - How do I select the hardware?

Page 101: Embed your Ideas

Embedded Software Made Easy 36

Challenge #2 - How do I select the hardware?

Page 102: Embed your Ideas

Embedded Software Made Easy 36

To do so…:

Challenge #2 - How do I select the hardware?

Page 103: Embed your Ideas

Embedded Software Made Easy 36

To do so…:• Select a JTAG probe compatible with your

CPU

Challenge #2 - How do I select the hardware?

Page 104: Embed your Ideas

Embedded Software Made Easy 36

To do so…:• Select a JTAG probe compatible with your

CPU• affordable

Challenge #2 - How do I select the hardware?

Page 105: Embed your Ideas

Embedded Software Made Easy 36

To do so…:• Select a JTAG probe compatible with your

CPU• affordable• implementable in less than a week

Challenge #2 - How do I select the hardware?

Page 106: Embed your Ideas

Embedded Software Made Easy 36

To do so…:• Select a JTAG probe compatible with your

CPU• affordable• implementable in less than a week• with documentation & support

Challenge #2 - How do I select the hardware?

Page 107: Embed your Ideas

Embedded Software Made Easy 37

Challenge #2 - How do I select the hardware?

Page 108: Embed your Ideas

Embedded Software Made Easy 37

Or you can use instead Alpha, a GDB server, which brings:

Challenge #2 - How do I select the hardware?

Page 109: Embed your Ideas

Embedded Software Made Easy 37

Or you can use instead Alpha, a GDB server, which brings:

• the ability to run standard C (malloc, fprintf, etc.) programs bare metal with the support of GDB.

Challenge #2 - How do I select the hardware?

Page 110: Embed your Ideas

Embedded Software Made Easy 37

Or you can use instead Alpha, a GDB server, which brings:

• the ability to run standard C (malloc, fprintf, etc.) programs bare metal with the support of GDB.

• a bare metal execution environment ready-to-use.

Challenge #2 - How do I select the hardware?

Page 111: Embed your Ideas

Embedded Software Made Easy 37

Or you can use instead Alpha, a GDB server, which brings:

• the ability to run standard C (malloc, fprintf, etc.) programs bare metal with the support of GDB.

• a bare metal execution environment ready-to-use.

Without any single JTAG probe.

Challenge #2 - How do I select the hardware?

Page 112: Embed your Ideas

Embedded Software Made Easy

Challenge #3 - How do I choose the right software architecture?

38

Low-Level Software

FirmwareBare-metal

Level of Software

Abstraction

API

System Call

Runtime SystemLibrary

Program

Operating System

OS Service

By understanding the main roles in this diagram:

Page 113: Embed your Ideas

Embedded Software Made Easy

• Started by the hardware from a read-only memory (flash, etc.).

• Given the constraints of its hardware environment, it is usually reserved for very special cases like booting hardware units (CPU, GPU, etc.).

Challenge #3 - How do I choose the right software architecture?

39

Firmware

Page 114: Embed your Ideas

Embedded Software Made Easy

Challenge #3 - How do I choose the right software architecture?

40

Bare-Metal

Page 115: Embed your Ideas

Embedded Software Made Easy

• Started by a firmware.• No abstraction but the one performed by the firmware(s).• Lowest-level software, right next to the HSI.• Doesn’t use any OS but usually libraries provided in the CPU/

SoC/MCU SDK, from simple helper functions to full network stacks.

Challenge #3 - How do I choose the right software architecture?

40

Bare-Metal

Page 116: Embed your Ideas

Embedded Software Made Easy

• Started by a firmware.• No abstraction but the one performed by the firmware(s).• Lowest-level software, right next to the HSI.• Doesn’t use any OS but usually libraries provided in the CPU/

SoC/MCU SDK, from simple helper functions to full network stacks.

Used when:

✓ There is not enough memory for a complete OS.

✓ High-performance computing software.

Challenge #3 - How do I choose the right software architecture?

40

Bare-Metal

Page 117: Embed your Ideas

Embedded Software Made Easy

Challenge #3 - How do I choose the right software architecture?

41

Operating System

Page 118: Embed your Ideas

Embedded Software Made Easy

• Started by an OS-loader.

The two sides of an operating system:

1. Manages the hardware.

2. Provides a software abstraction of it with its own standard or specific interface.

Challenge #3 - How do I choose the right software architecture?

41

Operating System

Page 119: Embed your Ideas

Embedded Software Made Easy

Challenge #3 - How do I choose the right software architecture?

42

Operating System

Page 120: Embed your Ideas

Embedded Software Made Easy

Like any other software, consider its features and use the one that best matches your needs.

Challenge #3 - How do I choose the right software architecture?

42

Operating System

Real-Time Support

Safety Security Standard API

Standard API

Driver APIs

Tooling

Page 121: Embed your Ideas

Embedded Software Made Easy

• Started by the OS. • Benefits from the abstraction of its language

library, runtime, shared libraries, etc.

Challenge #3 - How do I choose the right software architecture?

43

Program

Page 122: Embed your Ideas

Embedded Software Made Easy

Use any language you like, the one you feel confident with to implement your features…

Challenge #3 - How do I choose the right software architecture?

44

Program

Page 123: Embed your Ideas

Embedded Software Made Easy

Use any language you like, the one you feel confident with to implement your features…

Challenge #3 - How do I choose the right software architecture?

44

Program

C++

GoPython

C

NodeJS

Java

Page 124: Embed your Ideas

Embedded Software Made Easy

Use any language you like, the one you feel confident with to implement your features…

Challenge #3 - How do I choose the right software architecture?

44

Program

C++

GoPython

C

NodeJS

JavaCorrectly managing errors is a feature…

…that some languages provide built-in!

Page 125: Embed your Ideas

Embedded Software Made Easy

Chief Hat Program

Our connected chief hat requires enough high-level features, such as a network stack or a power event handler, that are good candidates to start at least prototyping using Linux on a simple ARM SoC include a network controller (e.g., wifi). The main advantage of using Linux being its amazing development tooling…

Challenge #3 - How do I choose the right software architecture?

45

Linux

Power Button Speaker Microphone

ARM

Text-to-Speech Speech Recognition

Recipe Search Recipe Reading

Network Interface Controller

Network StackARM Kernel Drivers

Page 126: Embed your Ideas

Embedded Software Made Easy 46

Challenge #4 - How do I do embedded programming?

Page 127: Embed your Ideas

Embedded Software Made Easy 46

Challenge #4 - How do I do embedded programming?

Hardware

Page 128: Embed your Ideas

Embedded Software Made Easy 46

Challenge #4 - How do I do embedded programming?

HardwareYour Workstation

Page 129: Embed your Ideas

Embedded Software Made Easy 46

Challenge #4 - How do I do embedded programming?

HardwareYour Workstation

Any kind of link

Page 130: Embed your Ideas

Embedded Software Made Easy 46

Challenge #4 - How do I do embedded programming?

HardwareYour Workstation

Any kind of link

Called the « target »

Page 131: Embed your Ideas

Embedded Software Made Easy 46

Challenge #4 - How do I do embedded programming?

HardwareYour Workstation

Any kind of link

Called the « target »Called the

« remote » link

Page 132: Embed your Ideas

Embedded Software Made Easy 46

Challenge #4 - How do I do embedded programming?

HardwareYour Workstation

Any kind of link

Called the « target »Called the « host »Called the

« remote » link

Page 133: Embed your Ideas

Embedded Software Made Easy 46

Challenge #4 - How do I do embedded programming?

HardwareYour Workstation

Any kind of link

Called the « target »Called the « host »Called the

« remote » link

Cross-Toolchain

Page 134: Embed your Ideas

Embedded Software Made Easy 46

Challenge #4 - How do I do embedded programming?

HardwareYour Workstation

Any kind of link

Called the « target »Called the « host »Called the

« remote » link

Cross-Toolchain

Tools to be executed on your workstation to manipulate « target » software.

Page 135: Embed your Ideas

Embedded Software Made Easy 47

Challenge #4 - How do I do embedded programming?

HardwareYour Workstation

Any kind of link

Called the « target »Called the « host »Called the

« remote » link

Cross-Compiler

Tools to be executed on your workstation to manipulate « target » software.

Page 136: Embed your Ideas

Embedded Software Made Easy 47

Challenge #4 - How do I do embedded programming?

HardwareYour Workstation

Any kind of link

Called the « target »Called the « host »Called the

« remote » link

Tools to be executed on your workstation to manipulate « target » software.

Cross-Compiled Program

Page 137: Embed your Ideas

Embedded Software Made Easy 48

Challenge #4 - How do I do embedded programming?

HardwareYour Workstation

Cross-Compiled Program

Any kind of link

Page 138: Embed your Ideas

Embedded Software Made Easy 48

Challenge #4 - How do I do embedded programming?

HardwareYour Workstation

Cross-Compiled Program

Any kind of link

Page 139: Embed your Ideas

Embedded Software Made Easy 48

Challenge #4 - How do I do embedded programming?

HardwareYour Workstation

Cross-Compiled Program

Any kind of link

Not working? Do it again...

Page 140: Embed your Ideas

Embedded Software Made Easy

Challenge #5 - How do I make embedded development simple?

49

It’s still such a « hard » world…

Page 141: Embed your Ideas

Embedded Software Made Easy

Challenge #5 - How do I make embedded development simple?

50

In such « hard » world…

Can we make it easier for Bob, its

teammates, its boss?

Page 142: Embed your Ideas

Embedded Software Made Easy

Challenge #5 - How do I make embedded development simple?

51

HardwareYour Workstation

Cross-Compiled Program

Firstly…

OS

Page 143: Embed your Ideas

Embedded Software Made Easy

Challenge #5 - How do I make embedded development simple?

51

HardwareYour Workstation

Cross-Compiled Program

Cross-GDB

GDB is the recommended tool. It allows to embed, debug and test the program, in one single amazing tool.

Firstly…

OS

Page 144: Embed your Ideas

Embedded Software Made Easy

Challenge #5 - How do I make embedded development simple?

51

HardwareYour Workstation

Cross-Compiled Program

Cross-GDB

GDB is the recommended tool. It allows to embed, debug and test the program, in one single amazing tool.

Debug Informations of

the Cross-Compiled Program

Firstly…

OS

Page 145: Embed your Ideas

Embedded Software Made Easy

Challenge #5 - How do I make embedded development simple?

51

HardwareYour Workstation

Cross-Compiled Program

Cross-GDB

GDB is the recommended tool. It allows to embed, debug and test the program, in one single amazing tool.

Alpha

Debug Informations of

the Cross-Compiled Program

Firstly…

OS

Page 146: Embed your Ideas

Embedded Software Made Easy

Challenge #5 - How do I make embedded development simple?

51

HardwareYour Workstation

Cross-Compiled Program

Cross-GDB

GDB is the recommended tool. It allows to embed, debug and test the program, in one single amazing tool.

Alpha

Debug Informations of

the Cross-Compiled Program

Firstly…

OS

GDB Debug Protocol

Page 147: Embed your Ideas

Embedded Software Made Easy

Challenge #5 - How do I make embedded development simple?

51

HardwareYour Workstation

Cross-Compiled Program

Cross-GDB

GDB is the recommended tool. It allows to embed, debug and test the program, in one single amazing tool.

Alpha

Debug Informations of

the Cross-Compiled Program

Firstly…

OS

The program is dynamically debugged, so no more static logs/

prints everywhere in the code

GDB Debug Protocol

Page 148: Embed your Ideas

Embedded Software Made Easy

Challenge #5 - How do I make embedded development simple?

51

HardwareYour Workstation

Cross-Compiled Program

Cross-GDB

GDB is the recommended tool. It allows to embed, debug and test the program, in one single amazing tool.

Alpha

Debug Informations of

the Cross-Compiled Program

Firstly…

OS

The program is dynamically debugged, so no more static logs/

prints everywhere in the code

But also the entire system, including its

OS, drivers, and other processes.

GDB Debug Protocol

Page 149: Embed your Ideas

Embedded Software Made Easy 52

Page 150: Embed your Ideas

Embedded Software Made Easy 52

Page 151: Embed your Ideas

Embedded Software Made Easy

And finally, how would you find mistakes before they become bugs? Agile development? Test-Driven Development? Continuous Integration?

Dedicate your time and energy to your product using our second tool, Lab, which automates the setup of a target and its interfaces. Useful even on a day-to-day basis for your tedious manual setups of the targets and to be able later on to run automatic tests from a continuous integration server.

Challenge #5 - How do I make embedded development simple?

53

Page 152: Embed your Ideas

Embedded Software Made Easy 54

Page 153: Embed your Ideas

Embedded Software Made Easy 54

Page 154: Embed your Ideas

Embedded Software Made Easy 55

Challenge #6 - How do I go in production?

Hardware

Program in Read-Only Memory

Page 155: Embed your Ideas

Embedded Software Made Easy 55

Challenge #6 - How do I go in production?

HardwareProduction Test Bench

Program in Read-Only Memory

Any kind of link

Page 156: Embed your Ideas

Embedded Software Made Easy 55

Challenge #6 - How do I go in production?

HardwareProduction Test Bench

Program in Read-Only Memory

Any kind of link

In the chief hat case, the network controller could be used.

Page 157: Embed your Ideas

Embedded Software Made Easy 55

Challenge #6 - How do I go in production?

HardwareProduction Test Bench

Program in Read-Only Memory

Any kind of linkAlpha

In the chief hat case, the network controller could be used.

Page 158: Embed your Ideas

Embedded Software Made Easy 55

Challenge #6 - How do I go in production?

HardwareProduction Test Bench

Program in Read-Only Memory

Any kind of link

Alpha

In the chief hat case, the network controller could be used.

Page 159: Embed your Ideas

Embedded Software Made Easy 55

Challenge #6 - How do I go in production?

HardwareProduction Test Bench

Program in Read-Only Memory

Any kind of link

Cross-GDBAlpha

In the chief hat case, the network controller could be used.

Page 160: Embed your Ideas

Embedded Software Made Easy 55

Challenge #6 - How do I go in production?

HardwareProduction Test Bench

Program in Read-Only Memory

Any kind of linkDebug

Informations of Program in Read-

Only Memory

Cross-GDBAlpha

In the chief hat case, the network controller could be used.

Page 161: Embed your Ideas

Embedded Software Made Easy 56

Hardware test benches are expensive and are a whole project of their own.

We recommend also using Lab to make it as much software as possible:

• Connect your hardware to your test instruments.

• Connect your instruments to Lab and you are down with hardware, you can continue fully software…

Challenge #6 - How do I go in production?

Page 162: Embed your Ideas

Simplicity is prerequisite of reliability

Edsger W. Dijkstra Computer Science Pioneer

Page 163: Embed your Ideas

linkedin.com/in/guerrajulio

Embedded Software Made Easy

Have Fun & Good Luck!

github.com/farjump/raspberry-pi

[email protected]