programming iot sensors with july 13, 2016 iotdk on ... renesas 360 (3.0%) 10 ibm 346 (2.9%) linaro...

46
Programming IoT Sensors with IoTDK on 96Boards Akira Tsukamoto, Linaro July 13, 2016

Upload: vunhu

Post on 17-May-2018

215 views

Category:

Documents


2 download

TRANSCRIPT

Programming IoT Sensors with IoTDK on 96Boards

Akira Tsukamoto, LinaroJuly 13, 2016

What is Linaro?

▣ Founded June 2010

▣ Unites the Industry and Open Source community

▣ Work together on key projects

▣ Deliver great tools

▣ Reduce industry wide fragmentation and redundant effort

▣ Provide common software foundations

▣ http://www.linaro.org/about/

▣ https://en.wikipedia.org/wiki/Linaro

➢ARM 向けソフトウェアの共同開発により➢ARMのエコシステムの充実をすすめ ➢メンバー企業の競争力を高めることを目的とする

Linaro’s Mission

ARM SoC

Open SourceFuture ARM tech porting

KernelOptimizing gcc

Optimizing graphics, etc.

Internal patchesSoC specific code

Closed SourceApplications

Proprietary code

各社共通課題

各社差異化ポイント

イノベーションの高速化が著しい

ROIの向上共同開発

~ Leading Collaboration in ARM Eco System

Linaro のメリット

Linaroは、ARM を利用したいセットベンダーが商品化するうえで、必須である Android/RDK/Yocto/BSP などプラットフォーム部分の最新技術をメンバー企業で共同開発する組織です。

具体的なメリット最近はソフトの開発コストの増大が問題となっておりますが、すべて自前で自社で開発するコストをメンバー企業で分担できる。ARM のプラットフォーム開発に内部で参加していることで、顧客に対して他社より最新の技術とプラットフォームの提供につながる。グローバルノウハウを製品開発に活用することで、製品の魅力の向上につながる。マーケットイン(Time to Market)の早期化

Important Strategic Projects for the ARM Ecosystem● Open Source ARM tools● Power Management● Kernel Consolidation across ARM SoCs● Open Source Security (including OP-TEE)● Reference Software Platform● Software Defined Architecture - Openstack (LEG)● Big Data on ARM (LEG)● OpenDataPlane (LNG)● Reference Digital Media Platform (LHG)● Android Optimization on ARM (LMG)● Project Ara (LMG)

Lead Projects

● Linux Kernels 3.5 - 4.5 May 2012 - March 2016● Over ¼ million total changesets

in these releases● Linaro contributed >4.4%

(11.2k)● Linaro consistently in top five

company contributors

Linaro Influence in the Linux Kernel

Sources: http://www.remword.com/kps_result/index.php & https://lwn.net/Articles/679289/

Top Linux Contributors by Company: Kernel 4.5

1 Intel 1,734 (14.4%)

2 (Unknown) 975 (8.1%)

3 Red Hat 732 (6.1%)

4 Linaro 723 (6.0%)

5 (None) 628 (5.2%)

6 Samsung 513 (4.3%)

7 SUSE 382 (3.2%)

8 Atmel 380 (3.2%)

9 Renesas 360 (3.0%)

10 IBM 346 (2.9%)

Linaro Influence - Maintainerships

● ARM SOC● CPUIdle drivers● CPUFreq drivers● Common clock framework● Clocksource core● Clocksource / Clockevent drivers● Timekeeping / NTP● Char and Misc drivers● Generic include / asm headers● KVMfor ARM/ARM64● Open Firmware / Flattened Device Tree● Mailbox API● AVS drivers● Backlight class / subsystem● MFD framework● GPIO subsystem● Pinctrl subsystem● SPI subsystem● Regulator framework● RapidIO subsystem

● Linux Kernel ● Linux Kernel (Continued)● Register map abstraction● Sound / ASoC● DMA buffer sharing framework

● MMC/SD/SDIO framework

● Non-kernel projects● ODP● LAVA● Debian● DejaGNU● LLVM● GDB● Gentoo● KDE● Xdg-utils● OpenJDK● OpenEmbedded● OpenMandriva

What’s 96Boards?▣ Recognised low cost ARMV7/8 open specifications

▣ SoC independant

▣ Tailored for different segment requirements

▣ A single developer community, sharing solutions

▣ Open to all developers

▣ Hardware modules are portable across all 96Boards

▣ Fully upstream path available for 96Boards hardware

▣ Generic hardware platform enabling SoC differentiation

▣ Key enabler for reference software platform

▣ Mezzanine ecosystem for peripherals & sensors

IoT EditionCortex-A & R/M

Consumer Edition

Cortex-A

Enterprise Edition

Cortex-A

LinaroGroups

96BoardsEditions

Cross vendor community hardware

Target for 96Boards

Sources: *IDC 2013, **ITRS 2007, **IBS 2009

▣ Commercial & higher education

software development

▣ OEM/ODMs - for IoT, mobile,

