Adding Linux Applications in Yocto for Xinxing X9HP PTG4.1

Adding Linux Applications in Yocto for Xinxing X9HP PTG4.1

Click the blue text to follow us

1. Reference Example and Add Application

1.1 Reference Example

(1) Check the built-in serial port test example uart_test and see how the bb file is written.

Adding Linux Applications in Yocto for Xinxing X9HP PTG4.1

1.2 Add printf-test Application

(1) In the yocto/meta-semidrive/recipes-bsp/ directory, copy the built-in example uart-test and rename it to printf-test.

Adding Linux Applications in Yocto for Xinxing X9HP PTG4.1

(2) The printf-test/ directory contains the source code and compilation files of the application you added. The .bb file is the configuration file for Yocto, and both the directory name and the .bb file name should be changed to the name of the added application.

Adding Linux Applications in Yocto for Xinxing X9HP PTG4.1

(3) Open printf-test.bb and change the parts highlighted in red to the name of the application you added.

Adding Linux Applications in Yocto for Xinxing X9HP PTG4.1

(4) Check the contents of the printf-test/ directory.

Adding Linux Applications in Yocto for Xinxing X9HP PTG4.1

(5) The LICENSE remains unchanged.

(6) Modify the Makefile, changing the highlighted parts in red to the name of the application you added.

Adding Linux Applications in Yocto for Xinxing X9HP PTG4.1

(7) Modify printf-test.cpp, this program is a serial port test application.

Adding Linux Applications in Yocto for Xinxing X9HP PTG4.1

1.3 Add Application in Root Filesystem Based on JSON Configuration

(1) Check the Yocto distro.

Adding Linux Applications in Yocto for Xinxing X9HP PTG4.1

(2) Modify the Yocto root filesystem configuration file to add the printf-test program.

yocto/meta-semidrive/conf/distro/minimal-rootfs.conf

Adding Linux Applications in Yocto for Xinxing X9HP PTG4.1

2. Compilation

2.1 make linux error

Due to incorrect formatting, there needs to be a space before the first application libdrm, otherwise there will be no separation between the parameters elsewhere, resulting in the following error for netkit-telnetlibdrm, which should actually be netkit-telnet and libdrm two applications.

Adding Linux Applications in Yocto for Xinxing X9HP PTG4.1

2.2 make linux compilation

2.3 make genpac packaging

3. Flash Verification

As shown below, after logging into Linux as root, you can directly run the added printf-test application.

Adding Linux Applications in Yocto for Xinxing X9HP PTG4.1

4. References

[1]《SD_X9_PTG4.1_release_notes》

[2]《X9_SDK_User_Manual_Rev1.7》

I am here for a fleeting moment, feel free to follow me on Dada Tong!

Adding Linux Applications in Yocto for Xinxing X9HP PTG4.1

Related Blogs on Xinxing X9:

《Compiling Device Tree Files dts and Reverse Compiling dtb Files Based on Xinxing X9HP》

《Using tinyplay Command to Debug Audio Interface on Xinxing X9HP Demo Board》

Feel free to leave comments below the blog, we will respond to your questions promptly. For more inquiries, please contact the ATU department of WPI Group: [email protected]

Author: Stark Liu / Liu Pei

Adding Linux Applications in Yocto for Xinxing X9HP PTG4.1

Click Read the Original Text to learn more details, unlock 1500+ complete application solutions, and have over 700+ FAE from WPI Group answer your questions online!

Leave a Comment