In the previous article, we introduced the application scenarios, hardware, and software usage methods of the Aili Light Raspberry Pi 5 GMSL camera access kit。(Refer to→Guide to Using Aili Light Technology’s Raspberry Pi 5 GMSL Camera Access Kit (Part 1))
To ensure the GMSL camera is compatible with the Raspberry Pi development board software, enabling efficient and stable image transmission and processing, this article will supplement the software compilation guide for the Aili Light GMSL camera access kit.
The compilation will be divided into two main modules: first, the compilation of the .ko files on the board; second, the comprehensive setup of the kernel development environment, involving the compilation of kernel, dtb (device tree binary files), dtbo (device tree overlay files), and modules (kernel modules).
1
、on board compilation of ko files
When compiling ko files on the board, simply copy the files from the max9296\src\driver\* directory in the Git repository to any location on the board. Then execute the compilation command; if successful, the corresponding .ko file will be generated in the same directory.
*The driver source code is not open source at this time; if needed, please contact Aili Light Technology for support.
Next, move these .ko files to the /lib/modules/{kernel version}/ directory. Additionally, for version control and sharing, it is recommended to also save these .ko files in the Git repository under max9296\bin\{kernel version}\ko\.
{kernel version} can be obtained using the following command:
$ uname -r6.6.31+rpt-rpi-2712
Then execute and analyze the driver dependencies:
sudo depmod
Finally, enter the following command:
sudo modprobe max9296
When the driver loads successfully, the dmesg command will output the corresponding log information. If no error reports appear in the log content, it indicates that the driver has loaded successfully.

Example Reference
2
、Building a Complete Kernel Development Environment
To build a complete kernel development environment, you can refer to the following steps:
1. Official kernel compilation can refer to:
https://www.raspberrypi.com/documentation/computers/linux_kernel.html#cross-compile-the-kernel
2. The Git repository address for obtaining the complete kernel code is: https://github.com/raspberrypi/linux
3. In Linux, you can use the following command to get the complete code:
git clone --depth=1 https://github.com/raspberrypi/linux
4. Install patches for the kernel driver to ensure compatibility and performance. Please contact Aili Light Technology for patch support.
5. In the same directory as the cloned code, create a folder named modules to store the kernel module code that may be needed later.
mkdir modules
6. Copy the Docker image file (e.g., aili_rpi_compile_v1_1.tar*) to any location on the development machine and use the following command to import the image:
sudo docker load -i aili_rpi_compile_v1_1.tar
*Given the variability of development platforms, to avoid the time cost of frequently switching development environments, we have built a dedicated cross-compilation Docker image for the Raspberry Pi 5. Using this image can quickly set up a kernel development environment for the Raspberry Pi 5, thus improving development efficiency. If needed, you can contact Aili Light Technology for the download path of the Docker image.
7. After importing, you can use the following command to view the image list and confirm that the image has been successfully imported:
sudo docker images

8. Use the following command to start the Docker container and mount the local kernel code directory (e.g., /home/xxxx/rasp5/linux, please replace according to your actual situation) to the /home/linux directory inside the container:
sudo docker run -itd -v /home/xxxx/rasp5/linux:/home/linux --name=pi aili_rpi_compile:1.1
9. Use the following command to view all Docker containers (including stopped ones) to confirm that the container has started successfully:
sudo docker ps -a
If the following results appear, it proves that Docker is running successfully.

10. Enter the Docker container to prepare for kernel compilation:
sudo docker exec -it pi bash
11. Inside the container, execute the following commands to compile the kernel:
cd linuxKERNEL=kernel_2712make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- raspi5_defconfigmake ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image modules dtbs -j 12env PATH=$PATH make -j12 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- INSTALL_MOD_PATH=./modules/ modules_install
After compilation, the corresponding kernel image (image), device tree binary files (dtb, dtbo), and module driver files (modules) will be generated in the respective directories within the container, as follows:
#Kernel imagearch/arm64/boot/Image#dtbarch/arm64/boot/dts/broadcom/*.dtb#overlaysarch/arm64/boot/dts/overlays/*.dtb*arch/arm64/boot/dts/overlays/README#modulesmodules
Finally, copy the generated files from the container to the corresponding path of the board-level device.
After completing the above steps, you will obtain a customized kernel image, device tree files, and kernel modules. Please transfer these key components to the storage device of the Raspberry Pi 5 (such as an SD card) and start the device to verify the kernel loading and operation. During verification, pay attention to the startup logs and operating status to ensure there are no abnormalities.
At the same time, kernel compilation is complex and time-consuming, so it is recommended to carefully check the code and configuration before compiling. If you encounter any issues during the compilation or deployment process, please feel free to contact Aili Light Technology for support.
About Aili Light Technology
Aili Light Technology Co., Ltd. in Shenzhen is a technology enterprise that provides professional imaging vision products and solutions for automotive autonomous driving, industrial automation, and other fields.
Relying on the founding team’s years of development experience and self-developed core technology capabilities, Aili Light Technology has developed three major product series: onboard vision sensors, image data acquisition systems, and simulation hardware closed-loop testing systems, providing complete high-level autonomous driving testing data closed-loop solutions and services, meeting the full process needs of research and testing in the autonomous driving field.
Adhering to the development philosophy centered on technological innovation and fundamental product quality, Aili Light Technology continues to increase investment in research and development and technological innovation exploration, dedicated to providing customers with higher quality products and services.
Contact Us
Phone:0755-27218150
Email:[email protected]
Website:www.aili-light.com
Address:605 Huafeng Technology Business Building, Area 82, Haiyu Community, Xinan Street, Bao’an District, Shenzhen
More related to autonomous driving
Click to follow
「Aili Light Technology」
↓ ↓ ↓

Aili Light Technology creates a Raspberry Pi 5 GMSL camera access kit

Aili Light launches a GMSL camera access kit compatible with Jetson Orin