compute, enterprise

▣ Maker market - Robotics, UAV, HPC,

etc

20 million

SW

developers globally*

Software >60%

of cost of SoC

development**

HWPro

HobbyistSW

96Boards Specifications

▣96Boards CE - Published

○Camera Interface Addendum

▣96Boards EE - Published

○MicroATX Addendum

96Boards Use Cases

▣ Out of the box Single Board Computer for software developers

▣ Expansion and customization options for the maker community

▣ Low-cost Single Board Computer for embedded OEM products

*#5 in top 10 best Hacker Boards of 2015* linux.com June 2015

*QualcommDragonBoard 410C

LeMaker CelloAMD Opteron A1120 96Boards EE

LeMaker HiKey

uCRoboticsBubblegum-96

MediaTek Helio X20 dev board with deca-core CPU

OSAWG:Open SoC Android Working Group

Qualcomm SD 600evalTV

DragonBoard 410c

Supported OSes

Supported IoT Platforms

▣ Minimum 0.5GB DRAM (1GB+ for Android)▣ Optional eMMC Flash Storage▣ 802.11a/b/g/n + Bluetooth 4.0 LE▣ 3 USB ports (1 OTG), minimum USB2.0▣ HDMI video output with audio▣ microSD v3.0 socket▣ Standardized Maker IO, DSI display & CSI camera interfaces▣ Extended version for additional functionality▣ 8-18V DC @ 2A power

CE Boards Additional Specs

96Boards EE - Product Introduction

LeMaker Cello

AMD Opteron A1120, Quad-core A57

GBit Ethernet, USB 3.0, PCIe and SATA

UEFI/ACPI firmware

Supported by Linaro Reference Software

Preorder today for July delivery $299

http://www.lenovator.com/product/103.html

96Boards EE - Product SpecificationITEM SPECIFICATION

SoC AMD Opteron A1100 Series

CPU Quad-core ARM Cortex-A57 64 bit

DRAM Two DDR3 SO-DIMM sockets

SATA Two SATA ports

USB Two USB 3.0 ports

Console USB-micro port for console support

Ethernet 1 GBe Ethernet

PCIe x16 PCIe G3 slot

JTAG 10-Pin JTAG headers

Expansion Interface Linaro 96Boards Expansion slot

Dimension Standard 160×120 mm 96Boards Enterprise Edition form factor

Weight 500g

Google AOSP

Support for HiKey 64 bit Octa Cortex-A53 96Boardsis now available in AOSP public treehttp://source.android.com/

A community board with ongoing support in AOSP will help developers and peripheral vendors to accelerate adoption in new Android versions

▣96Boards platforms offer standardised hardware platforms and reference software

▣Generic hardware platform supporting implementations at

◆ Device - IoT specification

◆ Gateway - CE/EE specification

◆ Server - EE specification, running server infrastructure and cloud IaaS

▣Reference software solutions

◆ End-to-end reference implementation for IoT use cases, tailored to implementation

◆ Device - SDK together with Mezzanine kits

◆ Gateway - SDK, middleware, application gateway

◆ Server - PaaS reference solution

Platform Deployment Example

▣Enable product design and application development

▣Build once and run on any 96Boards Compliant hardware

▣Developer support infrastructure

▣Enables a developer community around peripheral devices

for SoCs (Communications, Sensors, Displays & Cameras)

Mezzanine Boards and Modules

STMicro and SeeedMezzanines

LeMaker 7” LCD touchscreen display

Aerocore-2 drones & Quadcopters

Eureka Automotive

Dual-camera module with Display

Camera MezzanineMarvell Andromeda Box

Robomezzi

All the others...

How IoT Sensors are connected?

GPIO pins are especially good to use when programming simple sensors or actuators which only require single data line.

For example:• LEDs, Relays, Buzzers, Buttons, Passive Infrared sensor (PIR)• Many more!

GPIO

SoCSensor CSensor BSensor A

GPIO_AGPIO_BGPIO_C

Separate line for each Sensor

I2C

SoCSensor CSensor BSensor A

SDA (data)SCL (clock)

Shared line for all Sensors

I2C pins are especially good to use when programming more complex sensors or actuators which require multiple data lines.

For example:• Ultrasonic sensors, Stepper motors and servos, LCD screen, LED

matrices• Many more!

Why IoTDK is good?

Requires implementing same code for every boards.

All different codes of Sensors on GPIO, I2C

Raspberry Pi 96Boards X 96Boards Y

API of GPIO, I2CKernel and SoC

Sens

or A

GPI

OSe

nsor

B I

2CSe

nsor

C I

2C

Sensor programs X

API of GPIO, I2CKernel and SoC

API of GPIO, I2CKernel and SoC

Sensor programs Y Sensor programs Z

Sens

or A

GPI

OSe

nsor

B I

2CSe

nsor

C I

2C

Sens

or A

GPI

OSe

nsor

B I

2CSe

nsor

C I

2C

Requires implementing same code for every boards.

