Automated Build for Embedded Linux

1. Development Experience The BSP engineers from device manufacturers mainly focus on root filesystem/driver porting/system integration/hardware debugging. It is important to note the distinction from the driver engineers at chip manufacturers. After graduation, the opportunities to write drivers from scratch are few and far between; most of the time, drivers are provided by the chip manufacturers, which I adapt to my hardware products, spending most of my time on debugging and optimization. Chip manufacturers provide uboot/kernel/rootfs/toolchain development packages. Previously, Buildroot was popular in China, while Yocto was favored abroad. Recently, I have seen that the development packages from Unisoc and Chipone are both using Yocto.

Yocto https://www.yoctoproject.org
Buildroot https://buildroot.org

2. Yocto Tools Learning Yocto has a steep learning curve and slow compilation, but it has a rich ecosystem and clear hierarchy. Once familiar, it becomes very handy. I refer to the official documentation and various blogs, learning as needed. Below is the project hierarchy I commonly use.

~/xxx-wrokspace$ tree -L 1.├── meta-mylayer /* Custom meta layer */├── my-app /* Application partition */├── my-hs /* Non-upgradable partition */├── my-log /* Log partition */├── my-patch /* Custom scripts and configurations */├── my-service /* Basic service partition */└── yocto /* Chip manufacturer */

Automated Build for Embedded LinuxFigure 13. Buildroot Tools Buildroot is relatively simple, using Kconfig for configuration, and can usually meet the vast majority of embedded Linux build needs.Automated Build for Embedded LinuxFigure 24. Solution Selection Use whatever tools are provided by the original manufacturer or module supplier; sometimes, one can only resort to complex manual cross-compilation. Qualcomm/MediaTek/NXP typically use the Yocto solution, while Rockchip usually employs the Buildroot solution. The CX7101 from Chenxin and the MH5000-871 from Huawei provide a toolchain + busybox solution, making rootfs creation quite complex. Therefore, I adapted the CX7101 and MH5000-871 to Buildroot, leveraging Buildroot tools to cross-compile libraries and various toolkits, reducing manual cross-compilation and library dependencies, thus speeding up development. The core is the cx7101_defconfig and mh5000_871_defconfig configuration files.

/* CX7101 */~/cx7101-workspace$ git clone https://github.com/buildroot/buildroot.git -b 2020.02.x ~/cx7101-wrokspace$ tree -L 1.├── buildroot└── gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi
/* MH5000-871 */~/mh5000-871-workspace/buildroot$ make menuconfig/* Target options ---> */Target Architecture (ARM (little endian) ) ---> Target Binary Format (ELF) --->Target Architecture Variant (cortex-A73) --->Target ABI (EABIhf) --->Floating point strategy (NEON/VFPv4) --->ARM instruction set (ARM) --->
/* Toolchain ---> */    Toolchain type (External toolchain)  --->     *** Toolchain External Options ***     Toolchain (Linaro ARM 2018.05)  --->    Toolchain origin (Toolchain to be downloaded and installed)  --->[ ] Copy gdb server to the Target      *** Host GDB Options *** [ ] Build cross gdb for the host      *** Toolchain Generic Options ***[ ] Copy gconv libraries()  Extra toolchain libraries to be copied to target()  Target Optimizations()  Target linker options[ ] Register toolchain within Eclipse Buildroot plug-in

Leave a Comment