
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.

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.

(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.

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

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

(5) The LICENSE remains unchanged.
(6) Modify the Makefile, changing the highlighted parts in red to the name of the application you added.

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

1.3 Add Application in Root Filesystem Based on JSON Configuration
(1) Check the Yocto distro.

(2) Modify the Yocto root filesystem configuration file to add the printf-test program.
yocto/meta-semidrive/conf/distro/minimal-rootfs.conf

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.

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.

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!

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

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!