3. Outline
• What is embedded
• Overview of cross targets
– Embedded OSs / bare board
– What is new
• Fun projects
4. What is embedded?
• Executes on a platform different from the host used for building
• Characteristics
– Reduced memory and processing power
– Limited graphical interface
– Safety/mission-critical
– Real-time requirements
– …
5. Embedded is expressive!
• Profiles for safety/mission-critical
– Tasking
– Multiprocessor
– Object-Oriented Programming
– Exceptions
• Ada 2012 contracts
function Sqrt (X : Integer) return Integer with
Pre => X >= 0,
Post => ((Sqrt’Result ** 2 <= X) and then
((Sqrt’Result + 1) ** 2 > X));
task Cyclic
with Priority => 100,
CPU => 3;
end Cyclic;
7. How to do embedded development
On top of embedded OS
• OS responsible for
– BSP
– Tasking
– Multiprocessor
• OS supported
– VxWorks
– PikeOS
– LynxOS
– Embedded linux
– Android
Bare board
• Ada run time provides
– Start up code
– BSP
– Tasking
– Multiprocessor
• Targets supported
– PowerPC/e500v2
– ARM
– ERC32/LEON2/LEON3
– AVR
8. GNAT Pro on embedded OS
• Ada run time uses OS services
• User benefits from
– BSP provided by the OS
• File system, networking
– Portability provided by the
Ada run time
Ada Application
Ada Run Time
Operating System
Hardware
9. GNAT Pro for VxWorks
• VxWorks 6/7 & SMP
– PowerPC / e500v2
– x86 / x86-64
– ARM
– VxWorks Simulator
• VxWorks 5.5
– PowerPC
– x86 (baselined)
– 68K (baselined)
• VxWorks 653 (1.8-3.0 supported) & MC
– PowerPC / e500v2
– x86
• VxWorks MILS
– PowerPC
• VxWorks Cert 6
– PowerPC / x86
• VxWorks Cert 5
– PowerPC
10. Run Times for VxWorks
Cert
Zero Footprint
(SPARK
compliant)
Ravenscar Full Kernel Full RTP
VxWorks Cert 5 & 6
VxWorks 5
VxWorks 6/7
VxWorks 653
Certified
11. News for VxWorks
• New platforms
– VxWorks 653 3.0
– VxWorks 7
• New targets
– ARM and x86-64
• Multicore support
– VxWorks 6 & 7
– VxWorks 653 3.0
• Zero cost exception propagation (Ravenscar and Full run times)
• Debugging support
– Active collaboration between Wind River and AdaCore
– Enhanced compiler and Workbench debugger
12. GNAT Pro for PikeOS
• PikeOS 3.4 hypervisor
– Support for x86 and PowerPC
• Three run-time profiles
– ZFP, Ravenscar
– Minimal
• Zero cost exception propagation (Ravenscar run time)
Certified
13. GNAT Pro for LynxOS
• LynxOS-178 (2.2.2)
– PowerPC
• LynxOS 5
– PowerPC / x86
• Zero cost exception propagation (Ravenscar and Full run times)
Cert
Zero Footprint
(SPARK
compliant)
Ravenscar Full
LynxOS-178
LynxOS 5
Certified
14. GNAT Pro for embedded linux
• Generic port for embedded linux
– x86, ARM, PowerPC, e500v2
• Reference platforms
– Wind River embedded linux (PowerPC)
– ElinOS (PowerPC / x86)
• Full Ada run times
– Zero cost exception propagation
– Multiprocessor support
15. GNAT Pro for Android
• Jelly Bean 4.1
• Lollipop 5.1
• GDB support
16. GNAT Pro for bare boards
• Most of the run time is shared among targets
• Configurable run times
– Make it easy to adapt to new board
– Startup routine
– Memory map
– Floating point support
Ada Application
Ada Run Time
Multitasking core
Hardware
BSP
17. Bare board targets
• PowerPC / e500v2
• ARM
– ARM Cortex M3, ARM Cortex M4F, ARM Cortex R4F
• LEON
– LEON2, LEON3, ERC32
• Baselined ports
– AVR microcontrollers
– Lego Mindstorms NXT
18. News for bare boards
• Ravenscar
• Productizing support for multiprocessors
– PowerPC, working on LEON
– Fully partitioned model
• Math library in Ada
– Certifiable
• Extending Ravenscar
– Addressing restrictions limiting
expressive power
• Protected entry queuing
• Multiple entry queues per
protected object
0
3
1
2
Ravenscar system on monoprocessor
task Cyclic
with Priority => 100,
CPU => 3;
end Cyclic;
Certified
19. News for bare boards (II)
• Zero-cost exception propagation
– Ravenscar Full run times
• Setting up shared GitHub
– Collaborative environment for demos, BSPs, drivers,…
• Emulator/coverage for ARM
20. Certification of run times
Avionics DO-178B/C Certification
Bare board PowerPC Ravenscar run time SSIL
3/4
x86 PikeOS Minimal run time SSIL 3/4 (in
progress)
Railway CENELEC Certification
EN 50128:2011, 50126:1999, 50129:2003
Space
ECSS E-ST-40C Q-ST-80C
Cert run time PowerPC VxWorks 653 certified Level
A
Cert run time PowerPC VxWorks 6 Cert (Level A in
progress)
Cert run time PowerPC LynxOS 178 (Level A in
progress)
Bare board Ravenscar run time qualified
Level B and Level C (ERC32, LEON2, LEON3)
21. Bare board for fun
• Lego Mindstorms NXT
• ARM boards
– STM32F4-Discovery
– Atmel SAM4S (Cortex M4)
• Raspberry Pi 2
• Crazyflie
– SPARK for proving absence of run-time errors
– Ravenscar Ada tasking
22. Bare board for fun (II)
• Play with concurrent / parallel execution
• Develop embedded control systems
– Manually written code
– QGen to automatically generate Ada/C from Simulink/Stateflow
• Replace embedded OS by Ravenscar Ada run time
• Develop BSPs and drivers
• Use SPARK to prove
– Functional properties
– Absence of run-time errors
23. Summary
• Choice of OS / bare board
• Tasking available
– Multiprocessor getting there gradually
• We can make it work on small targets
– Small footprint, no dynamic memory, very low overhead
• You can trust the code embedded on your target
– You can use Ada 2012 and tools to help make your code reliable
• … and you can have fun with cross development!