DEBIX Compile ISP Camera

2024.3.25by debix.io

Compile ISP Camera, please review the NXP's 8MP ISP New Camera Porting for more information.


1. Download the latest yocto image from the software download page of DEBIX website, and flash it into the DEBIX single board.

2. Download isp-imx

Note: The version of isp-imx corresponds to the version of yocto, such as isp-imx-4.2.2.18.0 corresponds to imx-5.15.32, and isp-imx-4.2.2.20.0 corresponds to imx-5.15.71. This document uses isp-imx-4.2.2.20, and yocto 5.15.71.

wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/isp-imx-4.2.2.20.0.bin

Add isp-imx permissions with chmo

chmod 755 isp-imx-4.2.2.20.0.bin

. /isp-imx-4.2.2.20.0.bin

3. Compile isp-imx-4.2.2.20 with yocto

cd isp-imx-4.2.2.20.0

sudo . /build-all-isp.sh release partial V4L2

Note: If there is an error in the compilation process, it may be the lack of environment; for example, connecting the library path error, or can not find the header file, etc., you can follow the prompts to install them, you can also choose to compile the package with the matching yocto environment, if you select the environment corresponding to yocto, it will be a normal compilation.

4. Compile isp-vvcam with ubuntu22.04

·Download isp-vvcam from NXP's github

git clone --depth=1 --branch lf-5.15.y_1.0.0 https://github.com/nxp-imx/isp-vvcam.git

cd isp-vvcan

·Install the cross-compiler

sudo mkdir /opt/toolchain

cd /opt/toolchaintar -xpf gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz

sudo wget https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64- aarch64-none-linux-gnu.tar.xz

tar -xpf gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz

·Add environment variables


Note: Environment variables must be set correctly, otherwise it will report an error. The compilation environment here is ubuntu22.04 system.

Point to the folder for the gcc cross-compilation toolchain:

export CROSS_COMPILE=~/path/to/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-

Specify the type of machine, here an arm64-bit machine, which corresponding to debix:

export ARCH=arm64

Specify the kernel source directory:

export KERNEL_SOURCE_DIR=~/path/to/linux-Model_AB-L5.15.71

·Run the compilation script

. /build-all-vvcam.sh

5. Summary of compiled files by yocto to ubuntu22.04

cd /opt/imx8-isp/bin

scp debix@192.168.x.xxx:~/path/isp-imx-4.2.2.20.0/appshell/build/generated/release/lib/*.so* ./  

scp debix@192.168.x.xxx:~/path/isp-imx-4.2.2.20.0/appshell/build/generated/release/bin/os08a20.* ./

scp debix@192.168.x.xxx:~/path/isp-imx-4.2.2.20.0/appshell/build/generated/release/bin/OS08a20* ./

scp debix@192.168.x.xxx:~/path/isp-imx-4.2.2.20.0/appshell/build/generated/release/bin/isp_ media_server ./

scp debix@192.168.x.xxx:~/path/isp-imx-4.2.2.20.0/appshell/build/generated/release/bin/*_test ./

scp debix@192.168.x.xxx:~/path/isp-imx-4.2.2.20.0/appshell/build/generated/release/bin/Sensor*_Entry.cfg ./

scp debix@192.168.x.xxx:~/path/isp-imx-4.2.2.20.0/appshell/build/generated/release/bin/vvext ./

scp debix@192.168.x.xxx:~/path/isp-imx-4.2.2.20.0/dewarp/dewarp_config/* ./

scp debix@192.168.x.xxx:~/path/isp-imx-4.2.2.20.0/imx/start_isp.sh ./

scp debix@192.168.x.xxx:~/path/isp-imx-4.2.2.20.0/imx/run.sh ./

scp debix@192.168.x.xxx:~/path/isp-vvcam/vvcam/v4l2/sensor/os08a20/os08a20.ko ./

scp debix@192.168.x.xxx:~/path/isp-vvcam/vvcam/v4l2/vvcam-dwe.ko ./

scp debix@192.168.x.xxx:~/path/isp-vvcam/vvcam/v4l2/vvcam-isp.ko ./

scp debix@192.168.x.xxx:~/path/isp-vvcam/vvcam/v4l2/video/vvcam-video.ko ./


6. Write and mount the corresponding files to the specified location according to the hardware.

1) DEBIX ov5640 and gc2145 are YUV cameras that use NXP's ISI channel. When collecting image data, it is processed and stored according to the color coding method, and is only responsible for obtaining the raw image data from the camera sensors. To use these two cameras, you can replace the corresponding device tree and mount the corresponding driver. The following is an example of the ov5640 camera:

·Replace the corresponding device tree:

sudo cp /boot/imx8mp-debix-core-ov5640.dtb /boot/imx8mp-evk.dtb

·Reboot the device:

reboot

·Check if the driver for ov5640 is mounted or not:

lsmod | grep ov5640

·Once mounted, open the camera with the command:

cheese

·If the replacement device tree is correct and the driver is mounted, the camera will boot successfully.


3) IMX219 and ar1335 are NXP's ISP (Image Signal Processor) channel camera, which can do post-processing of the signal output from the front-end image sensor, the main functions are linearity correction, noise removal, bad dot removal, interpolation, white balance, automatic exposure control, etc., which relies on the ISP in order to be able to restore the details of the scene in a better way under different optical conditions. The following is an example of IMX219 camera:

·Replace the corresponding device tree:

sudo cp /boot/imx8mp-debix-io-imx219.dtb /boot/imx8mp-evk.dtb

·Reboot the device:

reboot

·Check if the driver for ov5640 is mounted or not:

lsmod | grep imx219

·Once mounted, open the camera with the command:

cheese

·If the replacement device tree is correct and the driver is mounted, the camera will boot successfully.