Android for Industrial
   Applications



   Marcel Ziswiler
Noser Engineering AG




                         1   1
Contents
Contents
                                 Introducing Android
Introducing Android              Why Android for ...
Introducing Android



         What is Android?
    How about its architecture?
What are the system requirements?
What ke...
Contents



Introducing Android
                             Open-source mobile phone platform initiated by Google
Why An...
Android Architecture
Contents



Introducing Android


Why Android for industrial
Applications



Introducing the Hardware...
System Requirements
Contents
                                 Recent Linux kernel running on your target HW
Introducing A...
Android Kernel Extensions
Contents
                                 Ashmem
                                   mm/ashmem....
Android Kernel Extensions (cont.)
Contents
                                 Logger
                                   dr...
Android Kernel Extensions (cont.)
Contents
                                 Power management
                            ...
Android Kernel Configuration
Contents
                                 Requires one to enable previously discussed featur...
Special Considerations
Contents
                                 Frame buffer
                                   Require...
Touch Screen Calibration
Contents
                                 No support for calibration as required by resistive to...
Why Android for Industrial Applications?




              What is already there?
What is missing to make it a suitable fr...
What is already there?
Contents
                                 Robust embedded Linux kernel
Introducing Android        ...
What is still missing?
Contents
                                 Hard real-time kernel: support for real-time code
Introd...
What is still missing?
Contents
                                 Framework extensions for typical industrial use-cases
In...
Introducing the Hardware




  What are the key components?
 Toradex Colibri XScale PXA320
