Which Operating System Should You Learn First for Embedded Development?

Many beginners focus on Linux and VxWorks, thinking that “the more complex the system, the more powerful it is,” which is completely the opposite. Embedded devices are different from our computers; some devices have only a few KB of memory (like smart door locks), while others need to run dozens of tasks simultaneously (like automotive central control). The choice of OS essentially depends on the device’s “appetite” for resources. Let me illustrate a simple “hierarchy of embedded OS” (actually an adaptation chain): from simple to complex, it goes like this: bare-metal programming (no OS) → lightweight RTOS (like FreeRTOS, RT-Thread) → embedded Linux → industrial-grade real-time OS (like VxWorks, QNX). It’s not that the ones above are better than those below; rather, the lower ones are suitable for “small devices with simple requirements,” while the upper ones are suitable for “large devices with complex functions.” For example, if you are making a smart desk lamp, bare-metal programming is sufficient; there’s no need to use Linux. However, if you are creating a smart speaker with a screen and internet connectivity, you really can’t do without Linux. So before you start learning, ask yourself two questions: First, what type of device do you want to create? Is it a small and simple appliance or sensor, or a large and complex automotive or industrial device? Second, what is your current foundation? Have you just finished learning the 51 microcontroller, or can you already write C language drivers? Once you clarify these two points, choosing an OS will be much easier. Many people think that “learning an OS means you don’t need to learn bare-metal programming,” which is a major misconception. Bare-metal programming means “operating hardware directly without an operating system,” such as writing a simple LED blink or button interrupt in C. It may seem simple, but it is crucial for understanding “how hardware and code interact.” Possible projects include: smart door locks, temperature and humidity sensors, LED displays, and simple industrial control buttons. These devices have single functions and do not need to run multiple tasks simultaneously, so bare-metal programming is completely sufficient. For instance, when I first started, I wrote a smart flower pot using STM32 bare-metal programming, which could detect soil moisture and water automatically, with only a few hundred lines of code, and it ran very stably without an OS. Pitfall guide: Don’t underestimate bare-metal programming just because you think it’s “low-level.” I’ve seen many beginners skip bare-metal programming and jump straight to FreeRTOS, only to find they can’t even understand how to configure timer interrupts, ending up with a half-baked understanding of both the OS and hardware. It’s best to spend 1-2 months learning bare-metal programming, getting familiar with STM32’s GPIO, interrupts, timers, and SPI peripherals, before moving on to an OS, which will make the process much easier. If you want to create “somewhat more complex devices” (like those that need to display, collect data, and connect to the internet), and you don’t want to dive straight into Linux, then a lightweight RTOS (real-time operating system) is the best choice. The most commonly used ones are FreeRTOS and RT-Thread; both are quite similar, with FreeRTOS being more widely used abroad and RT-Thread being a domestic option with more comprehensive documentation, making it friendlier for beginners. Target audience: Those with a bare-metal foundation (who can work with STM32 peripherals) and want to engage in IoT, industrial control, or consumer electronics. This is also the field with the highest demand for embedded positions currently. Possible projects include: smart wristbands (simultaneously running heart rate detection, screen display, and Bluetooth transmission), industrial sensors (simultaneously collecting temperature and pressure data and uploading it via RS-485), and smart home central control (simultaneously controlling lights, curtains, and air conditioning). A couple of years ago, I helped a friend create an agricultural greenhouse controller using RT-Thread, which ran six tasks simultaneously and was very stable; we ended up selling nearly a hundred units. Pitfall guide: Don’t get too caught up in the “source code”! Many beginners insist on understanding every line of code in FreeRTOS, such as the task scheduling algorithm and queue implementation principles, and as a result, they spend three months without being able to start a project. When job hunting, they can’t even explain “how to create a task or use a semaphore.” In fact, companies care more about whether you can “use RTOS to solve practical problems,” such as “how to use queues for data transfer between tasks” and “how to use mutexes to avoid resource conflicts.” These practical skills are much more important than delving into the source code. I recommend that when learning RTOS, you first follow a tutorial to complete 1-2 full projects, like “a smart wristband based on FreeRTOS,” and then revisit the source code for better understanding. Embedded Linux is definitely a “high-paying ticket to entry.” High-end positions in automotive electronics, smart devices, and industrial control almost all require knowledge of Linux. However, it is also the most challenging, as you need to understand both software (Linux kernel, drivers, application development) and hardware (at least be able to read schematics and understand ARM architecture), making the barrier to entry significantly higher than that of RTOS.

