Line 65: |
Line 65: |
| Refer to : ''MYD-JX8MX-Software-Manual-zh-V1.3.pdf'' | | Refer to : ''MYD-JX8MX-Software-Manual-zh-V1.3.pdf'' |
| | | |
− | === Applications and Test === | + | Burn the standard system provided by MYIR to the board. |
− | <br /> | + | |
| + | ==== Using prebuilt Image and dtb file ==== |
| + | The Image and dtb files of the MYD-JX8MX board are saved in the FAT partition of emmc. After the system is started, it is automatically mounted to the ''/run/media/mmcblk0p1/'' directory. |
| + | |
| + | On HOST PC: |
| + | |
| + | <code>git clone <nowiki>https://github.com/veyeimaging/myir_nxp_i.mx.git</nowiki></code> |
| + | |
| + | Extract the kernel Image, and copy the Image and dtb files to the MYD-JX8MX board. |
| + | |
| + | <code>cp <your path>/Image /run/media/mmcblk0p1/</code> |
| + | |
| + | <code>cp <your path>/myb-fsl-imx8mq-evk-veye327.dtb /run/media/mmcblk0p1/myb-fsl-imx8mq-evk.dtb</code> |
| + | |
| + | Reboot MYD-JX8MX board. |
| + | |
| + | ==== Applications and Test ==== |
| + | |
| + | ===== Check system status ===== |
| + | Run the following command to confirm whether the camera is probed. |
| + | |
| + | * VEYE-MIPI-IMX327S |
| + | |
| + | <code>dmesg | grep veye327</code> |
| + | |
| + | The output message appears as shown below: |
| + | |
| + | <code>camera veye327_mipi is found</code> |
| + | |
| + | <code>Registered sensor subdevice: veye327_mipi <0/1>-003b</code> |
| + | |
| + | *CS-MIPI-IMX307 |
| + | |
| + | <code>dmesg | grep csimx307</code> |
| + | |
| + | The output message appears as shown below: |
| + | |
| + | <code>camera csimx307_mipi is found</code> |
| + | |
| + | <code>Registered sensor subdevice: csimx307_mipi <0/1>-003b</code> |
| + | |
| + | *CS-MIPI-SC132 |
| + | |
| + | <code>dmesg | grep cssc132</code> |
| + | |
| + | The output message appears as shown below: |
| + | |
| + | <code>camera cssc132_mipi is found</code> |
| + | |
| + | <code>Registered sensor subdevice: cssc132_mipi <0/1>-003b</code> |
| + | |
| + | *Run the following command to check the presence of video node. |
| + | |
| + | <code>ls /dev/video*</code> |
| + | |
| + | The output message appears as shown below. |
| + | |
| + | <code>video0 or video1</code> |
| + | |
| + | The cameras of the two MIPI-CSI2 interfaces are identified and mounted to i2-0 and i2c-1 respectively. |
| + | |
| + | ===== List the modes supported by the camera ===== |
| + | <code>v4l2-ctl --list-formats-ext -d /dev/video<0/1></code> |
| + | |
| + | ==== Video Stream test ==== |
| + | <code>export DISPLAY=:0</code> |
| + | |
| + | *Preview (VEYE-MIPI-IMX327S,CS-MIPI-IMX307 @1080p mode) |
| + | |
| + | <code>gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,width=1920,height=1080,framerate=(fraction)30/1' ! waylandsink</code> |
| + | |
| + | *Snap a picture (VEYE-MIPI-327S,CS-MIPI-IMX307 @1080p mode) |
| + | |
| + | <code>gst-launch-1.0 v4l2src num-buffers=1 device=/dev/video0 ! 'video/x-raw, width=1920,height=1080' ! jpegenc ! filesink location=test_image.jpg</code> |
| + | |
| + | *v4l2grab snap a picture(VEYE-MIPI-327S,CS-MIPI-IMX307 @1080p mode) |
| + | |
| + | <code>./v4l2grab -d /dev/video0 -W 1920 -H 1080 -I 30 -o picture.jpg</code> |
| + | |
| + | ==== Video Control Toolkits Manual ==== |
| + | Because of the high degree of freedom of our camera parameters, we do not use V4L2 parameters to control, but use scripts to configure parameters. |
| + | |
| + | https://github.com/veyeimaging/nxp_i.mx_veye_bsp/tree/main/i2c_cmd |
| + | |
| + | using -b option to identify which bus you want to use. |
| + | |
| + | * VEYE series |
| + | |
| + | Video Control Toolkits Manual :[[VEYE-MIPI-290/327 i2c/|VEYE-MIPI-327 I2C]] |
| + | |
| + | * CS series |
| + | |
| + | Video Control Toolkits Manual :[[CS-MIPI-X i2c|CS-MIPI-X I2C]] |
| + | |
| + | === Build the drivers from source === |
| + | The following operations are done on ubuntu Host PC. |
| + | |
| + | ==== Set up the Host PC environment ==== |
| + | Refer to the official document ''MYD-JX8MX-Software-Manual-zh-V1.3.pdf'' to deploy the development environment. |
| + | |
| + | Note that you don't have to use yocto if you only want to compile kernel, Of course, there is no problem with using yocto. |
| + | |
| + | ====== Cross-compiling Toolchain ====== |
| + | There is a compiler tool chain installation script in the ''03-Tools'' directory, which can be executed directly. |
| + | |
| + | <code>./fsl-imx-xwayland-glibc-x86_64-meta-toolchain-aarch64-toolchain-4.19-warrior.sh</code> |
| + | |
| + | After installing the compilation tool chain, execute the following command to configure the compilation environment: |
| + | |
| + | <code>source /opt/fsl-imx-xwayland/4.19-warrior/environment-setup-aarch64-poky-linux</code> |
| + | |
| + | ===== Build MYIR version kernel ===== |
| + | Copy the officially provided fsl-release-yocto.tar.gz to the development host and extract it. |
| + | |
| + | The source code for linux is already available in the ''fsl-release-yocto/linux-imx'' directory. |
| + | |
| + | <code>cd fsl-release-yocto/linux-imx</code> |
| + | |
| + | <code>make ARCH=arm64 CROSS_COMPILE=aarch64-poky-linux- defconfig</code> |
| + | |
| + | <code>make ARCH=arm64 CROSS_COMPILE=aarch64-poky-linux- -j4</code> |
| + | |
| + | ===== patch code ===== |
| + | |
| + | *Driver source code |
| + | |
| + | <code>git clone <nowiki>https://github.com/veyeimaging/nxp_i.mx_veye_bsp.git</nowiki></code> |
| + | |
| + | The source code path of the camera driver is: ''linux/drivers/media/platform/mxc/capture'', places the source code of the camera driver in the corresponding directory. |
| + | |
| + | * Modify the the Makefile and Kconfig files |
| + | |
| + | Modify the Config and Makefile in the same path. Add the corresponding camera driver. |
| + | |
| + | *dts file |
| + | |
| + | <code>git clone <nowiki>https://github.com/veyeimaging/myir_nxp_i.mx.git</nowiki></code> |
| + | |
| + | The path to the dts file is: ''linux/arch/arm64/boot/dts/freescale'', places the dts file in this path. |
| + | |
| + | Modify the Config and Makefile in the same path. Add the corresponding dts option. |
| + | |
| + | ===== Add compilation options ===== |
| + | <code>make menuconfig</code> |
| + | |
| + | Add the compilation options for the corresponding camera module driver, and the path is ''Device Drivers > Multimedia support > V4L platform devices > MXC Camera/V4L2 PRP Features support''. |
| | | |
− | === Build from Source === | + | ===== Build ===== |
| + | <code>make Image dtbs -j4</code> |
| | | |
| === References === | | === References === |
| + | MYIR official site:http://www.myir-tech.com/ |
| + | |
| + | MYD-JX8MX : http://down.myir-tech.com/MYD-JX8MX/ |
| + | <br /> |