| Language | English (US) |
| Version | 1.1.1 |
| Main topics | Introduction and general architecture of embedded Linux systems, the hardware and its boot process, building and using a cross-compiling toolchain, building and configuring the bootloader (U-Boot), configuring and building the Linux kernel, device tree and kernel modules, building a rootfs from scratch with BusyBox, developing an embedded web server, accessing hardware devices on Linux (led, button, GPIO, PWM, I2C, accelerometer, display, etc), filesystem types for Linux, using a build system (Buildroot and Yocto Project/OpenEmbedded) to generate customized Linux distributions, application development, building with make, debugging on embedded Linux (GDB, Valgrind, strace, etc), graphical application development with Qt, configuring and using Eclipse on embedded Linux |
| Duration | 3 days - 24 hours - 50% theory and 50% practice |
| Trainer | Sergio Prado |
| Audience | Students, engineers, developers and team leaders that work with software development for embedded systems |
| Prerequisites | Basic knowledge of Linux distributions, the command line interface and the C language |
| Training material | The training material contains the slides and exercises documents, some reference guides and support files. All material is provided in electronic form at the beginning of the training |
| Development Kit | Development kits are loaned to students during training to carry out practical activities. By default, the Colibri i.MX6 (ARM Cortex-A9) module from Toradex is used. If needed, and depending on the requirements of the contracting company, the training can be delivered on a different hardware platform |
Presentation: Introduction - History of free software and the GNU/Linux operating system, main features and advantages of Linux, myths and facts about using Linux in embedded products, components of an embedded Linux system, hardware for embedded Linux and selection criteria, characteristics of a toolchain, the role and characteristics of the bootloader, introduction to the Linux kernel, rootfs and BusyBox, build systems, embedded Linux developer roles and skills.
Exercise: Connecting and testing the target - In this activity we will connect the host to the target through the serial port and configure a serial communication application to access the target console.
Presentation: Toolchain - Definition and characteristics, types of toolchain, basic components of a GNU-based toolchain (gcc, binutils, etc), the standard C library and a comparison between glibc, uClibc-ng and musl, sysroot and header files, toolchain selection criteria, installing and using a prebuilt toolchain, building your own toolchain with crosstool-ng.
Exercise: Using and building toolchains - In this activity we will learn how to use a prebuilt toolchain and build our own toolchain to cross-compile applications.
Presentation: Bootloader - Characteristics and responsibilities of a bootloader, the boot process on x86, the boot process on ARM, popular bootloaders on embedded Linux, introduction to U-Boot, configuring, building and flashing U-Boot, the U-Boot command line interface, environment variables and scripts.
Exercise: Building and testing U-Boot - In this activity we will study the process of building, flashing and configuring U-Boot on the target.
Presentation: Linux kernel - Kernel overview, components and basic architecture, process management and scheduling, memory management and the MMU, hardware interface and I/O management, the kernel source code, the development process, configuring and building the kernel, device tree, kernel command line.
Exercise: Building and testing the Linux kernel - In this activity we will study how to configure, build and boot the Linux kernel on the target.
Presentation: Rootfs - Introduction to filesystems, mount points, the root filesystem and the mechanisms used to mount the rootfs, initramfs, mounting the rootfs over the network via NFS, rootfs organization and the main directories of a Linux system, device files, the proc and sysfs virtual filesystems, the boot process and startup scripts, configuring and building BusyBox.
Exercise: Creating a rootfs for the target - In this activity we will create a simple and functional rootfs for the target. The rootfs will use the tools provided by BusyBox and will be mounted over the network via NFS. We will see how using NFS makes the embedded Linux development process much easier. We will also access leds, GPIOs and the 7-segment display of the target through sysfs, and implement an embedded web server with a page that can drive a led.
Presentation: Kernel modules - Monolithic kernel and microkernel, characteristics and advantages of kernel modules, building and installing modules, module dependencies, loading and unloading modules.
Exercise: Working with kernel modules - In this activity we will learn how to build, install and load kernel modules.
Presentation: Filesystems - Types of storage devices, filesystems for block devices, journaling, filesystems for flash memory, hybrid devices (eMMC, SD card) and F2FS, flash memory precautions, read-only (SquashFS, EROFS), volatile (tmpfs) and overlay (OverlayFS) filesystems, filesystem selection criteria.
Exercise: Booting the rootfs from the SD card - In this exercise we will configure the system to boot the rootfs directly from the SD card.
Presentation: Build systems - Using off-the-shelf distributions, building customized distributions, Yocto Project and Buildroot, a comparison between the two projects, configuring and building Buildroot.
Exercise: Building a Linux system with Buildroot - In this activity we will use Buildroot to build a Linux system from scratch for the target. We will also configure SSH access, access buttons and the I2C bus, and customize the rootfs with additional applications.
Presentation: Application development - Choosing software components, free software licenses (GPL, LGPL, non-copyleft/permissive) and what to watch out for when using them, software build tools (Make, Autotools, CMake, Meson), cross-compiling with Make.
Exercise: Cross-compiling with Makefile - In this activity we will study how to cross-compile applications with Makefile and develop C programs to access the hardware on Linux.
Presentation: Graphical application development - The Linux graphics stack, the DRM and framebuffer subsystems, the display server concept, X11 and Wayland, graphics toolkit concepts, SDL, GTK, Flutter, Qt, web applications.
Exercise: Developing applications with Qt - In this activity we will learn how to use Qt as an application development framework on embedded Linux.
Presentation: Application debugging - Debugging on embedded Linux, remote debugging with GDB, core dump analysis, memory usage and race condition analysis with Valgrind (memcheck and helgrind), tracing applications with strace and ltrace.
Exercise: Debugging applications with GDB - In this activity we will learn how to debug applications on embedded Linux with GDB.
Presentation: Application development tools - Programming languages, version control tools, integrated development environments (IDE).
Exercise: Developing and debugging with Eclipse - In this activity we will learn how to configure and use Eclipse as an integrated development environment on embedded Linux, finishing with a motion sensor application that uses the target’s accelerometer and buzzer (PWM).
Presentation: Final considerations - Book recommendations, questions and final comments, conclusion.