All different codes of Sensors on GPIO, I2C (2/2)

Raspberry Pi 96Boards X 96Boards Y

API of GPIO, I2CKernel and SoC

Sens

or A

GPI

OSe

nsor

B I

2CSe

nsor

C I

2C

Sensor programs X

API of GPIO, I2CKernel and SoC

API of GPIO, I2CKernel and SoC

Sensor programs Y Sensor programs Z

Sens

or A

GPI

OSe

nsor

B I

2CSe

nsor

C I

2C

Sens

or A

GPI

OSe

nsor

B I

2CSe

nsor

C I

2C

APIs are all different

Unifying codes of Sensors on GPIO, I2C

Common API Common API Common API

Sens

or A

GPI

OSe

nsor

B I

2CSe

nsor

C I

2C

Sensor programs X

Sens

or A

GPI

OSe

nsor

B I

2CSe

nsor

C I

2C

Sensor programs X

Sens

or A

GPI

OSe

nsor

B I

2CSe

nsor

C I

2C

Sensor programs X

Raspberry Pi

Able to use same code

API of GPIO, I2CKernel and SoC

API of GPIO, I2CKernel and SoC

API of GPIO, I2CKernel and SoC

96Boards X 96Boards Y

Good isn’t it? ☺

Which part is libmraa and libupm?

Common API Common API Common API

Sens

or A

GPI

OSe

nsor

B I

2CSe

nsor

C I

2C

Sensor programs X

Sens

or A

GPI

OSe

nsor

B I

2CSe

nsor

C I

2C

Sensor programs X

Sens

or A

GPI

OSe

nsor

B I

2CSe

nsor

C I

2C

Sensor programs X

Raspberry Pi

libupm

libmraaAPI of GPIO, I2CKernel and SoC

API of GPIO, I2CKernel and SoC

API of GPIO, I2CKernel and SoC

96Boards X 96Boards Y

Many Drivers of Sensors are already implemented

http://iotdk.intel.com/docs/master/upm/modules.html

How to program Sensors on Linux?

Internet Connection

WIFI $ nmtui orUSB-Ethernet adaptor

Installing libmraa and libupm (IoTDK)Commands:$ sudo apt-get install libmraa-dev libupm-dev

The command above will install the following four packages:• libmraa0: contains only libraa run-time library• libmraa-dev: includes header files to compile program using

libmraa• libupm0: contains only libupm run-time library• libupm-de: includes header files to compile program using

libupm

Connecting Grove RGB backlight LCD, I2C

Download, build and run sample program

Commands:

$ git clone https://github.com/96boards/Starter_Kit_for_96Boards$ cd Starter_Kit_for_96Boards$ cd rgb_lcd_demo$ make$ sudo ./rgb_lcd_demo

Inside the sample program #1, I2C (1/2)

upm::Jhd1313m1* lcd;

string str1 = "96Boards!"; string red = "fantastic :)";

lcd = new upm::Jhd1313m1(I2C_BUS, 0x3e, 0x62);

display(lcd, str1, red, RGB_RED);

delete lcd;

Inside the sample program #1, I2C (2/2)

void display(upm::Jhd1313m1* lcd, string str1, string str2, int red, int green, int blue) {

lcd->clear(); lcd->setColor(red, green, blue); lcd->setCursor(0,0); /* first row */ lcd->write(str1); lcd->setCursor(1,0); /* second row */ lcd->write(str2);

}

Build and run sample program #1, I2C

BuildCommands:$ g++ rgb-lcd-demo.cpp -o rgb-lcd-demo -g -Wall -lupm-i2clcd

RunningCommands:$ sudo ./rgb-lcd-demo

Connecting Grove LED module, GPIO

Inside the sample program #2, GPIO

mraa::Gpio* gpio; gpio = new mraa::Gpio(GPIO_E); gpio->dir(mraa::DIR_OUT); /* DIR_IN exist too*/while (true) {

gpio->write(0); sleep(SLEEP_TIME); gpio->write(1); sleep(SLEEP_TIME);

} delete gpio;

Build and run sample program #2, GPIO

BuildCommands:$ g++ led-gpio-demo.cpp -o led-gpio-demo -g -Wall -lmraa

RunningCommands:$ sudo ./led-gpio-demo

Linaro のホームページhttp://www.linaro.org/

Linaro の技術情報ページhttps://wiki.linaro.org/FrontPage

Linaro のダウンロードページhttp://www.linaro.org/downloads/https://wiki.linaro.org/Cycles/1509/Release

96boards のホームページhttps://www.96boards.org/

96boards の技術情報ページhttps://github.com/96boards/documentation/wiki

96boards の開発ページhttps://github.com/96boards

96boards の規格書https://www.96boards.org/ce-specificationhttps://www.96boards.org/ee-specification

Collaborate in Linaro for IoT Success

96Boards.org

Questions?

Linaro Confidential 2015

CORElevel

CLUBlevel

GROUPLevel

96BOARDS

COMMUNITY