41
1/41 Advancement on Embedded System Design (Linux) Professor Dr R. Badlishah Ahmad Universiti Malaysia Perlis (UniMAP) 2014 http://www.researchgate.net/profile/RBadlishah_Ahmad

Advancement on embedded linux-v2

Embed Size (px)

Citation preview

1/41

Advancement on Embedded System

Design (Linux)Professor Dr R. Badlishah AhmadUniversiti Malaysia Perlis (UniMAP)

2014

http://www.researchgate.net/profile/RBadlishah_Ahmad

2/41

Contents

Embedded Operating System FOSS Embedded System Embedded Operating System (OS) Advantages For Developers

Hardware: Single Board Computer (SBC)

Advantages of using SBC

GNU/Linux – Advantages & Samples

Example – Smart Camera

Challenges for New Developers

Conlusion

3/41

Embedded Systems

Embedded System Definition: Wikipedia definition: “a special-purpose computer system, which is completely encapsulated by the device it controls”– Never meant to be traditional, general purpose

computers– Examples: mobile phones, home multimedia, network

appliances, transportation or industrial control...– Use a general purpose processor (most popular ones: arm, x86, ppc) or even a much simpler microcontroller.

See http://en.wikipedia.org/wiki/Embedded_system

4/41

Embedded Market

In embedded systems, Free/Open Source Software (FOSS) systems ate a significant portion of the market of traditional proprietary systems.

5/41

Embedded Operating System

Embedded Operating System (EOS) is a software program that manages all other programs in embedded devices

EOS is a small OS designed to operate with embedded devices to perform certain tasks which control effectively all the hardware components

~50MB http://www.damnsmalllinuxdamnsmalllinux.org/

6/41

Embedded Operating System

Real-Time & Non Real-Time (commercial!!) QNX, DOS, Windows CE, LynxOS VxWorks PSOS RTLinux

Other Choices?? FOSS based OS create your own? Yes, modify GNU/Linux

kernel!!!! FREE

7/41

Linux

The most popular.Very big and active developer community

Supports many architectures, devices and protocols

Minimum requirements: 32 bit processor, 2 MB of RAM, 1 MB of storage space (can even fit in 500 KB!)

License: GNU GPLKernel code: use with care to avoid license violations.Great for Linux users though (more free code!)

8/41

NetBSD

http://netbsd.org Highly portable BSD system. Supports many architectures and embedded boards! Smaller community but very active too! Minimum RAM and storage requirements should be similar to

those of Linux License: BSD. No worries with license violations, but doesn't

require driver code to be free (some drivers kept proprietary?) See http://foss.in/2005/slides/netbsd-linux.pdf

for a very nice comparison between Linux and NetBSD

9/41

eCos

http://ecos.sourceware.org/ Very lightweight real-time embedded system

contributed by Red Hat / Cygnus solutions. Compatible with most Unix and Linux applications. For extremely small systems: supports 16 bit processors, and a few

hundreds of KB of RAM and storage (like 300 KB) are more than enough.

Kernel + applications can even fit within 50 KB (minimalistic system)!

License: GPL (with minor adjustments)

10/41

uClinux

http://uclinux.org/ (pronounce “You See Linux”) Linux for micro controllers, processors with no MMU Mainly used for very small and low cost

embedded systems Kernel: originally a Linux kernel derivative.

Now more and more closely integrated in mainstream Linux

Applications: standard embedded Linux applications with patches to address special memory constraints

Computer vs. Embedded Linux

Linux kernel

GNU C library

libjpeg, libstdc++, libxml, libvorbis...

ls, vi, wget, ssh, httpd, gcc...

Web browser, office, multimedia...

Command line utilities

Kernel

C library

Shared libraries

User interface

Traditional GNU/Linux system Embedded Linux system

uClibc Much lighterthan GNU libc!

libjpeg, libstdc++, libxml, libvorbis...

busybox(ls, vi, wget, httpd...)dropbear (ssh)...

Much lighterimplementations!No development tools

