
A friend on Zhihu asked: After 6 years in microcontrollers, how to transition to embedded Linux?
It’s quite awkward now; the microcontroller products I work on always feel repetitive, and I want to learn something new but don’t know how to transition.
Today, I will use this question to reflect on my own journey from MCU to Linux.
During this time, I experienced the joy of technical breakthroughs, as well as the frustration and confusion when facing technical difficulties, even to the point of wanting to give up.
Looking back today, it was my persistence in technology that supported me step by step.
I hope my experiences and suggestions can help the questioner and others who are interested in embedded technology.
I started working with the 51 microcontroller during my undergraduate studies and also underwent the trials of electronic competitions.
During my master’s program, I used the MSP430 to create embedded products combining academia and industry, and I also conducted small-scale practical applications.
Although I had some exposure to Linux embedded development during my master’s, looking back, PLC + configuration and MSP430 MCU were indeed my strengths (the FPGA + Verilog project I worked on for graduation was not impressive; I was naive enough to interview for FPGA positions, and the results were predictable).
After joining Huawei, although I worked with Linux and VxWorks operating systems, I still dealt mostly with MCUs and application programming in the Linux user space. Anyone who has experience in larger companies knows that a screw is just a screw; you can only see the trees and not the forest. However, during my years at Huawei, my coding abilities significantly improved.
When I left Huawei, my thoughts were somewhat similar to the questioner’s: every day was spent facing basically the same chips, working on the modules I was most familiar with, and there was a serious phenomenon of reinventing the wheel. I wanted to learn new skill stacks but had no time or energy.
Finally, I received an offer for Linux embedded development from a communication chip supplier, thinking I had some foundation in Linux embedded development, I eagerly jumped into this communication protocol stack development at a Fortune 500 chip giant.
Ideals are beautiful, but reality is harsh. It can be said that embedded Linux and MCU development have similarities and connections, but the differences are also significant. However, for me, there was no turning back, and I recognized the advantages of Linux in terms of technical barriers. What to do? I could only muster the determination I had when I first joined Huawei and tackled C language head-on.
Back then, there was no knowledge-sharing platform like Zhihu, so I consulted old employees of the new company and classmates from my graduating class who were doing Linux embedded development for their experiences and learning paths. After receiving their enthusiastic replies and guidance, I began another round of intense learning in Linux embedded technology.
Embedded Linux development can be broadly categorized into BSP and application development.
To meet the challenges of my new job, I first chose to review and advance my skills in embedded Linux application development. Later, when I left this company to start my own business, I also had to learn embedded Linux BSP due to cost issues, but let’s first discuss applications.
1. Shell, VIM, and Makefile
Many friends might ask, are these two tools necessary to learn? My advice is, absolutely necessary. If you don’t understand the basics of shell, how can you manipulate the Linux file system?
If you don’t use VIM well, although Windows folders can be mapped to Linux systems, character encoding issues under Windows often cause inexplicable problems in Linux. Shouldn’t you learn about text editing in VIM?
As for Makefile, friends working with MCU and DSP might be less familiar with it. Because for MCU and DSP, the accompanying coding download software handles Makefile for you, and you just need to configure it in the UI to automatically generate the compilation file chain. For example, in Keil, you just tell Keil where the compilation files are and what the macro definitions are. However, when I compiled Linux back then, I had to manually tell the embedded compiler in the Makefile what files to compile and what files to generate, etc.:
Additionally: Learning to set up a cross-compilation environment is also a necessary skill for embedded Linux developers. This is not technically difficult; understanding the general principles can be done in half an hour.
2. Common Linux APIs
Since the questioner is transitioning from MCU just like I did back then, there should be no problem with C language. If the questioner has experience with RTOS, understanding Linux will also be much faster.
Even if there is no RTOS experience, that’s okay. Starting from scratch may actually reduce the influence of previous knowledge and understanding.
In fact, the common Linux application coding mainly involves just a few libraries and APIs: multithreading, multiprocessing, blocking and non-blocking, and various synchronization mechanisms: read-write locks, spin locks, etc., as well as inter-thread communication mechanisms and socket networking, among others that you might encounter in your work.
3. Debugging Techniques
After patiently reviewing the knowledge from the first two stages and practicing coding in my work and virtual machine environment, I could basically grasp the essentials of embedded Linux through a project-based approach.
However, every program will always have bugs. In the past, MCU IDEs could help us with debugging information and breakpoint debugging. In Linux, we can only rely on the powerful tool GDB to help us find traces of bugs in the Linux world.
Actually, Linux BSP is also another major aspect of embedded Linux development. During my later entrepreneurial endeavors, I also mastered basic Linux BSP skills through intense study. The process and path are a bit lengthy for today’s discussion. If friends are interested or need it, I can continue writing about how to expand from Linux application development to Linux BSP development skills.
The above only represents my personal experiences and opinions, for reference only.
Free Hardware, High Salary Training Camp




1
《IoT Development Average Monthly Salary 20K, How to Get Started Quickly? (Includes Benefits)》
2
《Embedded Development, Do You Need to Learn Both RTOS and Linux?》
3
《Embedded Development, Do You Need to Learn Both RTOS and Linux?》



