JavaScript* Meets Zephyr™ OSSakari Poussa@spoussaIntel
Zephyr is a trademark of the Linux Foundation. *Other names and brands may be claimed as the property of others.
OutlineWhy JavaScript*
Architecture
Arduino 101* Port
Building
Security and Memory Consumption
APIs and Roadmap
Browser IDE
Open Source Project
Demo
*Other names and brands may be claimed as the property of others.
JavaScript* Runtime for Zephyr OSEnable JavaScript application development on Zephyr OSAddress large JavaScript developer communityFast development cycle - No flashing, just copy .js filesGood tooling including browser based IDE and debuggingBased on open source JerryScript JS engine and API layerWell known JavaScript APIs (Node.js* like)Application portability between MCU and MPU platformsSupport now for Arduino101 and FRDM-K64F, all Zephyr OS supported boards in the future
WHAT
*Other names and brands may be claimed as the property of others.
JavaScript* on Zephyr OS - BenefitsBig JavaScript developer communityWell known cross-OS APIsSingle skill set for device, client, gateway and cloud application developmentCode sharingDevelopment and simulation on host systems (PC)Fast development cycleBrowser based IDEEasy integration to cloud systems
WHY
*Other names and brands may be claimed as the property of others.
Development FlowWHY
Edit
CopyRun
Edit
Compile
Reboot
Flash
Reboot
Run
MuchFaster
Development
Native JavaScript*
*Other names and brands may be claimed as the property of others.
JavaScript* Runtime for Zephyr OSNode.js* is too big for MCU devicesWe need something like Node.js but smallerPoC: JavaScript Runtime for Zephyr OS based on JerryScript
Arduino 101 (256K ROM / 80 K RAM)Timers, BLE, PWM, AIO, GPIO, and OCF APIs
TargetSame APIs on Linux* and Zephyr OSSame JavaScript application runs (unmodified) on Linux and Zephyr OS, or even in the browser
HOW
*Other names and brands may be claimed as the property of others.
ArchitectureJavaScript* App
Business logic by the app developer
JavaScript API LayerAPI bindings - NEWOpen source (Apache 2.0) - NOW
JS EngineMicro JS engine - JerryScriptOpen source (Apache 2.0)
IntegrationSeparate repo in GitHubMake pulls in all the dependencies
HOW
MCU
Zephyr
JerryScript
JavaScript API Layer
JavaScript App Application
JavaScript Runtime
JavaScript APIs
*Other names and brands may be claimed as the property of others.
Build$ git clone [email protected]/01org/zephyr.js
$ cd zephyr.js
$ make
HOW
MCU
Zephyr OS
JerryScript
JavaScript API Layer
JavaScript* App
Building…
zephyr.bin$ make flash
*Other names and brands may be claimed as the property of others.
Arduino 101* Port
Arduino 101*
X86 Core ARC Core
Zephyr OS / Drivers Zephyr OS / Drivers
ZJS Support ImageJavaScript Runtime
JavaScript* Application
IPC
*Other names and brands may be claimed as the property of others.
SecurityBuild time
JavaScript* source is converted into C string and embedded into zephyr.bin imageJavaScript eval() function is disabledSpecial developer mode can be enabled via make command (make DEV=ashell)
RuntimeOnly the embedded JavaScript application is executedWeb pages or foreign scripts are NOT executed
Developer ModeJavaScript application is executed from Zephyr OS filesystemJavaScript application replaceable via USB or BLE using browser IDE or CLI tool
WHAT
*Other names and brands may be claimed as the property of others.
Memory ConsumptionRuntime
The JS engine boot up memory is around 5 KB RAM
ApplicationDepends on the application and what it doesFor reference, JavaScript* application running on Zephyr OS/Arduino 101*
80K RAM/384 ROMBLE physical web advertisingBLE GATT service with two characteristics (temperature and LED)PWM and AIO for controlling temperature sensor and RGB LEDI2C for LCD200 lines of JavaScript code
WHAT
*Other names and brands may be claimed as the property of others.
BLE
AIO
I2C
2.ConnecttoURL1.AdvertiseURL
4.ConnecttoBLEService 3.LoadApp
Web App
Android*Phone
ZephyrOS-hostedJavaScript*ApponArduino101*board
WebAppHostingCloud
5.Read&ControlDevice
Zephyr Project Booth Demo Details
*Other names and brands may be claimed as the property of others.
Browser IDEOnly in DEV modeCopy-n-Run3rd Party IDEsCLI ToolsWeb USB - NEW
Zephyr OS
JS Runtime
Web USB
JavaScript* App
Host PCUSB/BLE
*Other names and brands may be claimed as the property of others.
JavaScript APIsAPI Zephyr OS Node.jsEvents Now Core APIBuffer Now Core APIBLE Now Bleno NPMGPIO, I2C, AIO, etc. Now Johnny-Five likeOCF Now IoTivity-node NPMCoAP Planned CoAP NPMMQTT Planned MQTT NPMW3C Sensors Planned TBDHTTP Planned Core API
RoadmapWHEN
1H/16 2H/16 1H/17
Ø PoCØ Few APIsØ Arduino 101* support
Ø Subset of Node.js APIsØ OCF Ø BLEØ PIN and BUS AccessØ Copy-and-RunØ Browser IDEØ FRDM-K64F support
Ø More Node.js* APIsØ Power and BatteryØ CoAP, MQTTØ NFCØ Security and CryptoØ W3C SensorsØ Remote debugging
Open Source Projecthttps://github.com/01org/zephyr.jsWe want people to participate and contributeAlpha quality statusSample CodeAPI documentationREADME
SummaryJavaScript Application development on ZephyrOpen Source Project - Please JoinThis the first step - Let’s make many more together