28.05.18 1
28.05.18 2
IoT Hardware
28.05.18 3
Architectures
●
MIPS
– 1981
– HDTV, wireless networks, VoIP
●
Power Architecture
– Networking and telecommunications-related embedded
applications
●
x86
●
ARM
– Sony PlayStation Portable (PSP), Apple iPhone
28.05.18 4
Operating Systems
28.05.18 5
Embedded Linux
●
Why linux?
– Supports a vast variety of hardware devices
– Supports a huge variety of applications and networking
protocols
– Linux is scalable
– Linux can be deployed without the royalties
– Linux has attracted a huge number of active developers
– An increasing number of hardware and software vendors
– Supports many programming languages
28.05.18 6
Busybox
The Swiss Army Knife of Embedded Linux
●
Tiny versions of many common UNIX utilities
●
Small and efficient single executable file
●
Can use as init process
●
Useful for cross compile
●
Multi call Binary‐call Binary
28.05.18 7
uCLinux
●
Microcontroller Linux
●
No MMU (Memory Management Unit)
●
No virtual memories
●
Architecture supported:
– ARM Cortex-M
– ARC
– MicroBlaze
– Blackfin
– Nios
28.05.18 8
Real Time Linux
●
Real-Time kernel patch – by Ingo Molnar
– PREEMPT_NONE
– PREEMPT_VOLUNTARY
– PREEMPT_DESKTOP
– PREEMPT_RT
28.05.18 9
Storage Options
●
NOR flash (few MB to a GB)
– Expensive
– Mapped into the CPU address space
– Useful for bootloader
●
NAND flash (tens of MB to tens of GB)
– Much cheaper than NOR
– Higher capacities
– Needs a lot of hardware and software support
28.05.18 10
Storage Options...
●
Managed flash
– MMC: Multi Media Card
– SD: Secure Digital
– eMMC
– UFS (Universal Flash Storage)
28.05.18 11
Bootloaders
●
Initialize the system to a basic level
●
Loads the operating system kernel
28.05.18 12
Bootloaders...
28.05.18 13
Bootloaders...
Name Main architectures supported
Das U-Boot ARC, ARM, Blackfin, Microblaze, MIPS, Nios2, OpenRiec, PowerPC, SH
Barebox ARM, Blackfin, MIPS, Nios2, PowerPC
GRUB 2 X86, X86_64
Little Kernel ARM
RedBoot ARM, MIPS, PowerPC, SH
CFE Broadcom MIPS
YAMON MIPS
28.05.18 14
UEFI
●
Universal Extensible Firmware Interface
●
The processor loads the platform initialization
firmware
●
load an EFI boot manager from the EFI System
Partition (ESP)
●
UEFI boot manager
– systemd-boot
– Tummiboot
28.05.18 15
Initramfs
●
Ramfs is a very simple filesystem that exports
Linux's disk caching mechanisms
●
A dynamically resizable RAM-based filesystem
●
gzipped "cpio" format archive
●
Linked into the linux kernel image
28.05.18 16
Device Tree
●
ARM does not come with any hardware
information
●
A flexible way to define the hardware
components
●
Loaded by the bootloader and passed to the
kernel
28.05.18 17
Device Tree...
28.05.18 18
Device Tree Example
serial@4806c000 {
compatible = "ti,dra742-uart", "ti,omap4-uart";
reg = <0x4806c000 0x100>;
interrupts = <0x0 0x44 0x4>;
ti,hwmods = "uart2";
clock-frequency = <0x2dc6c00>;
status = "disabled";
dmas = <0xb3 0x33 0xb3 0x34>;
dma-names = "tx", "rx";
};
28.05.18 19
Pinmux
●
Different embedded projects deal with different
components
●
We cannot attach an I2C device to a pin that
follows the protocol of the SPI bus
●
We cannot attach an analog sensor to the
GPIO pin
●
It is not possible to have that many CPU pins
●
share the functionalities of available pins
28.05.18 20
Toolchains
●
Set of tools that compiles source code into executables
– Compiler
– Linker
– Run-time libraries
●
Standard GNU toolchain components:
– Binutils: A set of binary utilities including the assembler and the linker
– GNU Compiler Collection (GCC): compilers for C, C++, Objective-C, Java, Fortran,
Ada, Go
– C library: A standardized application program interface (API) based on the POSIX
specification
28.05.18 21
Toolchains...
●
Native: toolchain runs on the same type of system
●
Cross: toolchain runs on a different type of system
than the target
Linaro, ( h t t p s ://w w w . l i n a r o . o r g / )
crosstool-NG
28.05.18 22
Application Binary Interface (ABI)
●
Guarantees that the libraries exist on all compliant
machines
●
Ensures the integrity of the interface
28.05.18 23
Application Program Interface (API)
●
glibc: it is the most complete implementation of the
POSIX API
●
musl libc: a small and standards-compliant
alternative to GNU libc
●
uClibc-ng: developed to work with uClinux
28.05.18 24
Application Program Interface (API)
28.05.18 25
API & ABI
28.05.18 26
Static & Dynamic Compiling
28.05.18 27
Yocto
●
Tools and methods to help you create custom Linux-
based systems
●
The Yocto Project is more than a distribution
●
Main Components:
– glibc
– BusyBox
– matchbox (for the windowing system)
28.05.18 28
Other Programming Languages
●
C++/Qt
●
Python
●
Golang
●
Node.js
●
Lua
●
Scratch
●
Java ...
28.05.18 29
Refrences

Embedded Linux

  • 1.
  • 2.
  • 3.
    28.05.18 3 Architectures ● MIPS – 1981 –HDTV, wireless networks, VoIP ● Power Architecture – Networking and telecommunications-related embedded applications ● x86 ● ARM – Sony PlayStation Portable (PSP), Apple iPhone
  • 4.
  • 5.
    28.05.18 5 Embedded Linux ● Whylinux? – Supports a vast variety of hardware devices – Supports a huge variety of applications and networking protocols – Linux is scalable – Linux can be deployed without the royalties – Linux has attracted a huge number of active developers – An increasing number of hardware and software vendors – Supports many programming languages
  • 6.
    28.05.18 6 Busybox The SwissArmy Knife of Embedded Linux ● Tiny versions of many common UNIX utilities ● Small and efficient single executable file ● Can use as init process ● Useful for cross compile ● Multi call Binary‐call Binary
  • 7.
    28.05.18 7 uCLinux ● Microcontroller Linux ● NoMMU (Memory Management Unit) ● No virtual memories ● Architecture supported: – ARM Cortex-M – ARC – MicroBlaze – Blackfin – Nios
  • 8.
    28.05.18 8 Real TimeLinux ● Real-Time kernel patch – by Ingo Molnar – PREEMPT_NONE – PREEMPT_VOLUNTARY – PREEMPT_DESKTOP – PREEMPT_RT
  • 9.
    28.05.18 9 Storage Options ● NORflash (few MB to a GB) – Expensive – Mapped into the CPU address space – Useful for bootloader ● NAND flash (tens of MB to tens of GB) – Much cheaper than NOR – Higher capacities – Needs a lot of hardware and software support
  • 10.
    28.05.18 10 Storage Options... ● Managedflash – MMC: Multi Media Card – SD: Secure Digital – eMMC – UFS (Universal Flash Storage)
  • 11.
    28.05.18 11 Bootloaders ● Initialize thesystem to a basic level ● Loads the operating system kernel
  • 12.
  • 13.
    28.05.18 13 Bootloaders... Name Mainarchitectures supported Das U-Boot ARC, ARM, Blackfin, Microblaze, MIPS, Nios2, OpenRiec, PowerPC, SH Barebox ARM, Blackfin, MIPS, Nios2, PowerPC GRUB 2 X86, X86_64 Little Kernel ARM RedBoot ARM, MIPS, PowerPC, SH CFE Broadcom MIPS YAMON MIPS
  • 14.
    28.05.18 14 UEFI ● Universal ExtensibleFirmware Interface ● The processor loads the platform initialization firmware ● load an EFI boot manager from the EFI System Partition (ESP) ● UEFI boot manager – systemd-boot – Tummiboot
  • 15.
    28.05.18 15 Initramfs ● Ramfs isa very simple filesystem that exports Linux's disk caching mechanisms ● A dynamically resizable RAM-based filesystem ● gzipped "cpio" format archive ● Linked into the linux kernel image
  • 16.
    28.05.18 16 Device Tree ● ARMdoes not come with any hardware information ● A flexible way to define the hardware components ● Loaded by the bootloader and passed to the kernel
  • 17.
  • 18.
    28.05.18 18 Device TreeExample serial@4806c000 { compatible = "ti,dra742-uart", "ti,omap4-uart"; reg = <0x4806c000 0x100>; interrupts = <0x0 0x44 0x4>; ti,hwmods = "uart2"; clock-frequency = <0x2dc6c00>; status = "disabled"; dmas = <0xb3 0x33 0xb3 0x34>; dma-names = "tx", "rx"; };
  • 19.
    28.05.18 19 Pinmux ● Different embeddedprojects deal with different components ● We cannot attach an I2C device to a pin that follows the protocol of the SPI bus ● We cannot attach an analog sensor to the GPIO pin ● It is not possible to have that many CPU pins ● share the functionalities of available pins
  • 20.
    28.05.18 20 Toolchains ● Set oftools that compiles source code into executables – Compiler – Linker – Run-time libraries ● Standard GNU toolchain components: – Binutils: A set of binary utilities including the assembler and the linker – GNU Compiler Collection (GCC): compilers for C, C++, Objective-C, Java, Fortran, Ada, Go – C library: A standardized application program interface (API) based on the POSIX specification
  • 21.
    28.05.18 21 Toolchains... ● Native: toolchainruns on the same type of system ● Cross: toolchain runs on a different type of system than the target Linaro, ( h t t p s ://w w w . l i n a r o . o r g / ) crosstool-NG
  • 22.
    28.05.18 22 Application BinaryInterface (ABI) ● Guarantees that the libraries exist on all compliant machines ● Ensures the integrity of the interface
  • 23.
    28.05.18 23 Application ProgramInterface (API) ● glibc: it is the most complete implementation of the POSIX API ● musl libc: a small and standards-compliant alternative to GNU libc ● uClibc-ng: developed to work with uClinux
  • 24.
  • 25.
  • 26.
    28.05.18 26 Static &Dynamic Compiling
  • 27.
    28.05.18 27 Yocto ● Tools andmethods to help you create custom Linux- based systems ● The Yocto Project is more than a distribution ● Main Components: – glibc – BusyBox – matchbox (for the windowing system)
  • 28.
    28.05.18 28 Other ProgrammingLanguages ● C++/Qt ● Python ● Golang ● Node.js ● Lua ● Scratch ● Java ...
  • 29.