Embedded Linux Development: Common Techniques and Tips
I am Lao Wen, an embedded engineer who loves learning.Follow me, let’s become better together!There are techniques everywhere in life, and embedded Linux development is no exception. If beginners understand these commonly used techniques in development, it can help you avoid many detours. These techniques are not limited to a specific development board platform but can be applied to other development boards as well.In the previous article, we unboxed the ELF 1S embedded Linux development board, which comes from Feiling’s new sub-brand ElfBoard aimed at beginners. You can click the link below for the content of the previous article.If you want to learn embedded systems, instead of just sitting back and watching, it’s better to take action and practice!In this article, we will list some commonly used development techniques and tricks in embedded Linux application development based on the ELF 1S development board.1- What should you do first when you receive the development board?First, appreciate the packaging appearance, then open the box carefully, take it out, admire the aesthetics of the development board, and you can even take a closer sniff of the rosin and washing water smell from the circuit board.If the development board has a screen, check if the screen is damaged. If it is, contact the manufacturer immediately for assistance.Fully utilize your research skills and visit ElfBoard’s official website. Regardless of everything, download all the documentation to your computer, and bookmark the following URL, as the instructional videos are available online.https://www.elfboard.com/information/detail.html?id=1(Copy to your browser to open, or click [Read More])2- How to power on and test the development board?Refer to the document “01-0 ELF 1, ELF 1S Development Board_Quick Start Manual_V1.pdf”. Generally, many entry-level development boards come with a “Quick Start Manual” or similar documents to help beginners quickly power on the development board.At least through this manual, you can know what hardware resources the development board has and how to power it on to make it run.
3- I currently have no hardware background. Can I learn embedded Linux development?Embedded development requires knowledge of hardware circuits; you must learn hardware. However, the order of learning embedded software and hardware can be flexible. Moreover, the ELF 1S development board provides a series of hardware learning documents and videos.If you are a complete beginner and have a strong interest in embedded technology, it is recommended to start with embedded Linux application development, as it is less likely to discourage you.Embedded Linux application development, including embedded Qt application development, can refer to the following two documents:“01-1 ELF 1, ELF 1S Development Board_Software Tutorial_V1.pdf” Chapters 1 to 4.“01-3 ELF 1, ELF 1S Development Board_Qt Application Tutorial_V1.pdf” Entire document.4- How should I start learning embedded Linux application development?To learn embedded Linux application programming, you must first understand what the “Linux operating system” is. There are already a plethora of conceptual introductions online.You should first learn to use a desktop Linux system, such as Ubuntu, because the applications on the development board are generally developed on desktop Linux systems and then cross-compiled and transferred to the development board for execution.C language programming is essential, and having a basic understanding of shell programming is also advisable. These two languages are crucial knowledge points in embedded development. If you do not have a foundation in these two languages, it is recommended not to touch the development board yet; first look for relevant courses online to build your foundation in these two languages.Without a solid foundation, you will face great difficulties!After learning programming languages, the next step is to set up the development environment. Simply put, setting up the development environment is about installing various software on your Windows or Ubuntu system so that your computer can connect to the development board and transfer files between them. I believe installing various software will not be a challenge for you all.Embedded Linux application development essentially involves writing programs on your desktop PC, cross-compiling them, and then transferring the programs to the development board for execution. Some development boards may not have the performance to support writing and compiling code directly on them, while some high-performance development boards can be programmed and run directly without the need for cross-compilation.Remember: An embedded Linux development board is essentially also a computer, it is also a computer, it is also a computer.5- Many learners have been discouraged by setting up the development environment. Is it really that difficult?There are two ways to obtain the development environment for embedded Linux development boards: 1- Tinker with it yourself according to tutorials and online materials. 2- Use the development environment set up by the manufacturer directly.It is recommended that beginners without embedded knowledge use the development environment set up by the manufacturer first, as this will not easily discourage you. Once you have mastered certain skills later on, you can try building the development environment yourself. Setting up the development environment involves installing Ubuntu and software on Ubuntu.To use the manufacturer’s setup development environment, refer to Chapter 2, Section 2.1.3 of “01-1 ELF 1, ELF 1S Development Board_Software Tutorial_V1.pdf”, as shown in the image below.
6- What software should I use to write embedded Linux application code?There are many software options for writing code. If you just need to make simple code changes, Notepad will suffice. Beginners often use VSCode, and QtCreator is also a great editor. When starting out, it is not advisable to overly rely on the Vim editor; it is just a tool, and Vim is a bit complex for beginners.Don’t be too obsessed with code editing tools; use what you are comfortable with and what you find most efficient. If you haven’t used any editor before, I recommend using VSCode; this tool is quite nice.
7- After writing the code, how do I convert it into a program that can run on the development board?Cross-compilation! As mentioned earlier, if you write and compile code directly on the development board, it is called direct compilation. If you write code and compile it on a desktop PC and then run it on the development board, it is called cross-compilation.You can refer to Chapter 2, Section 2.6.3 of “01-1 ELF 1, ELF 1S Development Board_Software Tutorial_V1.pdf”, as shown in the image below.
8- How to transfer files between the desktop PC and the development board?Generally, there are two ways: 1- Transfer files using a TF card or USB drive, just like copying files between two computers. 2- Connect the computer to the development board via Ethernet, transferring files using FTP protocol or NFS network file system.I personally prefer transferring files over the network between the computer and the development board. The FTP method is introduced in the “Appendix” of the Quick Start Manual, as shown in the image below.
NFS network file system is also a commonly used method; there are many resources online for you to search and learn, especially when you need to frequently modify the file system configuration. Mounting the file system via NFS can be very efficient.TF cards are generally used for firmware burning during mass production. Personally, I feel that copying applications to the development board via TF card and then running them is a bit cumbersome.9- If the development board’s system gets corrupted, how can I restore it to factory settings?Development board manufacturers generally provide factory images. During our development process, if we accidentally corrupt the original system, we can follow the manufacturer’s method to restore it to factory settings, usually using specific burning tools and a TF card.The Quick Start Manual’s Chapter 4 discusses how to restore the development board to factory settings, as shown in the image below.
10- I want to further study more complex embedded Linux system porting and driver development. How should I start?Refer to documents and videos. Chapters 5 to 9 of “01-1 ELF 1, ELF 1S Development Board_Software Tutorial_V1.pdf” provide basic knowledge points on Linux kernel porting, driver development, u-boot introduction, and file system porting, as shown in the image below.
This content is sufficient for beginners to start learning, but if you wish to delve deeper, you must engage in positions related to embedded Linux driver development, which have the highest technical value in chip manufacturers. To advance, continuous learning in work is necessary.11. What is the essence of embedded technology? What is embedded development?12. In which industries can embedded technology be used, and what are the average salaries in these industries?13. How should I learn embedded systems? What is the learning path?14. With so much information and so many development boards online, how should I choose?15. What basics are required for embedded systems? Should I learn hardware? What programming languages should I learn?16. Should I choose a microcontroller or embedded Linux? What are the differences?17. …For all these questions, some you may have already answered, while others may still be confusing. However, as a ten-year embedded novice, my advice is: there are no shortcuts in the field of embedded technology. The learning cost is not as simple as pure software, which can be accomplished with just a computer or a phone. At least, investment in hardware development boards and modules is necessary.If conditions permit, it is also recommended to purchase some high-quality online courses, which will greatly enhance your learning of embedded technology.We will continue to explore the above questions in future articles.Thank you for reading, and feel free to follow!