As the saying goes, the beginning is always the hardest. When you first start, do you feel completely lost about where to begin? Searching online leads you to a pile of new terms that leave you confused, and even finding books in the library feels aimless? With ARM, Linux, and U-Boot all swirling in your mind, it can be overwhelming. Where should you start?
Follow my journey as I learn to design embedded engineers!
In simple terms, we will go from basic ARM knowledge to bare-metal programming, from uCOSII to Linux, from basic Linux commands to shell programming, from U-Boot to file systems, and finally to Linux driver programming. We will start simple and gradually move to complex topics, progressing from basic to advanced.
1
Phase 1: Basics of Embedded Hardware and Bare-Metal Programming
1. Knowledge Points:
(1) Basic knowledge of ARM processors, operating modes, registers, interrupts and exceptions, addressing modes, assembly instruction set
(2) Familiarize with the ADS integrated development environment to prepare for bare-metal programming
(3) Bare-metal programming: LED, serial port, LCD, touch screen, NAND FLASH, IIC, IIS, DMA, etc.
2. Process and Purpose:
This phase of learning mainly focuses on familiarizing yourself with embedded hardware, laying the foundation for future Linux drivers. Since the main architecture of embedded systems is ARM, we will focus on ARM learning. Start with the basics and then practice on the development board. The materials used in this phase include:
(1) “ARM Embedded Basics Tutorial” – This book mainly covers the fundamentals of ARM. It discusses ARM7, but the basic instruction set and model are the same across ARM.
(2) “Complete Manual for Embedded Linux Application Development” – This book mainly covers the S3C2410 interface module section, which is essential for understanding hardware during bare-metal experiments.
3. Time Required: Approximately two months.
2
Phase 2: Linux Basics and Shell Programming
1. Knowledge Points:
(1) Basic knowledge of Linux
(2) Linux installation and usage
(3) Common Linux commands
(4) Using vi
(5) Basic shell programming
2. Process and Purpose:
This phase focuses on familiarizing yourself with Linux, learning to install Linux, understanding basic knowledge, and performing simple operations. It’s recommended to install Linux on a virtual machine at first, and for development boards, install Fedora 9 according to the provided instructions, then practice various commands.
The main resource for this phase is “The Linux Command Line” by William Shotts. You don’t need to read the entire book, but focus on the early chapters that describe Linux fundamentals and basic commands. You won’t remember all the commands, so it’s okay to look them up as needed. The main goal of this phase is to gain an overall understanding of Linux, knowing at least some basic concepts and being able to perform basic operations.
3. Time Required: Approximately one month.
3
Phase 3: Basic Development of Linux Applications
1. Knowledge Points:
(1) Basics of GCC, GDB, Make
(2) File and time programming
(3) Multi-process and multi-thread program design
(4) Inter-process communication
2. Process and Purpose:
This phase focuses on understanding the writing and debugging of Linux applications, which are all foundational knowledge. The main purpose is still to familiarize yourself with Linux. Understanding some concepts related to application programming will lay the groundwork for future learning. The main reference for this phase is “Standard Tutorial for Embedded Linux Application Development,” which details the writing of applications on Linux and is not too difficult. The classic book “Advanced Programming in the UNIX Environment” goes deeper, but it can be challenging for beginners, so it’s best to start with simpler materials. After learning application programming, it’s not necessary to focus solely on applications, but it is a fundamental skill for those in the embedded Linux industry.
3. Time Required: Approximately one month.
4
Phase 4: Learning the uCOSII Operating System
1. Knowledge Points:
(1) Concepts and basic knowledge of embedded real-time operating systems
(2) Reading uCOSII operating system source code
(3) Porting uCOSII
(4) Application programming for the uCOSII operating system
2. Process and Purpose:
This phase focuses on understanding the basics of embedded real-time operating systems, as uCOSII is open-source and allows for code study. It provides an intuitive understanding of task scheduling and resource management. Reading its source code can improve your programming skills and standardize your coding habits. Although a ported version of uCOSII is provided, performing the actual porting process yourself will yield deeper insights.
This operating system is relatively simple, so writing applications is crucial, and implementing several functionalities will help in understanding the system. The main reference for this phase is the translated book by Shao Beibei, “Embedded Real-Time Operating System uCOS-II,” which provides detailed analysis of the source code. After thoroughly understanding this book, you will have an in-depth understanding of uCOSII. The main goal of this phase is to grasp operating system knowledge, such as task scheduling, concurrency, and race conditions. Another goal is to enhance your programming skills, as reading a book on operating system principles can be tedious. I find that studying the source code of an operating system is much more rewarding than reading countless books on the principles.
3. Time Required: Approximately one month.
5
Phase 5: Bootloader Learning
1. Knowledge Points:
(1) Basic knowledge of bootloaders
(2) Basics and commands of U-Boot
(3) Porting U-Boot
2. Process and Purpose:
The bootloader is an essential part of a Linux embedded system. This phase focuses on understanding the role of the bootloader and the knowledge of the universal bootloader—U-Boot. Start by learning various commands of U-Boot, then analyze the boot process of U-Boot, the Makefile, and how U-Boot loads the kernel. Follow others’ steps to port the kernel step by step, and after familiarizing yourself with the entire U-Boot process, complete the U-Boot porting independently and add your modifications. The main references for this phase are the U-Boot porting reference manual that comes with the CD and various online articles. I feel that there are abundant online resources for U-Boot porting.
3. Time Required: Approximately one month.
6
Phase 6: Filesystem Learning
1. Knowledge Points:
(1) Types and functions of Linux filesystems
(2) Familiarity with using BusyBox and the Linux system boot process
(3) Building your own root filesystem
2. Process and Purpose:
The filesystem is also an indispensable part of a Linux embedded system. This phase focuses on familiarizing yourself with the role and basic knowledge of the root filesystem, and building your own root filesystem. The main book for this phase is “Building Embedded Linux Systems,” which details all elements of embedded Linux, including filesystems. Here, I mainly focus on the filesystem section. I also refer to some online articles. First, you need to familiarize yourself with basic Linux filesystems, then learn to use BusyBox and understand the Linux boot process, and finally, follow others’ steps to build your own filesystem.
3. Time Required: Approximately half a month.
7
Phase 7: Embedded Graphical User Interface (GUI)
1. Knowledge Points:
(1) Types and characteristics of embedded graphical user interfaces
(2) Basic knowledge of MiniGUI
(3) Porting MiniGUI and programming
2. Process and Purpose:
The embedded graphical user interface (GUI) is also an important aspect of embedded upper systems. I only studied MiniGUI because QT requires knowledge of C++, which I have not learned. So I focused only on MiniGUI-related knowledge. The goal of this phase is mainly to familiarize myself with the development process of embedded graphical interfaces since I do not plan to focus on applications in the future.
All I need to do is to port MiniGUI to the board and run a hello program. There’s no need to delve deeply into other aspects. By porting MiniGUI, I will gain a new understanding of software and library running on Linux, the principles of program execution, and the compiler.
3. Time Required: Approximately half a month.
8
Phase 8: Basic Knowledge of Linux Driver Programming
1. Knowledge Points:
(1) Read “Linux Device Drivers” but skip the chapters on network drivers, tty drivers, and block drivers; read everything else.
(2) Experiment with all examples in the book, analyze results carefully, and understand related knowledge points.
(3) Even for examples, maintain consistent programming habits and document standards.
2. Process and Purpose:
The purpose of this phase is to lay the foundation for Linux drivers. “Linux Device Drivers” (3rd Edition), also known as LDD3, is the most classic book on Linux drivers that must be read and reviewed multiple times. The first time reading can be difficult, and it may seem obscure, but after several readings, it can be enlightening. After reading the book, work on the examples in the experiment book.
3. Time Required: Approximately two months.
9
Phase 9: Practical Linux Driver Development
1. Knowledge Points:
(1) Understand the registration and implementation of miscellaneous character devices through LED drivers, and grasp the I/O operation process of MINI2440.
(2) Master basic interrupt implementation methods through button driver programs.
(3) Understand PWM driver programming.
(4) Understand the implementation of the input device model through touchscreen driver programs.
(5) Understand the design of ADC driver programs.
(6) Understand the design of watchdog and RTC driver programs.
(7) Analyze the implementation of the platform device model through LCD driver programs.
2. Process and Purpose:
This phase focuses on mastering the implementation of simple driver programs and analyzing the differences from LDD3. This learning experience will deepen your understanding of Linux driver programming and enhance your ability to read extensive code. The main work in this phase is to read code, experiment, read code, and experiment, learning knowledge through phenomena.
3. Time Required: Approximately one month.
10
Phase 10: In-Depth Study of Linux Kernel and USB Subsystem
Having completed the first nine phases, I feel that I have entered the world of embedded Linux. Therefore, I am planning the tenth phase. This phase will help determine my future direction. Since standard interfaces in embedded systems now include USB, learning USB-related knowledge is highly competitive. Those working with drivers should have a certain understanding of the kernel, so “Understanding the Linux Kernel” is essential.
This phase mainly involves learning the USB protocol, reading the entire code of the Linux USB subsystem, deepening my understanding of USB through code reading, and then familiarizing myself with various USB class protocols, writing and porting USB drivers. USB is the direction I have chosen because I believe in specializing in one area rather than trying to do everything poorly. Thus, I have decided to learn about USB and pursue a career related to embedded USB work. This phase of study is ongoing, and I am currently exploring the vast code of the Linux USB subsystem.
1. “Microcontroller and Embedded System Applications” is fresh off the press in the November electronic edition.
2.What technologies are behind the era of multi-technology-integrated robots?
3.If you aspire to be an electronic engineer, what should you do in school?
4.Summarizing valuable experiences since my first encounter with FPGA~
5.For those involved in embedded drivers, you must persevere!
6.The future belongs to algorithms, not code.
Disclaimer: This article is a network reprint, copyright belongs to the original author. If there are any copyright issues, please contact us, and we will confirm the copyright based on the materials you provide and pay the remuneration or delete the content.