Software virtualization lessons for extreme IoT
portability and scale
Vincent Perrier
Chief Product Officer, MicroEJ
About MicroEJ
• IS2T S.A. founded in 2004 – offices in France, Germany, USA– $5M Series A funding in 2011 – $20M R&D total investment
– http://www.microej.com/about
• Independent Software Vendor, global player in the IoT industry– Licenses: embedded (tools & runtime) + cloud (store)
– Professional services, training & consulting
• Expertise in embedded, virtualization,software engineering & processes
• Partnerships with key IoT, silicon,embedded SW and HW vendors, EMS,clouds
8 June 2016 2© MicroEJ
IoT Business Trends
• Manufacturing imposes using industrial-grade components
• Large production volumes (billions of devices) impose low product cost
• Battery-operated devices impose low power consumption
• Internet pace imposes shorter time-to-market
• Smartphones and tablets set new user experience expectations for consumer products
• IoT business model is likely to evolve from device-centred (retail business) to services-centred (operator business) to data-centred (BI)
Revenues from device (electronic product) sales< Revenues from subscriptions to web-based services delivered through devices< Revenues from data streams delivered by devices Time/IoT maturity
8 June 2016 3© MicroEJ
IoT Technical Challenges
• Interoperability with cloud infrastructure implies IP-based networking– Directly on edge node device, or through a gateway – for interfacing with cloud servers
• Embedded constraints– Fragmented processor architectures and low-level HW-dependant SW (HdS) & tools
– Limited resources: memory, storage, computing, bandwidth, battery life…
– Diversity of connectivity links, wired & wireless
– Interfacing to the physical world (sensors & actuators, analog & digital…)
• Architecture choices on silicon integration of main hardware functions– Computing, memory (RAM), storage (flash), connectivity (RF, wired), data collection (I/Os)…
– On-chip or on board: MPU, MCU, SoC, modules (comms, sensor), ASIC, components…
• Value is delivered by software– Communication protocols, user interfaces, manageability, scalability, data & services…
• IoT is not Arduino, nor Linux on Raspberry Pi, nor Android on dual core GHz processors
8 June 2016 4© MicroEJ
Embedded Devices
• SMART devices need to be able to acquire, compute and store data, and perform several tasks– Peripherals, processors (MCU, FPU, DSP), RAM, flash…
• CONNECTED devices need to support many connectivity, communications and security standards– Physical/Link: 802.15.4, 868-902 MHz, 802.11, Bluetooth, cellular 2G/3G/4G…
– Network/Transport: Wi-Fi, 6LowPAN, TCP/UDP-IP, TLS/DTLS, ZigBee, Z-Wave…
• INTERACTIVE devices provide graphical and touch interface– Graphical User Interface (GUI), Human-Machine Interface (HMI)
• MANAGED devices allow software content update and operations management from the Cloud– Over-The-Air (OTA) firmware update
– Device Management (DM)
• May use proprietary communication protocols over standard links– Sensors, actuators, I/Os (GPIO, PWM, DAC/ADC, USB, I2C, SPI, UART…)
– Internet client/server (sockets)
8 June 2016 5© MicroEJ
IoT Devices
• Should use standard communication protocols over standard links
• IoT devices use standard-based frameworks and agents for communicating with each other and connecting to services in the cloud that provide software content and operations management– WebSocket, TLS, HTTPS REST…
– Thread, AllJoyn, DDS, XMPP, AMQP, MQTT, CoAP, LWM2M…
• They leverage data streams and formats for cloud-based analytics– XML, JSON…
• SCALABLE devices may run multiple applications that can be dynamically downloaded and installed/uninstalled (without FW update)– User experience similar to smartphones/tablets = application store
8 June 2016 6© MicroEJ
IoT Edge-to-Cloud
8 June 2016 7© MicroEJ
HW
SW
GUI
Data Analytics
Sensors
Data Y
DM X Third-PartyAgents
Apps GWY IoT Cloud Platform Y
IoT Cloud Platform X
ApplicationStore
Download DeviceManagement
Connect
Device B
Device A
IoT Non-Portability & Scale
?
8 June 2016 8© MicroEJ
Cloud Y
Cloud X
Cloud Z
Device C
Combination of clouds and protocols: HTTPS, REST, MQTT, CoAP, LWM2M…
Combination of: ISA, compilers, RTOS, libraries (FS…), stacks (TCP-UDP/IP, TLS/DTLS…)
• Embedded C/RTOS solutions have efficiently addressed SW bring-up on fragmented hardware by providing vertical integration layers for each combination (ISA/compiler/libs)
• But they may require integration work for the BSP and native libraries
• They may not provide ready-to-use solutions for enabling IoT and cloud-ready SW capabilities
• Applications still need to be ported from one vertical silo to another, further fragmenting developer communities
Vertical Integration
8 June 2016 9© MicroEJ
• The MicroEJ® Operating System leverages the best of both worlds:
– The scalability of embedded RTOS solutions for SW bring-up
– The large community of mobile & PC developers for efficient SW applications development
• It provides APIs both for BSP/RTOS/libs integration and SW app development
• It enables horizontal integration of OS services thanks to a virtualization layer that isolates application layers from lib/RTOS/BSP/compiler/ISA layers
Horizontal Integration
8 June 2016 10© MicroEJ
IoT Portability & Scale
8 June 2016 11© MicroEJ
Cloud Y
Cloud X
Cloud Z
Device A
Device B
Device C
Combination of clouds and protocols: HTTPS, REST, MQTT, CoAP, LWM2M…
Combination of: ISA, compilers, RTOS, libraries (FS…), stacks (TCP-UDP/IP, TLS/DTLS…)
MicroEJ OS
ANY
ANY
Reusable SWReusable SW
Reusable SWReusable SW
HW Virtualization
ADVANTAGES HOW:
Hardware independence• True Portability of BINARY SW across HW (no
recompilation needed)
Micro-Virtualization layer (30KB)• Formal Separation between HW-dependent-SW and
HW-independent-SW
Safe SW programming & execution Build & runtime checks, Sandboxing
Full set of SW foundation blocks High-level API & stacks
Secured investments• Legacy code integration
Multi-language support: Java, C/C++, ASM
Future-proof• SW updates• New SW downloads
Multi-application framework• Build-time configuration• Run-time add-ons
8 June 2016 12© MicroEJ
MicroEJ OS
Platform
OPERATING SYSTEM
BSP/DRIVERS
TARGET HARDWARE
APPLICATIONS
APP 1 APP 2 APP 3 APP 4 …
CORESecure Multi-Application Engine
COREMemory Management
CORELanguages/Utilities/Test
CORECPU & Power Management
COREComponents Management
IOSensors/Actuators/GPIO
COMMConnectivity Wired/Wireless
STOREApplication Management
NUMNumerical Methods
FILE & DATAPersistence/File System
GUIGraphics/Touch
NET & SECNetwork Protocols & Security
IOTIoT/Cloud Middleware
8 June 2016 13© MicroEJ
MicroEJ OS Foundations
HW Foundations
• MCU/MPU/SoC architectures and starter kits
– ARM Cortex M/A
– MIPS, RX, Power, TriCore…
SW Foundations
• Hardware-dependent Software
– Bare metal/any RTOS
– BSP, drivers, libraries
• Native SW SDKs
8 June 2016 14© MicroEJ
MicroEJ Cloud Connections
Data Analytics
• HTTPS REST
• MQTT
• CoAP
• AMQP
Device Management
• LWM2M
• OMA-DM
• TR-069
8 June 2016 15© MicroEJ
IP
TCP UDP
TLS DTLSSMS
CoAPMQTT
LWM2M
MicroEJ OS CoreSecure multi-application engine• Optimized virtual machine• “Green thread” integration to RTOS
Languages, utilities & test• Efficient Java-to-C native interface• Test suite harness (for HW-in-the-loop testing)• Performance traces
Memory management• Smart RAM optimizer (garbage collector)• Shared C-Java heap (immortal objects) • Static objects in flash (immutable objects)
CPU & Power management• Management of app permissions to access system resources
Components management• Static and dynamic code loader, incremental• Management of binary app lifecycle• Sandboxing
8 June 2016 © MicroEJ 16
KEY FIGURES:
Soft Core (virtualization) + Smart RAM Optimizer
< 30 KB of Flash
Multi-app add-on < 10 KB of Flash
RAM footprint < 1.5 KB
Boot time < 2mson Cortex-M3 at 120 MHz
RTOS stack size < 1KB
Multi-App SandboxingBuilt OS defines set of API & resources available to apps
• Can’t access directly to code, objects, threads
• No (bypassing) native code call allowed
• No inter-dependencies between apps
• Fully managed in binary
• Install, uninstall, start, stop
HARDWARE
BSP (= DRIVERS + RTOS)
RTOSTask 1
MicroEJ Task (“Green Thread”)RTOSTask 2
RTOSTask n
MicroEJ CoreMemory Mgmt
Components Management
Resource Mgmt
Predictable Thread Scheduler
MicroEJ Libraries
App1
App2
App3
App4
App5
Appn
Downloaded
AppIsolation
Layer
Resident
8 June 2016 © MicroEJ 17
End-to-End IoT
8 June 2016 21© MicroEJ
IOT DEVICES
SW CONTENT MANAGEMENT
DEVICE MANAGEMENT
DATA ANALYTICS
GATEWAYP
OS
STORE
OSIOT
CLOUD PLATFORM
MicroEJ PartnersP
OS for IoT
8 June 2016 22© MicroEJ
RTOS Linux
MPU (>$10 ASP)MCU ($1-6 ASP)
Vo
lum
es75%
25%
SW Foundation
Thank You
8 June 2016 23© MicroEJ
• General information
– www.microej.com
• MicroEJ SDK free evaluation for OEMs
– www.microej.com/get-started
• Free MicroEJ Studio for application developersMicroEJ Application Store
– store.microej.com
• Developer resources (source, doc, examples…)
– developer.microej.com
• Contact us
All rights reserved.Information, technical data and tutorials contained in this document are proprietary under copyright Law of Industrial Smart Software Technology (IS2T S.A.) operating under the brand name MicroEJ®.Without written permission from IS2T S.A., copying or sending parts of the document or the entire document by any means to third parties is not permitted. Granted authorizations for using parts of the document or the entire document do not mean IS2T S.A. gives public full access rights.IS2T®, MicroEJ® and all relative logos are trademarks or registered trademarks of IS2T S.A. in France and other Countries.Java™ is Sun Microsystems' trademark for a technology for developing application software and deploying it in cross-platform, networked environments. When it is used in this documentation without adding the ™ symbol, it includes implementations of the technology by companies other than Sun.Java™, all Java-based marks and all related logos are trademarks or registered trademarks of Sun Microsystems Inc., in the United States and other Countries.Other trademarks are proprietary of their respective owners.