Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to develop embedded linux system applications

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces how to carry on the embedded linux system application development, the content is very detailed, the interested friends can refer to, hope to be helpful to everyone.

1 about embedded system

   usually we talk about embedded in a wide range, is a software and hardware can be tailored to the application-centric development of the special system, the hardware platform can be single-chip microcomputer, or to ARM series processors. Single-chip microcomputer generally runs naked programs directly, but now there are many systems based on single-chip microcomputer, and recently the popular open source system RT-Thread is doing well; most processors based on ARM architecture use linux as the software platform, and some devices use Android (the kernel is also linux).

2. Brief introduction of embedded linux system Application Development 2.1

The development of    embedded system includes three parts: kernel, driver and application. Today, we mainly talk about application development, but not the kernel and driver. The embedded linux system is the transplanted linux kernel, which uses the corresponding compiler to compile and download the linux kernel to the memory chip, and then needs to do a basic root file system, so that the system can run, which is relatively simple compared to the system on PC.

2.2 Application Development Environment

   now has a lot of video tutorials online, usually the first class will teach you how to build a development environment. Let me make a brief list here:

To install a virtual machine for the linux system, I used Ubuntu.

Then install the corresponding cross-compilation tools for the virtual machine.

Install common tools and configure: nfs, tftp, ftp, ssh service, samba service, vi necessary configuration.

To use nfs on the board, you also need to configure the linux kernel of the board with nfs-client and nfs file system support.

I like to transplant some useful tools on the board, such as ftp, ssh service (terminal login and file transfer), crontab, etc.

Virtual machine login: install the ssh service, and then log in through ssh with some terminal software, so that you don't have to use terminal on the desktop of the virtual machine.

Shared files: I like to share a directory with windows through samba, and map the shared directory to a network disk under windows, which is more convenient to use; I think this kind of sharing is very convenient, which is more convenient than using some shared software. After mounting to the network disk, it is the same as operating the local disk, which is more intuitive.

2.3 General development process

   in some video tutorials, the general introduction of the development process is as follows: edit the code under windows, cross-compile the code using a cross-compiler in the virtual machine, and then download it to the board through tftp/ftp, or run the test after mounting it on nfs; this is the case when getting started, but if you are doing actual product development in the company, it will be very inefficient.

   the following is my usual process:

Edit the code under windows or in a virtual machine. The code editor usually uses sourceInsight, VSCode, Eclipse, etc.

When writing the code, pay attention to add the compilation option where it interacts with the underlying hardware, so that the code accessed by the hardware is controlled by the compilation switch.

The second step of the work, in this step played a role, in Makefile, will be written according to different compilation options, choose a different compiler, if you are using the compiler in Ubuntu, then the hardware-related interaction shielding, so that the compiled program, can directly run on the Ubuntu, so that we can do code unit testing on the Ubuntu, logic verification of the program, running performance testing and so on. 80% of the problems can be solved in Ubuntu.

After testing in Ubuntu, cross-compile, share the directory through nfs, and run the debug on the board.

   actually reduces the process of downloading programs to the board, putting logic verification and code unit functional verification in Ubuntu to verify testing, and using GDB debugging in Ubuntu is also more convenient on the board.

2.4 debugging

The most commonly used and effective way of    is to print information and keep a journal! Can basically solve 80% of the problem. If a program dies abnormally (such as a segment error, etc.), the program usually does not have any hints and is not sure where it was hung up. This problem usually uses GDB tracking, or adds backtrace output code to the code.

3 concluding remarks

   embedded linux system application development, compared with the kernel, driver development, entry may be relatively easy, after all, the application layer development, there are not so many advanced things. The application layer is closely related to the specific business, so it leads to a large workload of application development and the risk of frequent changes in requirements, but there are a lot of skills in application development, which can greatly improve work efficiency. Linux applications can be developed using C++. Using the object-oriented idea of C++ and the new features and functions after C++ 11, it provides a lot of good functions similar to those in Java, which can greatly improve the efficiency of application development.

About how to carry on the embedded linux system application development to share here, hoped that the above content can have the certain help to everybody, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report