Changes

Jump to navigation Jump to search
Line 75: Line 75:  
Burn the standard system provided by Forlinx to the board.
 
Burn the standard system provided by Forlinx to the board.
   −
==== 3.4 Using prebuilt Image and dtb file ====
+
==== Using prebuilt Image and dtb file ====
 
The Image and dtb files of the OKMX8MPQ-C board are saved in the FAT partition of emmc. After the system is started, it is automatically mounted to the ''/run/media/mmcblk2p1/'' directory.
 
The Image and dtb files of the OKMX8MPQ-C board are saved in the FAT partition of emmc. After the system is started, it is automatically mounted to the ''/run/media/mmcblk2p1/'' directory.
   Line 113: Line 113:  
<code>[    6.150181] mx8-img-md: created link [veyecam2m 1-003b] => [mxc-mipi-csi2.1]</code>
 
<code>[    6.150181] mx8-img-md: created link [veyecam2m 1-003b] => [mxc-mipi-csi2.1]</code>
   −
As you can see, the VEYE-MIPI-IMX327S module has been successfully probed and mounted on i2c-1.
+
It can be seen that the VEYE-MIPI-IMX327S camera has been identified on i2c-1.
   −
<br />
+
Once the camera is correctly recognized, a device node named /dev/video0 will be generated.
 +
 
 +
* List the formats supported by the camera
 +
 
 +
<code>v4l2-ctl --list-formats-ext -d /dev/video0</code>
 +
 
 +
<code>ioctl: VIDIOC_ENUM_FMT</code>
 +
 
 +
<code>        Type: Video Capture Multiplanar</code>
 +
 
 +
<code>        [0]: 'RGBP' (16-bit RGB 5-6-5)</code>
 +
 
 +
<code>                Size: Discrete 1920x1080</code>
 +
 
 +
<code>        [1]: 'RGB3' (24-bit RGB 8-8-8)</code>
 +
 
 +
<code>                Size: Discrete 1920x1080</code>
 +
 
 +
<code>        [2]: 'BGR3' (24-bit BGR 8-8-8)</code>
 +
 
 +
<code>                Size: Discrete 1920x1080</code>
 +
 
 +
<code>        [3]: 'YUYV' (YUYV 4:2:2)</code>
 +
 
 +
<code>                Size: Discrete 1920x1080</code>
 +
 
 +
<code>        [4]: 'YUV4' (32-bit A/XYUV 8-8-8-8)</code>
 +
 
 +
<code>                Size: Discrete 1920x1080</code>
 +
 
 +
<code>        [5]: 'NV12' (Y/CbCr 4:2:0)</code>
 +
 
 +
<code>                Size: Discrete 1920x1080</code>
 +
 
 +
<code>        [6]: 'YM24' (Planar YUV 4:4:4 (N-C))</code>
 +
 
 +
<code>                Size: Discrete 1920x1080</code>
 +
 
 +
<code>        [7]: 'XR24' (32-bit BGRX 8-8-8-8)</code>
 +
 
 +
<code>                Size: Discrete 1920x1080</code>
 +
 
 +
<code>        [8]: 'AR24' (32-bit BGRA 8-8-8-8)</code>
 +
 
 +
<code>                Size: Discrete 1920x1080</code>
 +
 
 +
In fact, the camera only provides UYVY data format, and the ISI module in i.MX 8M Plus provides data format conversion function, so /dev/video0 has so many output formats.
 +
 
 +
=== Video Stream test ===
 +
 
 +
==== Preview (VEYE-MIPI-CAM@1080p mode) ====
 +
<code>gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, format=NV12, width=1920, height=1080,framerate=30/1 ! autovideosink -v</code>
 +
 
 +
or
 +
 
 +
<code>gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw, format=NV12, width=1920, height=1080,framerate=30/1 ! imxvideoconvert_g2d ! queue ! video/x-raw, format=RGB16, width=1920, height=1080 ! waylandsink</code>
 +
====Snap a picture (VEYE-MIPI-CAM@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-CAM@1080p mode) ====
 +
<code>./v4l2grab -d /dev/video0 -W 1920 -H 1080 -I 30 -o picture.jpg</code>
 +
 
 +
====I2C 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, please use -b 1 for OKMX8MPQ-C.
 +
 
 +
*VEYE series
 +
 
 +
Video Control Toolkits Manual :[http://wiki.veye.cc/index.php/VEYE-MIPI-290/327_i2c/ VEYE-MIPI-327 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 ''OKMX8MPQ-C_Linux5.4.70+Qt5.15.0_manual_V1.2_20230406.pdf''  to deploy the development environment.
 +
 
 +
==== Build Forlinx version kernel ====
 +
Compile the standard version according to the above document.
 +
 
 +
====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/i2c'', places the source code of the camera driver in the corresponding directory.
 +
 
 +
Merge the Config and Makefile  in the same path. Add the corresponding camera driver.
 +
 
 +
*dts file
 +
 
 +
<code>git clone <nowiki>https://github.com/veyeimaging/forlinx_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 > I2C Encoders, decoders, sensors and other helper chips'' .
 +
====Build====
 +
Refer to the official documentation and compile to obtain Image and dtb output.

Navigation menu