Embedded Linux: Skills for Low-Level vs Application Development

▲Click the card above to follow for more▲Embedded Linux: Skills for Low-Level vs Application DevelopmentMany newcomers and engineers learning embedded systems often feel confused midway through their studies, unsure of where to start or advance, and unclear about their current level of learning and how to improve themselves moving forward.To address these common situations faced by engineers, today the editor will share insights from an embedded engineer with 8 years of experience, discussing what skills you need to master in the next stage of embedded learning.

Career Directions for Embedded Engineers

Learning embedded systems can generally be divided into four directions:Embedded Linux: Skills for Low-Level vs Application Development 1. Embedded Hardware Development: Familiar with circuit knowledge and various commonly used components, mastering the development capabilities of analog and digital circuit design. Proficient in embedded hardware knowledge, familiar with hardware development models and design patterns, and experienced in developing embedded hardware platforms using ARM 32-bit processors. Master commonly used hardware design tools: Protel/PADS (PowerPCB)/Cadence/OrCad. Typically requires 4-8 layers of high-speed PCB design experience.2. Embedded Driver Development: Proficient in Linux operating systems, system architecture, computer organization principles, and data structures. Familiar with embedded ARM development, at least mastering Linux character driver development. Capable of porting development for microcontrollers and ARM embedded processors, understanding hardware schematics, independently completing related hardware driver debugging, possessing solid hardware knowledge, and able to write software drivers based on chip manuals. 3. Embedded System Development: Master Linux system configuration, proficient in processor architecture, programming environment, instruction sets, addressing modes, debugging, assembly, and mixed programming; master Linux file system creation, familiar with various file system formats (YAFFS2, JFFS2, RAMDISK, etc.); familiar with embedded Linux boot processes, familiar with modifying Linux configuration files; master the entire process of kernel trimming, kernel porting, cross-compilation, kernel debugging, writing bootloader programs, producing root file systems, and integrating and deploying Linux systems; familiar with setting up Linux software development environments (cross-compiling library files and environment configuration, etc.);4. Embedded Software Development: Proficient in Linux operating system concepts and installation methods, basic commands, management configuration, and editors, including VI editor, GCC compiler, GDB debugger, and Make project management tools; proficient in advanced programming knowledge of C language, including functions and program structures, pointers, arrays, common algorithms, and library function usage, and basic knowledge of data structures, including linked lists and queues; master the basic ideas of object-oriented programming and the fundamentals of C++; Proficient in program design under embedded Linux, proficient in the embedded Linux development environment, including system programming, file I/O, multi-process and multi-threading, network programming, GUI programming, and database; familiar with programming common graphics libraries such as QT, GTK, miniGUI, fltk, and nano-x. The daily activities in a company depend on its size; larger companies generally assign you to manage a module, so you need to be proficient in that area. If the company is smaller, you may need to handle a bit of everything. You also need to understand some hardware aspects. Having said so much, based on my personal experience, the biggest difference between embedded systems and pure software is: Pure software focuses on learning a programming language, such as C, C++, Java, or even Python; ultimately, a language is just a tool, much like learning English, French, or Japanese. However, embedded learning involves both software and hardware; in simple terms, it is about creating systems and products, emphasizing not just specific language tools, but more about how to decompose a product into actionable software and hardware, as well as smaller units.Embedded Linux: Skills for Low-Level vs Application Development Many people ask, should I choose driver development or application development for future employment? The only answer is to follow your interest, and driver and application development are not entirely separate. The specific reasons are as follows:1) The term “driver” does not limit itself to hardware operations; it also includes concepts such as operating system principles, process sleep/wake scheduling, etc. To write a good application and effectively solve the problems encountered by applications, everyone should understand these concepts.2) The development path for applications, in my opinion, is about mastering the business. For example, in the telecommunications industry, IPTV industry, and mobile phone industry, one should understand the industry demands well.3) Working on drivers cannot simply be called “doing drivers”; it can be referred to as “doing low-level systems”. If done well, this applies across industries. For instance, if someone has worked for several years on mobile phones, IPTV, and conference TVs, these products are indistinguishable for him because he only works on low-level systems. When applications encounter issues that cannot be resolved, he can provide insights and tools from a kernel perspective. The development direction for low-level systems should be as a technical expert. 4) In fact, there is no clear boundary between low-level and application development; having low-level experience makes transitioning to application development feel more secure. With business experience, understanding the low-level becomes easier, and a team can be formed quickly.

What does the embedded Linux low-level system include?

