Embedded. What Why How

42
Embedded What? Why? How? Volodymyr Shymanskyy June 2015 You can find animated version here: http://tiny.cc/emb-wtf

Transcript of Embedded. What Why How

Page 1: Embedded. What Why How

EmbeddedWhat? Why? How?

Volodymyr Shymanskyy

June 2015

You can find animated version here: http://tiny.cc/emb-wtf

Page 2: Embedded. What Why How

Embedder

Page 3: Embedded. What Why How

IntegratedLow LevelSystem DevPlatform DevFirmware

EmbeddedRTOS, RISCuC, µC, MCU, SoCMicrocontrollersFPGA, DSP, ASICJTAG

STM32, Cortex, ARM, AVR, PIC, MIPS, PowerPC, SPARC, Arduino, Xilinx

VxWorksLinuxDriverKernelRing-0

Page 4: Embedded. What Why How

WHY?

Page 5: Embedded. What Why How

Embedded

CLIUser Interface

Electronics ConnectivityMechanics

ManagementSoftware

Radio...

Page 6: Embedded. What Why How

Embedded

IntegratedLow PowerSmall SizeLow CostDurable… or Beautiful

Page 7: Embedded. What Why How
Page 9: Embedded. What Why How

Applications

Automation (industrial, home...), IOTMobile, Modems, VOIPTelecom, Network, BroadbandAutomotiveEquipment

(medical, military, consumer, cooking…)

Page 10: Embedded. What Why How

Embedded ≠ Mobile

Page 12: Embedded. What Why How

Operating environmentbecomes application-specific

(contrary to general-purpose)

Page 13: Embedded. What Why How

CLIUser Interface

Electronics ConnectivityMechanics

ManagementSoftware

Radio...

Page 14: Embedded. What Why How

Frameworks

Even C++ features are turned off! ^_^

But there are some:Linux, mbed, QP…

Libraries ARE used. LibEvent, minizip, etc...

Page 15: Embedded. What Why How

C, C++, Java, … ?User Apps Mobile Web Text proc. Prototyping

Basic / Pascal Forget it ;)

C/C++

Java, .Net

Python WOW!!!

Perl WOW!!!

JS, Node.JS WOW!!!

awk, sed WOW!!!

Bash / Cmd Just system scripting

Page 16: Embedded. What Why How

Library

Processor(s) Memory Devices

KernelDrivers

Supervisor

Application

Hardware

Library Lib

Library L

Program

Program

Program

Program

System Software

Framework

Page 17: Embedded. What Why How

Platforms

Page 18: Embedded. What Why How

CISC vs RISC vs MISC vs ZISC

● Complex● Reduced● Minimal● Zero!

Page 19: Embedded. What Why How

x86 GPU DSP FPGA uC

Embed

Power

Float arithm

Integer arithm

Flow control

IO

Pipelining

Timing

Programming

From FPGA 101

Platform types

Page 20: Embedded. What Why How

Tools

Page 21: Embedded. What Why How

LAB

Page 22: Embedded. What Why How

ToolsDebugging

Emulators, Traces,Statistics, Diagnostic....

HardwareMonitors, Scopes, Sniffers....

Quality Assurance is also more interesting!

Page 23: Embedded. What Why How

DebuggersConditional breakpoints

Data breakpointsWatch expressions

Reverse, Rec-ReplayRemote debugging

Offline debuggingDebugging in emulator!

Data Display Debugger

Page 24: Embedded. What Why How

Profilers

Page 25: Embedded. What Why How

Profilers

● speed, resource usage, cachePerl perl -d:NYTProf myscript.pl

Python python -m cProfile myscript.py

+pycallgraph

Java NetBeans, GC Viewer, here (rus)

You can do measurements directly in code!

Page 26: Embedded. What Why How

Valgrind

memcheckcachegrindcallgrindmassifhelgrind

tutorial (rus)

Page 28: Embedded. What Why How

Emulators

VirtualBoxQEMU...

Page 29: Embedded. What Why How

Protocol Sniffers / Analysers

WiresharkFiddlerHardware

USB

Page 30: Embedded. What Why How

Prototyping

● Python, JS, Node.js● Arduino● Online:

○ Coding Ground○ JSFiddle

Page 31: Embedded. What Why How
Page 32: Embedded. What Why How

Logs, Dumps, Event Traces

● “Debug by prints”○ Embedded / multithreaded

● Log to file, to ram (may be shared)○ Filter by module/severity

● Dump part of the state○ Stats

● Event Traces○ Binary, lightweight

Page 33: Embedded. What Why How

Statistics

● Event counts○ In domain, or internal○ Amount of function calls

● Time of processing● Latency● CPU/RAM usage

Page 34: Embedded. What Why How

CLI - Command Line

● Interactive● One-shot

Increases usability &Allows automation!

Page 35: Embedded. What Why How

Support

Old long-term projects (10-15 years!!!)

And so are developers and their habits[sometimes]

Page 36: Embedded. What Why How

RequirementsC/C++OOP/OODMultithreading, Synchronization, RPC, IPCLinux/UnixEmbedded/Low LevelNetwork stack, OSI modelPOSIX, STL

Page 37: Embedded. What Why How

Other Requirements

Complex systems designDebugging on customer sideLogical thinkingEnglish

Page 38: Embedded. What Why How

Benefits?

Page 39: Embedded. What Why How
Page 40: Embedded. What Why How

RC Car ->Robot

Page 41: Embedded. What Why How

3D Printers

Page 42: Embedded. What Why How

Volodymyr ShymanskyyEmbedded Software Developer & TrainerHackerspace Co-Founder & Coordinator

[email protected]: vshymanskyiLinkedIn, Facebook

Submit your ideas and corrections for this presentation