Changes

Jump to navigation Jump to search
Line 45: Line 45:  
[[File:ADP-TWG Connect Toradex Dahlia.jpg|center|thumb|800x800px|ADP-TWG Connect to Toradex Dahlia]]
 
[[File:ADP-TWG Connect Toradex Dahlia.jpg|center|thumb|800x800px|ADP-TWG Connect to Toradex Dahlia]]
 
<br />
 
<br />
=== Upgrade Verdin i.MX8M Plus system ===
+
=== Burn Verdin i.MX8M Plus system ===
<br />
+
Toradex provides various types of images for the board. Here, we only provide the "Toradex Embedded Linux - Yocto Project Reference Images” type of image for direct burning. If you want other types of burning images, please refer to the following chapter and compile and port the driver through the source code.
 +
==== BSP package introduction ====
 +
=====i.MX platform bsp=====
 +
https://github.com/veyeimaging/nxp_i.mx_veye_bsp
 +
 
 +
includes:
 +
 
 +
*driver source code
 +
*i2c toolkits
 +
*application demo
 +
 
 +
=====Toradex i.MX platform bsp=====
 +
https://github.com/veyeimaging/toradex_nxp_i.mx
 +
 
 +
includes:
 +
 
 +
*prebuild linux kernel:Image
 +
* prebuild dtb for different boards
 +
*dts source code
 +
*the reference images are available in the release of this project.
 +
 
 +
====Burn the Image using Toradex Easy Installer====
 +
