Embedded
What? Why? How?
Volodymyr Shymanskyy
June 2015
You can find animated version here: http://tiny.cc/emb-wtf
Embedder
Integrated
Low Level
System Dev
Platform Dev
Firmware
Embedded
RTOS, RISC
uC, µC, MCU, SoC
Microcontrollers
FPGA, DSP, ASIC
JTAG
STM32, Cortex, ARM, AVR, PIC, MIPS,
PowerPC, SPARC, Arduino, Xilinx
VxWorks
Linux
Driver
Kernel
Ring-0
WHY?
Embedded
CLI
User Interface
Electronics
Connectivity
Mechanics
Management
Software
Radio
...
Embedded
Integrated
Low Power
Small Size
Low Cost
Durable
… or Beautiful
Roshen
Band
https://www.youtube.com/watch?v=1eH2lVVFato
Applications
Automation (industrial, home...), IOT
Mobile, Modems, VOIP
Telecom, Network, Broadband
Automotive
Equipment
(medical, military, consumer, cooking…)
Embedded ≠ Mobile
Blynk 493% funded on Kickstarter!
Operating environment
becomes application-specific
(contrary to general-purpose)
CLI
User Interface
Electronics Connectivity
Mechanics
Management
Software
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
Kernel
Drivers
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
Tools
Debugging
Emulators, Traces,
Statistics, Diagnostic....
Hardware
Monitors, Scopes, Sniffers....
Quality Assurance is also more interesting!
Debuggers
Conditional breakpoints
Data breakpoints
Watch expressions
Reverse, Rec-Replay
Remote debugging
Offline debugging
Debugging in emulator!
Data Display Debugger
Profilers
Profilers
● speed, resource usage, cache
Perl 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
memcheck
cachegrind
callgrind
massif
helgrind
tutorial (rus)
fun
sysstat (sar)
iostat
pidstat
mpstat
etherape, vnstat
powertop
socat, netem, strace, ltrace
Emulators
VirtualBox
QEMU
...
Protocol Sniffers / Analysers
Wireshark
Fiddler
Hardware
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]
Requirements
C/C++
OOP/OOD
Multithreading, Synchronization, RPC, IPC
Linux/Unix
Embedded/Low Level
Network stack, OSI model
POSIX, STL
Other Requirements
Complex systems design
Debugging on customer side
Logical thinking
English
Benefits?
RC Car ->
Robot
3D Printers
Volodymyr Shymanskyy
Embedded Software Developer & Trainer
Hackerspace Co-Founder & Coordinator
vshymanskyi@gmail.com
skype: vshymanskyi
LinkedIn, Facebook
Submit your ideas and corrections for this presentation

Embedded. What Why How