Programming IoT Sensors with IoTDK on 96Boards Akira Tsukamoto, - - PowerPoint PPT Presentation

programming iot sensors with iotdk on 96boards
SMART_READER_LITE
LIVE PREVIEW

Programming IoT Sensors with IoTDK on 96Boards Akira Tsukamoto, - - PowerPoint PPT Presentation

Programming IoT Sensors with IoTDK on 96Boards Akira Tsukamoto, Linaro July 13, 2016 What is Linaro? Founded June 2010 Unites the Industry and Open Source community Work together on key projects Deliver great tools Reduce


slide-1
SLIDE 1

Programming IoT Sensors with IoTDK on 96Boards

Akira Tsukamoto, Linaro July 13, 2016

slide-2
SLIDE 2

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

slide-3
SLIDE 3

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

Linaro’s Mission

ARM SoC

Open Source Future ARM tech porting Kernel Optimizing gcc Optimizing graphics, etc. Internal patches SoC specific code Closed Source Applications Proprietary code

各社 共通課題 各社 差異化ポイント イノベーションの 高速化が著しい ROIの向上 共 同 開 発

~ Leading Collaboration in ARM Eco System

slide-4
SLIDE 4

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

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

slide-5
SLIDE 5

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

slide-6
SLIDE 6
  • 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%)

slide-7
SLIDE 7

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
slide-8
SLIDE 8

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

slide-9
SLIDE 9

▣ Generic hardware platform enabling SoC differentiation ▣ Key enabler for reference software platform ▣ Mezzanine ecosystem for peripherals & sensors

IoT Edition Cortex-A & R/M Consumer Edition Cortex-A Enterprise Edition Cortex-A Linaro Groups 96Boards Editions

Cross vendor community hardware

slide-10
SLIDE 10

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%

  • f cost of SoC

development**

HW Pro Hobbyist SW

slide-11
SLIDE 11

96Boards Specifications

▣96Boards CE - Published

○Camera Interface Addendum

▣96Boards EE - Published

○MicroATX Addendum

slide-12
SLIDE 12

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

slide-13
SLIDE 13

*#5 in top 10 best Hacker Boards of 2015* linux.com June 2015 *Qualcomm DragonBoard 410C LeMaker Cello AMD Opteron A1120 96Boards EE LeMaker HiKey uCRobotics Bubblegum-96 MediaTek Helio X20 dev board with deca-core CPU OSAWG:Open SoC Android Working Group Qualcomm SD 600eval TV

slide-14
SLIDE 14

DragonBoard 410c

Supported OSes Supported IoT Platforms

slide-15
SLIDE 15

▣ 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

slide-16
SLIDE 16

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

slide-17
SLIDE 17

96Boards EE - Product Specification

ITEM 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

slide-18
SLIDE 18

Google AOSP

Support for HiKey 64 bit Octa Cortex-A53 96Boards is now available in AOSP public tree

http://source.android.com/

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

slide-19
SLIDE 19

▣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

slide-20
SLIDE 20

▣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

slide-21
SLIDE 21

STMicro and Seeed Mezzanines LeMaker 7” LCD touchscreen display Aerocore-2 drones & Quadcopters Eureka Automotive Dual-camera module with Display Camera Mezzanine Marvell Andromeda Box Robomezzi

slide-22
SLIDE 22

All the others...

slide-23
SLIDE 23

How IoT Sensors are connected?

slide-24
SLIDE 24

GPIO pins are especially good to use when programming simple sensors

  • r actuators which only require single data line.

For example:

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

GPIO

SoC

Sensor C Sensor B Sensor A

GPIO_A GPIO_B GPIO_C Separate line for each Sensor

slide-25
SLIDE 25

I2C

SoC

Sensor C Sensor B Sensor 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!
slide-26
SLIDE 26

Why IoTDK is good?

slide-27
SLIDE 27

Requires implementing same code for every boards.

All different codes of Sensors on GPIO, I2C

Raspberry Pi 96Boards X 96Boards Y API of GPIO, I2C Kernel and SoC

Sensor A GPIO Sensor B I2C Sensor C I2C

Sensor programs X API of GPIO, I2C Kernel and SoC API of GPIO, I2C Kernel and SoC Sensor programs Y Sensor programs Z

Sensor A GPIO Sensor B I2C Sensor C I2C Sensor A GPIO Sensor B I2C Sensor C I2C

slide-28
SLIDE 28

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, I2C Kernel and SoC

Sensor A GPIO Sensor B I2C Sensor C I2C

Sensor programs X API of GPIO, I2C Kernel and SoC API of GPIO, I2C Kernel and SoC Sensor programs Y Sensor programs Z

Sensor A GPIO Sensor B I2C Sensor C I2C Sensor A GPIO Sensor B I2C Sensor C I2C

APIs are all different

slide-29
SLIDE 29

Unifying codes of Sensors on GPIO, I2C

Common API Common API Common API

Sensor A GPIO Sensor B I2C Sensor C I2C

Sensor programs X

Sensor A GPIO Sensor B I2C Sensor C I2C

Sensor programs X

Sensor A GPIO Sensor B I2C Sensor C I2C

Sensor programs X Raspberry Pi Able to use same code API of GPIO, I2C Kernel and SoC API of GPIO, I2C Kernel and SoC API of GPIO, I2C Kernel and SoC 96Boards X 96Boards Y

slide-30
SLIDE 30

Good isn’t it? ☺

Which part is libmraa and libupm?

Common API Common API Common API

Sensor A GPIO Sensor B I2C Sensor C I2C

Sensor programs X

Sensor A GPIO Sensor B I2C Sensor C I2C

Sensor programs X

Sensor A GPIO Sensor B I2C Sensor C I2C

Sensor programs X Raspberry Pi

libupm

libmraa

API of GPIO, I2C Kernel and SoC API of GPIO, I2C Kernel and SoC API of GPIO, I2C Kernel and SoC 96Boards X 96Boards Y

slide-31
SLIDE 31

Many Drivers of Sensors are already implemented http://iotdk.intel.com/docs/master/upm/modules.html

slide-32
SLIDE 32

How to program Sensors on Linux?

slide-33
SLIDE 33

Internet Connection

WIFI $ nmtui

  • r

USB-Ethernet adaptor

slide-34
SLIDE 34

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

slide-35
SLIDE 35

Connecting Grove RGB backlight LCD, I2C

slide-36
SLIDE 36

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

slide-37
SLIDE 37

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;

slide-38
SLIDE 38

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); }

slide-39
SLIDE 39

Build and run sample program #1, I2C

Build Commands: $ g++ rgb-lcd-demo.cpp -o rgb-lcd-demo -g -Wall -lupm-i2clcd Running Commands: $ sudo ./rgb-lcd-demo

slide-40
SLIDE 40

Where to find linking library?

http://iotdk.intel.com/docs/master/upm/classupm_1_1_jhd131 3m1.html#details

slide-41
SLIDE 41

Connecting Grove LED module, GPIO

slide-42
SLIDE 42

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;

slide-43
SLIDE 43

Build and run sample program #2, GPIO

Build Commands: $ g++ led-gpio-demo.cpp -o led-gpio-demo -g -Wall -lmraa Running Commands: $ sudo ./led-gpio-demo

slide-44
SLIDE 44

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-specification https://www.96boards.org/ee-specification

Collaborate in Linaro for IoT Success

slide-45
SLIDE 45

96Boards.org

Questions?

slide-46
SLIDE 46

Linaro Confidential 2015

CORE

level

CLUB

level

GROUP

Level

96BOARDS COMMUNITY