Download Image form [https://github.com/veyeimaging/toradex_nxp_i.mx/releases here].
 +
 
 +
Refer to [https://developer.toradex.com/easy-installer/toradex-easy-installer/loading-toradex-easy-installer#verdinsomfamily loading-toradex-easy-installer] article to burn the image to Verdin board.
 +
 
 +
==== Necessary preparations ====
 +
After burning, connect Dahlia's DEBUG port to the computer, and you can access the i.MX system via the serial port.
 +
 
 +
Enter username "root" and leave the password blank.
 +
 
 +
* Execute the following command to disable the boot animation:
 +
 
 +
<code>systemctl stop wayland-app-launch</code>
 +
 
 +
<code>systemctl disable wayland-app-launch</code>
 +
 
 +
<code>reboot</code>
 +
 
 
=== Applications and Test ===
 
=== Applications and Test ===
 +
====Check system status====
 +
Run the following command to confirm whether the camera is probed.
 +
 +
*VEYE-MIPI-IMX327S,VEYE-MIPI-IMX462,VEYE-MIPI-IMX385
 +
 +
<code>dmesg | grep veye</code>  
 +
 +
The output message appears as shown below:
 +
 +
<code>[    1.525383] veyecam2m 2-003b:  camera id is veyecam2m</code>
 +
 +
<code>[    1.533458] veyecam2m 2-003b: sensor is IMX327</code>
 +
 +
<code>[    1.537935] veyecam2m 2-003b: board type is ONE board</code>
 +
 +
<code>[    1.543320] veyecam2m 2-003b: veyecam2m camera probed</code>
 +
 +
<code>[    5.710340] mx8-img-md: Registered sensor subdevice: veyecam2m 2-003b (1)</code>
 +
 +
<code>[    5.757858] mx8-img-md: created link [veyecam2m 2-003b] => [mxc-mipi-csi2.0]</code>
 +
 +
As you can see, the VEYE-MIPI-IMX327S module has been successfully probed and mounted on i2c-2.
 +
 +
*Run the following command to check the presence of video node.
 +
 +
<code>ls /dev/video*</code>
 +
 +
The output message appears as shown below.
 +
 +
<code>video3</code>
 +
 +
* List the formats supported by the camera
 +
 +
<code>v4l2-ctl --list-formats-ext -d /dev/video3</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]: 'NM12' (Y/CbCr 4:2:0 (N-C))</code>
 +
 +
<code>                Size: Discrete 1920x1080</code>
 +
 +
<code>        [7]: 'YM24' (Planar YUV 4:4:4 (N-C))</code>
 +
 +
<code>                Size: Discrete 1920x1080</code>
 +
 +
<code>        [8]: 'XR24' (32-bit BGRX 8-8-8-8)</code>
 +
 +
<code>                Size: Discrete 1920x1080</code>
 +
 +
<code>        [9]: '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/video3 has so many output formats.
 +
 +
==== Video Stream test ====
 +
 +
===== Preview (VEYE-MIPI-CAM@1080p mode) =====
 +
<code>gst-launch-1.0 v4l2src device=/dev/video3 ! video/x-raw, format=NV12, width=1920, height=1080,framerate=30/1 ! autovideosink -v</code>
 +
 +
or
 +
 +
<code>gst-launch-1.0 v4l2src device=/dev/video3 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/video3 ! 'video/x-raw, width=1920,height=1080' ! jpegenc ! filesink location=test_image.jpg</code>
 +
 +
===== Record 1080p video in H.264 format to a video file =====
 +
<code>gst-launch-1.0 v4l2src device=/dev/video3 num-buffers=300 ! "video/x-raw,format=NV12, width=1920, height=1080" ! v4l2h264enc ! video/x-h264 ! h264parse ! qtmux  ! filesink location=filename.mp4 -e</code>
 +
 +
===== Playback of saved video file =====
 +
<code>gst-launch-1.0 filesrc location=filename.mp4 ! queue ! decodebin ! videoconvert ! autovideosink</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 2 for Dahlia.
 +
 +
*VEYE series
 +
 +
Video Control Toolkits Manual :[http://wiki.veye.cc/index.php/VEYE-MIPI-290/327_i2c/ VEYE-MIPI-327 I2C]
    +
The "i2c_cmd" tool has already been provided in the /boot/ directory of the released image.
 
=== Build the drivers from source ===
 
=== Build the drivers from source ===
 +
The following operations are done on Ubuntu Host PC.
 +
 +
Toradex provides a method for building the compilation system, and here we will provide an example that is feasible.
    +
==== Build the Image.gz ====
 +
 +
===== Build Toradex standard Image =====
 +
First, refer to the following article and use Yocto to compile the entire system.
 +
 +
[https://developer.toradex.com/linux-bsp/os-development/build-yocto/build-a-reference-image-with-yocto-projectopenembedded/ Build a Reference Image with Yocto Project/OpenEmbedded]
 +
 +
This process is time-consuming, but by going through this process, you can recompile the entire system and avoid compatibility issues that may arise when modifying the original system.
 +
 +
After completing this step, you can use the Toradex Easy Installer to burn the Toradex standard image onto the board.
 +
 +
The compiled image can be found in the ''oe-core/build/deploy/images/verdin-imx8mp'' directory.
 +
 +
=====Patch driver 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: ''oe-core/build/tmp/work-shared/verdin-imx8mp/kernel-source/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.
 +
 +
===== Add config option =====
 +
<code>bitbake virtual/kernel menuconfig</code>
 +
 +
===== Build Image.gz =====
 +
<code>bitbake virtual/kernel</code>
 +
 +
In the ''oe-core/build/deploy/images/verdin-imx8mp'' directory, you will obtain the Image.gz with added veye camera driver.
 +
 +
The above is just a brief approach. You can customize meta layers, recipes, and images in Yocto Project.
 +
 +
==== Build the dtbo ====
 +
 +
===== Build Toradex standard dtbos =====
 +
For the dtbo, I took a simpler approach. Refer to the following article to directly compile the dtbo, instead of using Yocto.
 +
 +
[https://developer.toradex.com/linux-bsp/os-development/build-u-boot-and-linux-kernel-from-source-code/build-device-tree-overlays-from-source-code Build Device Tree Overlays from Source Code]
 +
 +
===== Add dts for veyecam =====
 +
<code>git clone <nowiki>https://github.com/veyeimaging/toradex_nxp_i.mx.git</nowiki></code>
 +
<br />
 
=== References ===
 
=== References ===

Navigation menu