Skip to main content

Embedded Linux Development

In this article we are going to study what is Embedded Linux and its advantages and the basic tools required in Embedded Linux development.

Introduction
Why Linux:
Linux is the operating system used in almost all embedded device projects. Linux provides powerful, flexible kernel source and runtime infrastructure that is being improved continuously by the open source community and extended by hardware vendors to support new processors, protocols, devices, etc. Embedded device projects can often reduce the cost of hardware by taking advantage of multi-tasking operating system brings to embedded devices. Implementing and maintaining a device specific Linux platform not an easy task. To build your own Linux platform several factors will be considered like finding compilers that produce executables for a target device, selecting open source software packages based on device requirement, how to choose suitable kernel for your hardware specific, how to assemble a kernel, system software and custom software into a format that a device can use and requires continued attention to fix the bugs and enhancements to your open source kernel.

Linux is an operating system also known as Linux kernel source, written by Linus Torvalds for the Intel processor (80386) architecture. The source code for latest kernel source is of contributions from thousands of people through the world. It is written in C programming language and it supports all computer architectures. It includes device drivers for thousands of devices and easily extended to support for new devices and protocols. The only difference between Linux kernel for desktop system and embedded device are the architecture and processors for which it is compiled. A Linux platform is a custom combination of a Linux kernel, system infrastructure and applications that run on a specific architecture and associated processor.

Embedded Linux:
Embedded Linux is the usage of the Linux kernel and various open source components in embedded systems, which are customized for the size and hardware constraints of embedded systems and includes software packages that support for variety of services and applications. The difference between embedded Linux and desktop PC is typically kernel compiled on the platform where it will execute, while in embedded Linux systems are usually compiled on one platform but are intended to be executed on another. The major difference between embedded systems and desktop PC is embedded systems are resource constrained compared to the desktop PC. An embedded system has limited memory, small disk space, and sometimes no external network connectivity. The only user interface for embedded system is a serial port and LEDs.

Advantages of Embedded Linux:
  • The advantage is free Linux kernel source and an open source components in embedded systems provides the ability of re use of components.
  • Based on the existing available components, we can design and develop advanced products.
  • An embedded system uses free software so the cost of the software will be zero, so that we can increase the budget for hardware and manpower.
  • With the advantage of open source we have full control over the software part of embedded system. It allows unlimited modifications, debugging, and optimization to the source code.
  • We can design system with high quality open source components which are widely used in many systems.
  • Open source being freely available, which will allow user to explore different types possibilities.
  • Open source software’s are developed by the communities, so users can get support easily from different communities.

Examples of embedded systems running Linux kernel:
  • Smart phones
  • Tablets
  • Development boards
  • Point of sale terminal
  • Laser cutting machines
  • Personal routers
  • Robotics

Embedded processor for Linux systems:
In the market so many embedded processor are available to choose for a given embedded system design. Some of embedded processors are shown in below.
  • The Linux kernel and other open source components support a wide range of 32 bit and 64 bit architectures. Linux kernel supports many stand alone processors and Integrated Processors.
    • ARM processor with hundreds of different SOC (System on Chip) in mobile, multimedia, auto mobile and industrial market.
    • IBM Power PC processor mainly in real time and industrial applications.
    • x86 -32 and x86-64 for PC platforms.
    • Micro blaze
    • Free scale power architecture
    • MIPS (Microprocessor without Interlocked Pipeline Stages) Architectures
    • Beagle board, etc..
  • Both MMU (Memory Management Unit) and Non- MMU architectures are supported.
  • Linux kernel is not designed for Microcontrollers.
  • The kernel, boot loader, tool chain and all other components are architecture independent.

Communication:
  • The Linux kernel has support for many communication channels.
    • UART
    • I2C
    • SPI
    • CANBUS
    • USB
    • MODBUS
    • JTAG
  • Networking support
    • Ethernet
    • Wifi
    • Bluetooth
    • TCP, UDP, IPv6, IPv4
    • Firewalling

Memory:
The most important aspect of embedded Linux development is that the embedded systems have limited physical resources in that memory will play crucial role.
  • RAM: Basic Linux system can work within 8MB of RAM, but most of the applications needed at least 32MB RAM. It will mostly depend on the applications size and type.
  • Flash: most of the embedded systems can work within the 4MB or 8MB of flash, but it needed more like 16MB to 256MB and more.
    • Flash storage will support both NOR flash and NAND flash.
    • Block storage will support both SD/MMC and eMMC file systems.

Types of Hardware Platforms:
  • Evaluation platforms: These are platforms from SoC vendor, in which many peripherals are built-in but very costly.
  • Component on Module: It is a small board with only restricted components like it contains CPU, RAM, Flash and few other components.
  • Custom Platforms: These platforms are development platforms available for making developed custom platforms.

We need select the hardware which will support by the Linux kernel, boot loader and other open source components. Otherwise there will huge difference in development cost and time. The general Architecture of Embedded Linux System is shown in Figure1.

Figure1: General of Embedded Linux system

The Software components in the above architecture are.
  • Boot loader: A boot loader is a small piece of code that is executed when a board is powered on. It is responsible for basic initialization of hardware and loads the kernel or standalone application images from ROM/flash or other storage devices.
  • Linux Kernel: The core part of the system is Linux kernel which is responsible for memory allocation, process and threads creation, memory management, network stack, device drivers, data transfer between hardware and peripheral devices and provides services to user space applications.
  • C library: The interface between user space and Kernel space applications.
  • Cross-Compilation tool chain: A Cross compiler is a compiler which runs on the development machine but generates executable files for the target board.

The Basic Architecture of Embedded Linux System:
Engineering Study Material
Figure2: Basic internal architecture of Embedded Linux System

Embedded Linux development environment
There are two ways to switch to embedded Linux solutions.
  • Use the solutions provided by third party vendors. These solutions come with their own development tools and environment. These vendors may use propriety tools also.
  • Use Community solutions. These are open source and supported by the open source communities.

Operating system for embedded Linux development
  • Select Linux as the operating system for development desktop because Linux also runs on the embedded device, so all the knowledge gained from using Linux on the desktop will be useful to embedded device also. Any recent Linux distribution can be used for development system.
    Example: Ubuntu, Fedora, OpenSUSE, etc.
  • In the embedded development, there is always a difference between Host system and Target System.
    • The host system will be development system which will be powerful desktop pc.
    • The target system which is embedded system/embedded device.
    • They are connected by various ways but most of the devices connected through serial line or Ethernet.

Engineering Study Material
Published date : 08 Dec 2015 11:47AM

Photo Stories