24
Intel Edison: Beyond the breadboard 1 By: Yeo Kheng Meng ([email protected] ckware v1.9 (29 June 2016)

Intel Edison: Beyond the Breadboard

  • Upload
    yeokm1

  • View
    409

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Intel Edison: Beyond the Breadboard

1

Intel Edison: Beyond the breadboard

By: Yeo Kheng Meng ([email protected])Hackware v1.9 (29 June 2016)

Page 2: Intel Edison: Beyond the Breadboard

2

Why beyond the breadboard?

One of Algoaccess’s hardware product

Page 3: Intel Edison: Beyond the Breadboard

3

Algo Access’s hardware setup

OD, OS, CYL…

OD, OS, CYL…

Direct or USB-Ethernet adapter

RS232 DB-9 Serial port

Page 4: Intel Edison: Beyond the Breadboard

4

Agenda1. Intel Edison Basics2. Hardware experience3. Software experience

Page 5: Intel Edison: Beyond the Breadboard

5

So what is the Intel Edison?

35.5mm x 25 mm x 3.9mm System-on-module (SOM) • Using Hirose 70-pin DF40 Series Connector (0.4mm pitch)

Page 6: Intel Edison: Beyond the Breadboard

6

Raspberry Pi 3 vs Intel Edison specifications

Specifications Raspberry Pi 3 Intel EdisonCPU 1.2Ghz quad-core BCM2837

Cortex-A53ARMv8 (64-bit)

500Mhz dual-core Intel Atom x86 (32-bit)+Intel Quark MCU

GPU 400Mhz Videocore IV NoneRAM 1GB DDR2 1GB DDR3Storage External microSD cad 4GB eMMC flash onboardNetworking Single band 802.11n Wifi + Dual-mode BT + LAN Dual-band 802.11n Wifi + Dual-mode BT

I/0 Connectivity 3.3V level level GPIO bank + connectors 1.8V logic level GPIO-bank

Price US$35 US$50++Power consumption (Idle/Peak) 1W/3.6W 0.1W / 1 W Dimensions 85 x 56 x 17mm 35.5 x 25 x 3.9mm

Page 7: Intel Edison: Beyond the Breadboard

7

2 models of Intel Edison

No chip antenna image from:http://www.nix.ru/autocatalog/thin_clients/208148_2254_draft_large.jpgFrom Intel Edison Compute Module Hardware Guide (June 2016) Page 13http://www.intel.com/content/www/us/en/support/boards-and-kits/000005808.html

Page 8: Intel Edison: Beyond the Breadboard

8

Official Intel carrier boards

Mini Breakout board• USB Serial• USB-OTG• GPIO pins (1.8V logic level)

• ~US$25

Arduino Breakout board• Arduino-style pins• USB-Serial• USB-OTG• Micro-SD slot• DC Jack 7-15V DC• 3.3V or 5V logic levels depending on J9 position

• Default is 5V• ~US$60

https://www.arduino.cc/en/ArduinoCertified/IntelEdison

Page 9: Intel Edison: Beyond the Breadboard

9

Sparkfun stackable/carrier boards

Base Block

64x48 0.66” OLED + buttons “Level-shiftable” GPIO breakout 9-DOF IMU Dual H bridge Battery board

Page 10: Intel Edison: Beyond the Breadboard

10

Prototyping: Bare breakout board

• Hirose 70-pin DF40 Series Receptacle Connector (0.4mm pitch)• Tough to solder by hand without magnifying glass/microscope• Stencil highly recommended to avoid solder bridges • https://github.com/algoaccess/intel-edison-pin-breakout

Page 11: Intel Edison: Beyond the Breadboard

11

Hirose 70-pin DF40 interface Pin Function Description

1, 5, 9, 11, 13, 15

GND Ground

2, 4, 6 VSYS in Power Input (3.3V to 4.5V)

14 DCIN Connect to VSYS if powered from external power

8, 10, 12 3.3V/1.8V out Reference voltage (100mA)

46, 61, 63, 65 UART1(with flow control)

UART with flow control/dev/ttyMFD1

22, 27 UART2(no flow control)

Linux debug serial port/dev/ttyMFD2

3, 16, 18, 20 USB(USB_VBUS does not supply power)

USB interface

41, 4345, 47

I2C1I2C6

2x I2C interfacesOnly master supported

51, 53, 55, 57, 59

SPI Master/Slave supportedChip select: 51, 53

Picture from: https://learn.sparkfun.com/tutorials/general-guide-to-sparkfun-blocks-for-intel-edison

All pins except power and USB operate at 1.8V levels

Page 12: Intel Edison: Beyond the Breadboard

12

1.8V logic levels• All pins except power and USB operate at 1.8V levels

• But most chips are using 3.3/5.0 V

• For eg, MAX3232 RS232-TTL transceiver (3.3V)

• Use a level shifter like TXS0108EPWR• Reference 1.8V from Module Pin 12

• For LEDs, you can just use a transistor

Page 13: Intel Edison: Beyond the Breadboard

13

Bug: Using GPIO48 destabilises Wifi

http://iotdk.intel.com/docs/master/mraa/edison.html

Arduino Pin 7 can sometimes negatively impact the WiFi capability, if using WiFi avoid using this pin

Pin Naming Aliases:GP48Compute Module Pin 32Arduino Pin 7

Page 14: Intel Edison: Beyond the Breadboard

14

Avoid GPIO48

J19, Pin 6

Page 15: Intel Edison: Beyond the Breadboard

15

USB On-The-Go

Adapted from Intel Edison Compute Module Hardware Guide (June 2016) Page 36http://www.intel.com/content/www/us/en/support/boards-and-kits/000005808.html

• Host mode• Connect USB peripherals like flash drives

• Client mode• Loading firmware (DFU mode)

• USB OTG supports both Host and Client

• Can use a Double pole, double throw (DPDT) switches

USB Role USB_ID (Pin 3)

FAULT(Pin 19)

USB_VBUS (Pin 20)

Host GND Floating Floating

Client Floating GND Host 5V

GND

Fault

USB_ID

USB-A Power Line

USB_VBUS

Source 5V

Client

Host

Page 16: Intel Edison: Beyond the Breadboard

16

Intel Edison Linux Distributions

1. 1.6 (Default)• Based on “Poky” Linux distribution• Compile Poky Linux sources/packages using provided toolchain and recipes• Limited “opkg” package manager and few default packages

• (eg, no nano, only vi)• Can add third party “meta-openembedded” recipes during compile time

2. • Produced by Emutex Labs• Based on Debian 7 Wheezy (2013)• More packages compared to Yocto using (apt-get)• Packages outdated compared to Debian 8 Jessie (2015)

3. Compile your own: Yocto or Debian Jessie

• All use old kernel version 3.10.17 (Oct 2013)

Page 17: Intel Edison: Beyond the Breadboard

17

Poor default support for USB-Ethernet and USB-Serial adapters• Only supports adapters based on these chipsets

• Ethernet: ASIX AX88xxx USB 2.0 to Gigabit adapter• Serial: Prolific PL2303 USB-Serial adapter

• More support requires kernel recompilation

Page 18: Intel Edison: Beyond the Breadboard

18

Small rootfs partition size

• 1.4GB, 541MB available on initial boot, may be too small for some uses• Modifying rootfs partition size requires recompilation

Page 19: Intel Edison: Beyond the Breadboard

19

My compilation script

• Compiles in all available USB-Ethernet/Serial drivers, custom rootfs size• Downloads sources, modifies compile options then compile• https://github.com/algoaccess/edison_mod_kernel_image_gen

Page 20: Intel Edison: Beyond the Breadboard

20

Lengthy compilation time• 4-6 hours typical• Use the cloud -> Google Compute Engine or AWS (About half hour on 32 threads)

• export SETUP_ARGS="--parallel_make=32 --bb_number_thread=32"

• IMPORTANT: Remember to SHUT DOWN your instance once finished, if not hefty charges will be incurred!!!

Page 21: Intel Edison: Beyond the Breadboard

21

File System safety for embedded systems

• Improper shutdown of systems can corrupt file systems• Cause: System off while data is being written

1. Read-only file system• No writes to file-system allowed, no chance of system corruption

2. Enable full-journaling• File-system journals store a list of changes to be made• Ext4 default is to journal meta-data only, not the data itself• We should also journal the data for additional protection

Page 22: Intel Edison: Beyond the Breadboard

22

Read-only file system (preferred)• ----------------/etc/fstab------------------------rootfs / auto ro 1 1/dev/disk/by-partlabel/boot /boot auto ro 1 1/dev/disk/by-partlabel/home /home auto ro 0 2tmpfs /var/tmp tmpfs nodev,nosuid 0 0tmpfs /var/log tmpfs nodev,nosuid 0 0

• ------------------------------------------------------• tmpfs: RAM drive• nodev,nosuid: Security precautions for world-writeable file-systems

https://gist.github.com/yeokm1/00bf00fbcda99cc33c2b

Page 23: Intel Edison: Beyond the Breadboard

23

Mount file system to journal everything• Set journal option to / partition

• tune2fs -o journal_data /dev/mmcblk0p8

• Set journal option to /home partition• tune2fs -o journal_data /dev/mmcblk0p10

• ----------------/etc/fstab------------------------• rootfs / ext4 data=journal,sync,noatime 1 1• /dev/disk/by-partlabel/boot /boot auto ro 1 1• /dev/disk/by-partlabel/home /home ext4 data=journal,sync,noatime 0 2

• ------------------------------------------------------

• data=journal: Journal everything. Data will be written twice, first in to journal, second into disk• sync: Commit changes to disk immediately, do not cache. Performance loss• noatime: Do not store last access time to increase disk performance to avoid updating access time in every sync

Page 24: Intel Edison: Beyond the Breadboard

24

QnA