Embedded. What Why How

Post on 06-Aug-2015

94 views 2 download

Tags:

Transcript of Embedded. What Why How

EmbeddedWhat? Why? How?

Volodymyr Shymanskyy

June 2015

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

Embedder

IntegratedLow LevelSystem DevPlatform DevFirmware

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

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

VxWorksLinuxDriverKernelRing-0

WHY?

Embedded

CLIUser Interface

Electronics ConnectivityMechanics

ManagementSoftware

Radio...

Embedded

IntegratedLow PowerSmall SizeLow CostDurable… or Beautiful

Applications

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

(medical, military, consumer, cooking…)

Embedded ≠ Mobile

Operating environmentbecomes application-specific

(contrary to general-purpose)

CLIUser Interface

Electronics ConnectivityMechanics

ManagementSoftware

Radio...

Frameworks

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

But there are some:Linux, mbed, QP…

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

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

Library

Processor(s) Memory Devices

KernelDrivers

Supervisor

Application

Hardware

Library Lib

Library L

Program

Program

Program

Program

System Software

Framework

Platforms

CISC vs RISC vs MISC vs ZISC

● Complex● Reduced● Minimal● Zero!

x86 GPU DSP FPGA uC

Embed

Power

Float arithm

Integer arithm

Flow control

IO

Pipelining

Timing

Programming

From FPGA 101

Platform types

Tools

LAB

ToolsDebugging

Emulators, Traces,Statistics, Diagnostic....

HardwareMonitors, Scopes, Sniffers....

Quality Assurance is also more interesting!

DebuggersConditional breakpoints

Data breakpointsWatch expressions

Reverse, Rec-ReplayRemote debugging

Offline debuggingDebugging in emulator!

Data Display Debugger

Profilers

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!

Valgrind

memcheckcachegrindcallgrindmassifhelgrind

tutorial (rus)

Emulators

VirtualBoxQEMU...

Protocol Sniffers / Analysers

WiresharkFiddlerHardware

USB

Prototyping

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

○ Coding Ground○ JSFiddle

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

Statistics

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

● Time of processing● Latency● CPU/RAM usage

CLI - Command Line

● Interactive● One-shot

Increases usability &Allows automation!

Support

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

And so are developers and their habits[sometimes]

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

Other Requirements

Complex systems designDebugging on customer sideLogical thinkingEnglish

Benefits?

RC Car ->Robot

3D Printers

Volodymyr ShymanskyyEmbedded Software Developer & TrainerHackerspace Co-Founder & Coordinator

vshymanskyi@gmail.comskype: vshymanskyiLinkedIn, Facebook

Submit your ideas and corrections for this presentation