Target audience: Those with an RTOS foundation who want to work in automotive electronics (like in-vehicle central control, ADAS), high-end industrial equipment (like robots, CNC machines), or smart hardware (like robotic vacuum cleaners, smart cameras). Salaries in these fields are 30%-50% higher than those for regular RTOS positions, but the requirements are also higher. Possible projects include: in-vehicle infotainment systems (IVI), smart cameras (with facial recognition and video storage), and industrial robot controllers (with motion control and Ethernet communication). Currently, I am working on a battery management system (BMS) for electric vehicles, which is developed based on embedded Linux, requiring adaptation to the CAN bus, battery data collection, and cloud communication, with a much broader technology stack than RTOS. Pitfall guide: Don’t start by “compiling the Linux kernel”! Many beginners follow tutorials that say, “To learn Linux, first compile the kernel,” and end up spending a week downloading source code and configuring compilation options. They finally compile the kernel but have no idea how to use it, which completely destroys their confidence. The correct approach should be: first learn “embedded Linux application development” (like writing a serial communication program in C or creating a GUI with Qt), then learn “driver development” (like writing an LED driver or SPI driver), and finally tackle “kernel trimming and optimization.” Additionally, learning Linux requires hardware support; don’t mess around with a virtual machine. Buy a Raspberry Pi or IMX6ULL development board and work on projects like “a Linux-based smart camera”; this is ten times more effective than just reading books. VxWorks and QNX are the “nobility” of embedded OS, mainly used in aerospace, military, and high-end industrial equipment. For example, the avionics systems of airplanes, control systems of high-speed trains, and monitoring devices of medical equipment are characterized by “extremely strong real-time performance and high stability,” but there are few learning materials and expensive development tools, making opportunities for ordinary people to get in touch with them quite rare. Target audience: Those who want to enter aerospace, military, or medical device companies, or engineers already working in these industries who need to upgrade their skills. Possible projects include: avionics systems for aircraft, signal controllers for high-speed trains, and control units for medical MRI devices. These projects are rarely accessible to ordinary people, as they are mostly confidential projects within companies. Pitfall guide: Don’t learn blindly! I’ve seen many beginners think, “VxWorks is great; learning it will help me find a job,” and they end up spending six months looking for materials and learning development, only to find that there are very few companies hiring VxWorks engineers, and they all require three years of experience, leaving no entry opportunities. Unless you are explicitly aiming for these special industries, I recommend first mastering Linux, and then learning VxWorks when the need arises in your job; otherwise, it’s just a waste of time. Finally, let me summarize a “learning path for embedded OS.” Whether you are a beginner or looking to switch careers, following this path will help you build a solid foundation and quickly meet job demands: Step 1: Start with bare-metal programming (1-2 months) using an STM32 development board to familiarize yourself with GPIO, interrupts, timers, UART, SPI, and I2C peripherals, and be able to independently complete a “bare-metal project,” such as “temperature and humidity collection + OLED display.” The goal is not to write overly complex code but to understand “how hardware works” and “how code controls hardware,” which is the foundation for all OS. Step 2: Learn lightweight RTOS (2-3 months) by choosing FreeRTOS or RT-Thread (RT-Thread is recommended for beginners due to its comprehensive documentation), focusing on “task creation and management,” “using queues, semaphores, and mutexes,” and “interrupt and task cooperation,” then complete an “RTOS project,” such as “a smart wristband based on RT-Thread (heart rate detection + Bluetooth transmission).” The goal of this step is to “be able to use the OS to solve multi-tasking problems,” which can meet 80% of the demands for consumer electronics and IoT positions. Step 3: Learn embedded Linux (3-6 months, adjust based on goals) If you want to pursue high-end positions, continue learning Linux: first learn application development (C language, shell scripts, Qt interface), then driver development (character device drivers, platform device drivers), and finally kernel optimization (kernel trimming, root filesystem creation). Complete a “Linux project,” such as “a Linux-based smart camera (video capture + facial recognition + cloud upload).” With this project experience, you can apply for positions in automotive electronics and industrial control.

Leave a Comment