Linux kernel

Custom interface

Lightweight kernelwith only neededfeatures and drivers

Full kernel with most featuresand with drivers for all kindsof PC hardware on the planet!

Graphics,web browser,web server...

12/41

Advantages for System Developers

13/41

Innovation and Added Value

Lots of ready-to-use components for most parts of the system Focus on the innovative part of your product, what

differentiates it No need to wait for months or years for some features to be

implemented by others

– can implement the critical ones that you need Constant innovation Features brought in at a quick pace, sometimes even before

you need them! Possible to port Linux to a new innovative architecture

(processors)

14/41

Hardware

15/41

Single Board Computer (SBC)

Characteristics✔ Computer like✔ Manufactures with important peripherals✔ Stand-alone computer✔ Ready-made device

Constraint✔ Small RAM (in comparison to Desktop)

16/41

Advantech’s “Half-Biscuit” Ampro’s EnCore

Kontron’s Standalone SBCKontron’s EPIC SBC

TS-7200 ARM SBC

TS-5500 PC/104

Choices of SBC

17/41

Choices of SBC

PandaBoard

Rasberry Pi

18/41

When & Why to use SBC

Faster Time to Market Proven design by vendor -> reliable design and

reduce risk of defect More vendor choices (different size, functions and

price options Lack of resources (hardware designer) Lack of manufacturing capabilities

19/41

Advantages of using SBC & FOSS

Faster speed development Reduce development speed Increasing clock speed Capabilities of using Open Source Software

(OSS)/Free Software (FS) Support high level programming

20/41

When & Why to use SBC

Faster Time to Market Proven design by vendor -> reliable design and

reduce risk of defect More vendor choices (different size, functions and

price options Lack of resources (hardware designer) Lack of manufacturing capabilities

21/41

FOSS

Free Software/Open Source Software A type of software defined by its collaborative

development model, accessibility of code and distribution models.– Examples of FOSS: GNU/Linux kernel,

GNU Compiler Collection (GCC), Open Office, GIMP (Image Editor), Wireshark etc.

In contrast with proprietary software which is only available in a binary “closed” format & typically carries a licence fee– Examples : M$

22/41

FOSS

Free Software grants the below 4 freedoms to the user:

The freedom to run the program, for any purposeThe freedom to study how the program works,and adapt it to one's needsThe freedom to redistribute copies to help othersThe freedom to improve the program, and release one's improvements to the public

See http://www.gnu.org/philosophy/free-sw.html

FOSS - Unix family treeTime1970 19901980 2000

Bell Labs (AT&T)

Ken ThompsonDennis Ritchie (C languagecreated to implement a portable OS)

BSD (Berkeley Software Distribution)

Sun Solaris

SunOS (Stanford University Network)

NetBSD

NextStep

 AIX (IBM)

HP­UX

IRIX (SGI)

SRV5

OpenBSD

FreeBSD

MacOS X

Bill Joy

Richard Stallman Linus Torvalds

BSD family

System V familyRitchie, Thompson

GNU

Bill Joy

GNU / Linux

24/41

GNU/Linux

Unix-based OS originally developed for Intel-compatible PC's

Modern OS -> include features such as virtual memory, memory protection and preemptive multitasking

Support TCP/IP for de-facto Networking Good Thing!!!! Source code available!!! (Open

Source/Free Software)

25/41

GNU/Linux

Embedded Linux is increasing due to ability to modify subsystem code to suit their designs

Support Portable Operation Interface (POSIX) -> easy to port existing code to different processor architecture

NOW!! GNU/Linux are available for x86, SPARC, ARM, PowerPC, MIPS etc....

26/41

GNU/Linux Advantages

Robust Features – multi-threaded, multi-functions Scalability – can run on flash cards and boards to

PCs and larger system Widespread acceptance – community of

programmers available Low Cost – NO ROYALTIES!!!!

27/41

Embedded GNU/Linux

28/41

Embedded GNU/Linux

29/41

Embedded GNU/Linux

30/41

Example : Smart Camera

A sample of Embedded GNU/Linux developed in UniMAP potential for projects such as:✔ Video Wireless Sensor Network (VWSN) for

Traffic Surveillance SystemUsing GNU/Linux & Free Software tools (GCC)Using TS5500 SBC BoardDevelopment tasks:✔ Integrating Web Camera✔ Developing software for image capture, image

conversion, image manipulations and socket programming

31/41

Smart Camera

Situation awareness is the key to security and safetyTraffic operators are assigned the task of visual monitoring and threat detection process which is tedious and error prone for a human investigator

Introduction

Problems: Inefficient network monitoring

● traffic operators are burden with visual monitoring task, therefore a threat detection process would be ineffective, unreliable and prone to error

● the presence of stationary vehicle on the road, especially at a critical places could cause a secondary crashes, traffic congestion and other traffic incident.

Therefore, there is a NEED of a vision system to give earlier detection and notification of stationary vehicle to the security personnel or traffic operator on the events

Objective

To develop, integrate, configure and analyze the performance of Embedded Vision System for stationary vehicle detection utilizing

GNU/Linux and Single Board Computer

System Overview

Network

SBC

Monitor

Alarm

USB Webcam

Supervision Center

Smart Camerautilizing SBC as a processor and Logitech Quickcam Pro 4000 web camera as an image sensor. Task : to monitor road conditions and detect stationary vehicle inside the monitoring area.If the object of interest is detected on the scene, the system will notify the operators by transmitting the image to the supervision center.

Hardware

SENSING UNIT

LOGITECH QUICKCAM PRO4000

● VGA-sized (640x480 pixel) CCD sensor● capture video at maximum 30 frames

per second. ● driver used : pwc-8.8 & usb-pwcx-8.2.2

PROCESSING & COMMUNICATION UNIT

TS-5500 SINGLE BOARD COMPUTER

AMD Elan 520 processor (133 Mhz) 32 MB RAM 10/100 Base-T Ethernet port

Software Module

Divided into 3 modules:✔ Module 1: Image Acquisition✔ Module 2: Image Processing and Object Detection✔ Module 3: Data Transmission

ProcessesIMAGE CAPTUREIMAGE CAPTURE

COLOR SPACE COLOR SPACE CONVERSIONCONVERSION

FRAME FRAME DIFFERENCINGDIFFERENCING

NOISE NOISE REMOVALREMOVAL

OBJECT OBJECT EXTRACTIONEXTRACTION

FILTERING FILTERING (CONVOLUTION)(CONVOLUTION)

DETECTION & DETECTION & IMAGE SAVING IMAGE SAVING

& & NOTIFICATIONNOTIFICATION

Performance Analysis

Specification Desktop PC SBC

Processor Type Intel(R) Pentium(R) 4 CPU AMD Elan 520

Processor Speed 2.66 GHz 133 MHz

RAM Size 512 MB 32 MB

Operating System Mandriva 2006 TS-Linux

Smart Camera Operation Platform

Overall Processing (s)

Desktop PC 6.09

TS-5500 SBC 38.82

39/41

Challenges for Developers

Understanding system & file structure Revising programming skill in C/C++ for socket

programming, shell programming & database Ability to do various system configuration using CLI Understanding cross compiling process & techniques Difficulties to integrate external devices such as Webcam,

touchscreen etc.. :Kernel version mismatch!! Difficulties to compile on the SBC!! programming are done

on a host PC Execution problem on SBC board due to library mismatch

between host PC and SBC Limited/No Technical support

40/41

Conclusion

Embedded GNU/Linux and the use of SBC can be extended into many more fields such as automation, robotic, firewall, intrusion detection system, carried grade telecommunication and network devices

The availability of FOSS, Linux kernel and GNU application development tools, ANY applications or system can be build!!!!

Wide opportunities for other embedded system development Exercise your FREEDOM by using FOSS Technology is HERE, Human Resource?

41/41

Q&A

SMART CAMERA PROTOTYPE