Embedded Linux consists of four main components: bootloader, kernel, driver programs, and root file system. 1. Bootloader It is a somewhat complex bare-metal program. However, understanding and writing this bare-metal program is not easy at all. The user-friendly tools on Windows have weakened our programming abilities. Many people start with embedded systems using ADS or KEIL. Can you answer the following questions? Q: Upon powering on, where does the CPU fetch instructions to execute?A: Generally from Flash memory.Q: But Flash is usually read-only and cannot be written directly; if global variables are used, where are these global variables stored?A: Global variables should be in memory. Q: So who places the global variables in memory?A: Friends who have been using ADS or KEIL for a long time, can you answer this? This requires “relocation”. In ADS or KEIL, the relocation code is written by the companies that produce these tools. Have you ever read it?Q: Memory is so large, how do I know where to read the “original content from Flash” into memory?A: This address is determined by the “linker script”; in ADS, there is a scatter file, and KEIL has a similar file. But have you studied it? Q: You said relocation is copying the program from Flash to memory; can this program read Flash?A: Yes, it can operate on Flash. Of course, there is more to it, such as setting the clock to make the system run faster, etc.Let’s stop here for self-questioning. For the bootloader, there are actually 3 key points: ① Hardware OperationsEmbedded Linux: Skills for Low-Level vs Application Development Hardware operations require looking at schematics and chip manuals. This requires certain hardware knowledge; you are not required to design hardware, but at least be able to read it; you do not need to understand analog circuits, but you should understand digital circuits. This ability can be learned in school; the two books, Microcomputer Principles and Digital Circuits, are sufficient.If you want to speed up the learning process, just skip this part; if you don’t understand, just GOOGLE or post. Additionally, you must read the chip manual; don’t look for the Chinese version, just read the English one. Initially, it is very painful, but later you will find that once you are familiar with the syntax and vocabulary, reading any chip manual becomes easy.② Understanding ARM Architecture Processors Understanding ARM architecture processors can be done by reading Du Chunlei’s , which covers assembly instructions, exception modes, MMU, and more. Only these three areas need to be understood. ③ Basic Concepts of Programs: Relocation, Stack, Code Segment, Data Segment, BSS Segment, etc. The basic concepts of programs; the ultimate source is to look at compiler principles. Unfortunately, such books are often extremely difficult to understand. Unless you are a super genius, it is better not to read them. You can refer to Wei Dongshan’s .For the bootloader, you can first read , then write programs to perform experiments on various hardware, such as GPIO, clocks, SDRAM, UART, NAND. Once you understand all of them, you can easily comprehend u-boot. To summarize, understanding hardware schematics and reading chip manuals requires you to find resources yourself.2. Kernel For those who want to learn quickly, skip the kernel learning and directly learn how to write drivers.To become an expert, you must deeply understand the kernel. Note that it is necessary to understand the scheduling mechanism, memory management mechanism, file management mechanism, etc. Recommended books: 1. Read , please refer to the thinner version.2. Selectively read ; read the relevant sections as needed.3. Drivers Drivers consist of two parts: hardware operations and the driver program framework. Again, hardware requires understanding schematics and reading chip manuals; practice is essential. ① Hardware Operations Regarding the driver framework, some books introduce it. LDD3, i.e., , written by foreigners, introduces many concepts and is worth reading. However, its role is limited to introducing concepts. Before getting started, you can use it to familiarize yourself with the concepts. ② Driver Program Framework A comprehensive introduction to drivers should be found in Song Baohua’s . To delve deeper into a specific area, is definitely a 5-star recommendation. Don’t expect to read it all; it has over 1800 pages across two volumes. When unclear about a specific section, refer to it. Any part can be discussed for 200-300 pages in great detail and is structured to guide you in analyzing the kernel source code. It takes Linux 2.4 as an example, but the principles are applicable to other Linux versions as well.Try writing a driver for all the hardware involved in your development board. If you encounter issues, start with “painful thinking”; during this process, many unrelated knowledge points will connect, ultimately leading to understanding.4. Root File System Have you ever thought about these two questions: Q: For products made with Linux, some are used for monitoring, some for phones, and some for tablets. After the kernel starts and mounts the root file system, which application should it start? A: The kernel does not know or care which user program to start. It only starts the init application, which corresponds to /sbin/init.Clearly, this application must read the configuration file to start the user program (monitoring, manual interface, tablet interface, etc. This question indicates that the contents of the file system have certain conventions, such as needing /sbin/init and a configuration file. Q: Have you considered who implements the printf function in your hello, world program? A: This function is not implemented by you; it is implemented by a library function. At runtime, it must find the library.This question suggests that the file system must also contain libraries. Simple self-questioning stops here; to delve deeper, you can look at busybox’s init.c to understand what the init process does. Of course, you can also refer to the chapter on building the root file system in .

Recommended Books for Learning Embedded Linux

1. Books on Hardware: Microcomputer Principles, Digital Circuits, textbooks from universities.2. Books on Linux:, the foreign-written When developing drivers, you will definitely need to use kernel-related components or need to cooperate with certain modules in the kernel, so you must understand how certain parts of the kernel are implemented, ultimately allowing you to grasp the overall framework of the Linux kernel well.These are all improvements that need to be summarized during your development process. If you do not summarize, you will always start over (or you will always be confused about why others’ code does what it does, then change it and get it to work), and that’s it; you will never improve. Eventually, you will have the feeling that you know nothing and understand nothing. One more point to clarify: many people engage in Linux development without using the Linux system as their working platform. In such cases, it is difficult to understand the implementation mechanisms of the Linux kernel and why certain methods are adopted for implementation. If you have never used a Linux system, it is impossible to implement a project that aligns with the operational mechanisms of Linux; even if your project succeeds, it will certainly not be optimal or compliant with the usage habits of Linux (including kernel extensions and application implementations). ~END~

Source: Technology Make Dreams Greater

Copyright Notice: Copyright belongs to the original author; if there is any infringement, please contact us for deletion!

To gain electronic hardware knowledge, click below to follow us

Embedded Linux: Skills for Low-Level vs Application Development✪ The Impact of High-Temperature Environments on Transistor PerformanceIn-depth: A master summarizes the essential knowledge points of embedded C language in 10,000 words…The strongest summary: 27 basic knowledge points of analog circuits!Expert! 5 I/O ports, set 25 buttonsWhy is the standard signal 4~20mAVoltage reverse connection protection circuitFourier Transform Explained in Another Way, Very Well Explained!✪ Why do electric tools generally use brushed motors, can’t brushless motors work?

Leave a Comment