Description of Development (Compilation) Method
This project is developed based on the EASY EAI Nano - TB (RK RV1126B) development board. Purchase link:
EASY EAI-Nano-TB RV1126B Development Board
1. Cross-Compilation (Recommended)1.1 Advantages and DisadvantagesAdvantages:
- Compilation is performed using an x86 architecture CPU, resulting in fast compilation speed.
- Source code editing is convenient, with support for various IDEs such as VS Code and Qt Creator in the development environment.
Disadvantages:
- The compilation environment requires installation and deployment.
- Program debugging and running operations are relatively less straightforward compared to local compilation.
The EASY-EAI compilation environment is an online compilation environment (with the development board online) independently developed by Guangzhou Lingmou Technology. It establishes a real-time synchronous mapping relationship between the PC terminal and the board terminal, ensuring that when cross-compiling on the PC terminal, it can be linked in real-time with the dependent libraries of the development board.
1.2.1 Installation and deployment methodsCompared with the traditional cross-compilation environment where the compilation toolchain is decompressed and system environment variables are configured, the EASY-EAI compilation environment features more convenient deployment and shields various compatibility issues. Detailed installation steps are provided in the article在《Getting Started Guide / Development Environment Preparation / Preparation and Update of Easy-Eai Compilation Environment》
1.2.2 Mounting the Embedded Device (Development Board)First, enter the EASY-EAI compilation environment through the run.sh script:
Then, check the device's IP address via the serial port:
For specific operations of serial port debugging, refer to 《Getting Started Guide / Introduction to Development Board Debugging Methods / Serial Port Debugging》。
Return to the EASY-EAI compilation environment and try to ping the development board:
If the ping is successful, select an IP address (either eth0 or wlan0) and mount the root directory of the development board's rootfs to /mnt in the EASY-EAI compilation environment using the mount command as follows:
sudo mount -t nfs -o nolock 192.168.3.121:/ /mntThus, any edits made to files in the /mnt directory of the EASY-EAI compilation environment will be automatically synchronized to the root directory of the development board's rootfs.
sudo load_rootfs 192.168.3.119In addition, if you find typing the mount command cumbersome, you can use the pre-prepared mounting script load_rootfs:
【Baidu Netdisk】
Link: https://pan.baidu.com/s/13rdifPHyZwHFIvbvBC78jw?pwd=1234
Extraction code: 1234【Baidu Netdisk】Link: https://pan.baidu.com/s/13rdifPHyZwHFIvbvBC78jw?pwd=1234
Here are compilation examples of four regular compilation methods:
Each example includes a build.sh script and a source code file, as shown below.
We can enter any example, execute the ./build.sh operation, and a hello file will be generated.
Then, simply copy the generated file to any subdirectory of /mnt in the EASY-EAI compilation environment.
After accessing the board via serial port debugging, navigate to the location where the hello file was copied, as shown below:
cd /userdata/Execute the ls command to check the directory, and you will find that the hello file has been synchronized:
lsRun the hello file directly to see the result:
./helloAs indicated by the mapping relationship, the /mnt directory in the EASY-EAI compilation environment is the root directory of the development board. Since the dependent libraries of the cross-compilation tool are located on the development board, it is only necessary to specify the sysroot for the compiler as /mnt.
GCC/G++:
aarch64-linux-gnu-gcc --sysroot=/mnt hello_world.c -o hello
aarch64-linux-gnu-g++ --sysroot=/mnt hello_world.cpp -o helloCMAKE:Include the following file in the CMakeList.txt file.
include ($ENV{HOME}/configs/cross.cmake)QMAKE:The qmake tool is directly installed on the development board, so you can execute qmake directly in the EASY-EAI compilation environment. An example command is as follows:
/mnt/usr/bin/qmake xxxxxx.pro
make2. Local Compilation2.1 Advantages and DisadvantagesAdvantages:
- The development board can be used directly as a small computer, eliminating the need for cumbersome application deployment.
Disadvantages:
- Compilation is performed using the RV1126B CPU, which has relatively weak performance and slow compilation speed.
- Source code editing is difficult, with only the native vi editor available, and no support for various IDEs.
You can access the background of the development board using three methods: adb, debugging serial port, and ssh, then directly use the development board as a computer installed with the Ubuntu system.










Comments