Toradex Limestone PDA Design Ki...
What are the Key Components?
Contents
                                 Most embedded HW centred around System On Chip (So...
Colibri XScale PXA320
   SoC: Marvell XScale PXA320 at 806 MHz
   Memories
     Volatile: 128 MB Hynix, Micron or Qimon...
Limestone PDA Design Kit
   Marvell XScale PXA320 at 806 MHz
   Memories
     Volatile: 128 MB Hynix, Micron or Qimonda...
Notes about Porting Embedded Linux/Android



     How to port embedded Linux to your HW?
     How to port the Android ker...
Porting Embedded Linux
Contents
                                 First check what is supported by open-source
Introducing...
Porting Android Kernel Extensions
Contents
                              ●   What we got so far
                          ...
Porting the File System with the
                             Android Framework and its Applications
Contents
            ...
Real-Time Extension - Xenomai
Contents
                                 Real-time emulation framework
Introducing Android...
IOs, Field Busses and Wired Comm.
Contents
                                 Linux kernel's GPIOlib
Introducing Android   ...
27
Continuing Information
    Visit us at our booth at the
     Embedded Computing Conference 2009
    Attend one of our ne...
Upcoming SlideShare
Loading in …5
×

Embedded LInux in a Nutshell

1,912 views
1,824 views

Published on

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,912
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
95
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Embedded LInux in a Nutshell

  1. 1. Android for Industrial Applications Marcel Ziswiler Noser Engineering AG 1 1
  2. 2. Contents Contents  Introducing Android Introducing Android  Why Android for Industrial Applications Why Android for industrial Applications  Introducing the Hardware Introducing the Hardware  Notes about Porting Embedded Linux/Android  Real-Time Extension – Xenomai Notes about Porting Embedded Linux/Android  IOs, Field Busses, Wired Communication Real-Time Extension  Continuing Information IOs, Field Busses, Wired Communication 2 2
  3. 3. Introducing Android What is Android? How about its architecture? What are the system requirements? What kernel extensions are required? 3
  4. 4. Contents Introducing Android Open-source mobile phone platform initiated by Google Why Android for industrial Applications  Building a better phone for consumers  source.android.com Introducing the Hardware Open handset alliance Notes about Porting  Several companies innovate in the open Embedded Linux/Android  …Increased openness will enable everyone in our industry to innovate more rapidly and respond better to consumer's demands. … Real-Time Extension  openhandsetalliance.com IOs, Field Busses, Wired Noser Engineering AG is a founding member of the OHA and works Communication on core functionality (core libraries, certification framework) 4
  5. 5. Android Architecture Contents Introducing Android Why Android for industrial Applications Introducing the Hardware Notes about Porting Embedded Linux/Android Real-Time Extension IOs, Field Busses, Wired Communication 5
  6. 6. System Requirements Contents  Recent Linux kernel running on your target HW Introducing Android  ARM based SoC  Low-level assembly optimisation Why Android for industrial Applications  Code generation in graphics subsystem Introducing the Hardware  128 MB SDRAM Notes about Porting  256 MB flash favourably of the NAND kind Embedded Linux/Android  Optimised for 16 bpp QVGA LCD with capacitive touch screen Real-Time Extension  At least 5 button navigation keypad IOs, Field Busses, Wired Communication 6
  7. 7. Android Kernel Extensions Contents  Ashmem  mm/ashmem.c Introducing Android  Anonymous shared memory subsystem Why Android for industrial Applications  Allow processes to share named blocks of memory  Kernel may reclaim them if not in use Introducing the Hardware  Binder IPC  drivers/android/binder.c Notes about Porting Embedded Linux/Android  System oriented component architecture  Providing object-oriented operating system environment Real-Time Extension  Inter-process communication (IPC) between processes and thread pools IOs, Field Busses, Wired Communication  Memory management and clean-up functionality 7
  8. 8. Android Kernel Extensions (cont.) Contents  Logger  drivers/android/ram_console.c Introducing Android  Store kernel log messages in RAM buffer Why Android for industrial Applications  drivers/android/logger.c  Logging mechanism for user processes to read and write Introducing the Hardware system log messages  Low Memory Killer Notes about Porting  drivers/misc/lowmemorykiller.c Embedded Linux/Android  Scans list of running processes and kills one Real-Time Extension  Optional component not required for basic bring-up IOs, Field Busses, Wired Communication 8
  9. 9. Android Kernel Extensions (cont.) Contents  Power management  drivers/android/power.c Introducing Android  At its core uses regular Linux power management subsystem Why Android for industrial Applications  Does not poll for power related changes  Uses iNotify interface via fs/inotify_user.c Introducing the Hardware  Subscribe to power related updates Notes about Porting Embedded Linux/Android  YAFFS2  Yet another flash file system 2nd edition  fs/yaffs2/* Real-Time Extension  Primary file system for low-cost high density NAND flash based IOs, Field Busses, Wired storage Communication  Not part of any mainline kernel yet 9
  10. 10. Android Kernel Configuration Contents  Requires one to enable previously discussed features Introducing Android  Standard Android kernel configuration (emulator) Why Android for industrial Applications arch/arm/configs/goldfish_defconfig Introducing the Hardware Notes about Porting Embedded Linux/Android Real-Time Extension IOs, Field Busses, Wired Communication 10
  11. 11. Special Considerations Contents  Frame buffer  Requires double buffering aka panning functionality Introducing Android  Allocate twice the memory required for actual frame size Why Android for industrial Applications  Pan function selects which part is actually output to screen Introducing the Hardware  Touch screen  Android uses standard Linux input subsystem Notes about Porting  Driver that not only reports pressure but button touch as well Embedded Linux/Android  BTN_TOUCH upon detecting pen down event  Many mainline touch drivers do not implement it that way Real-Time Extension  drivers/input/touchscreen/ucb1400_ts.c IOs, Field Busses, Wired  drivers/input/touchscreen/wm97xx-core.c Communication 11
  12. 12. Touch Screen Calibration Contents  No support for calibration as required by resistive touch screens Introducing Android  Only capacitive touch screens not requiring any calibration Why Android for industrial Applications  Traditionally touch screen calibration handled by tslib  Special ts_calibrate application Introducing the Hardware  Generates /etc/pointercal file containing calibration constants  Integrated calibration calculation into Android Notes about Porting Embedded Linux/Android  Did not bother to port actual calibration application to Android  Just integrate correct calibration file into Android file system Real-Time Extension  /system/etc/pointercal IOs, Field Busses, Wired Communication 12
  13. 13. Why Android for Industrial Applications? What is already there? What is missing to make it a suitable framework for industrial applications? 13
  14. 14. What is already there? Contents  Robust embedded Linux kernel Introducing Android  Most widely used native open-source libraries/components Why Android for industrial Applications  Well thought out partitioning between native and managed code Introducing the Hardware  Optimised virtual execution environment: Dalvik VM  Flexible application framework Notes about Porting Embedded Linux/Android  Well defined Java API for custom applications Real-Time Extension  User-friendly human machine interface (HMI) IOs, Field Busses, Wired  Complete development environment with Eclipse and QEMU Communication 14
  15. 15. What is still missing? Contents  Hard real-time kernel: support for real-time code Introducing Android  Safety critical aspects Why Android for industrial Applications  Support for industrial interfaces  Analog and digital IOs Introducing the Hardware  Field busses  Wired communication Notes about Porting Embedded Linux/Android Real-Time Extension IOs, Field Busses, Wired Communication 15
  16. 16. What is still missing? Contents  Framework extensions for typical industrial use-cases Introducing Android – Intelligent control systems Why Android for industrial – Instrumentation, control and automation Applications – Communication with (distributed) sensors and actuators Introducing the Hardware – Monitoring, processing and production – Signal analysis Notes about Porting Embedded Linux/Android – Process control  Standard applications suitable for industrial use-cases Real-Time Extension IOs, Field Busses, Wired Communication 16
  17. 17. Introducing the Hardware What are the key components? Toradex Colibri XScale PXA320 Toradex Limestone PDA Design Kit 17
  18. 18. What are the Key Components? Contents  Most embedded HW centred around System On Chip (SoC) Introducing Android  Important to understand bus/chip mapping  What chips hooked up to what buses: Why Android for industrial Applications AC97, I2C, PCI, peripheral, SDRAM controller, SPI, USB bus  Bus width vs. chip width Introducing the Hardware  Address pin used for command/data FIFO switching  Bus timing: SRAM vs. VLIO modes Notes about Porting Embedded Linux/Android  Specialities like address offsets (shifts) or latches/multiplexing Real-Time Extension  GPIO/interrupt routing  Most SoCs have at least partially re-configurable pins IOs, Field Busses, Wired  Usually completely board specific Communication  Displays: number of colour data lines vs. bits per pixel (bpp) 18
  19. 19. Colibri XScale PXA320  SoC: Marvell XScale PXA320 at 806 MHz  Memories  Volatile: 128 MB Hynix, Micron or Qimonda Mobile DDR RAM on 32 bit (2 x 16 bit chip) EMPI SDCS0  Non-volatile: 1 GB Hynix or Samsung NAND Flash on 8 bit ND_CS0  Ethernet: Asix AX88796BLF on 16 bit SRAM CS2, FIFO on ADDR11, address shifted by 1, interrupt GPIO36  Audio codec/touch: NXP UCB1400E on AC97, interrupt GPIO4_2  Power management: Maxim MAX8660 on power I2C addr 0x34  Display/touch: Sharp LQ043T3DX02 4.3” WQVGA, 480 x 272, 16 or 18 bpp 19
  20. 20. Limestone PDA Design Kit  Marvell XScale PXA320 at 806 MHz  Memories  Volatile: 128 MB Hynix, Micron or Qimonda Mobile DDR RAM on 32 bit (2 x 16 bit chip) EMPI SDCS0  Non-volatile: 1 GB Hynix or Samsung NAND Flash on 8 bit ND_CS0  Unfortunately no Ethernet  Audio codec/touch: Wolfson WM9713L on AC97, interrupt GPIO36  Power management: Maxim MAX8660 on power I2C addr 0x34  Fuel gauge: Ti Bq27210 on I2C addr 0x55  Display/touch: Hitachi TX09D40VM3CAA, 240 x 320, 16 bpp 20
  21. 21. Notes about Porting Embedded Linux/Android How to port embedded Linux to your HW? How to port the Android kernel extensions? How to port the file system with the Android framework and its applications? 21
  22. 22. Porting Embedded Linux Contents  First check what is supported by open-source Introducing Android – Chip vendors development board as base line Why Android for industrial  Step-by-step board bring up Applications – Serial debug console a must Introducing the Hardware – Ethernet/USB convenient for image loading (kernel RAM disk) or root file system mounting Notes about Porting Embedded Linux/Android  Boot concept needs to be understood Real-Time Extension  Low-level vs. high-level initialisation  SoC specific vs. generic code IOs, Field Busses, Wired Communication  Having the right tools at your finger tips – Low-level hardware JTAG debugger 22
  23. 23. Porting Android Kernel Extensions Contents ● What we got so far ● Android 1.5 kernel based on vanilla Linux 2.6.27 Introducing Android ● Colibri BSP kernel based on vanilla Linux 2.6.28 Why Android for industrial Applications ● Two possibilities ● Port Android modifications into our BSP kernel Introducing the Hardware ● Or vice versa Notes about Porting Embedded Linux/Android ● Depending on who did your BSP that code might be better understood by you speaking for second approach Real-Time Extension ● Android modifications rather well integrated/understood IOs, Field Busses, Wired Communication ● Analyse Android kernel modifications and integrate them into our BSP kernel 23
  24. 24. Porting the File System with the Android Framework and its Applications Contents  Initial RAM file system to boot-strap Android  Regular gziped cpio archive as initramfs Introducing Android  Contains just Android proprietary init process Why Android for industrial Applications  3 different flash partitions  Each 64 MB in size Introducing the Hardware  YAFFS2 NAND flash file system  System partition required to be pre-loaded Notes about Porting Embedded Linux/Android  User data partition  Cache partition Image File MTD Partition Mount Point Real-Time Extension ramdisk.img N/A / IOs, Field Busses, Wired system.img /dev/mtdblock0 /system Communication userdata.img /dev/mtdblock1 /data N/A /dev/mtdblock2 /cache 24
  25. 25. Real-Time Extension - Xenomai Contents  Real-time emulation framework Introducing Android  Supports traditional RTOS APIs as skins Why Android for industrial Applications  Merged with RTAI project in 2003 Introducing the Hardware  Common features and behaviour of traditional RTOS’  Thread scheduling Notes about Porting Embedded Linux/Android  Synchronisation  Co-kernel approach Real-Time Extension  Control HW interrupt management IOs, Field Busses, Wired Communication 25
  26. 26. IOs, Field Busses and Wired Comm. Contents  Linux kernel's GPIOlib Introducing Android  CAN/CANOpen: SocketCAN, CanFestival Why Android for industrial Applications  Open-source industrial Ethernet stacks Introducing the Hardware  Regular Ethernet interfaces  Requires integration into Android Notes about Porting Embedded Linux/Android – Settings – Events (Link up/lost) Real-Time Extension – Customised routing IOs, Field Busses, Wired Communication 26
  27. 27. 27
  28. 28. Continuing Information  Visit us at our booth at the Embedded Computing Conference 2009  Attend one of our next trainings Embedded Linux Seminar - June 18 & 19, 2009  Visit our website www.noser.com/linux  Or contact us for more information linux@noser.com 28

×