Driver has been developed by TechNexion as an initiative in order to bootup Technexion MIPI-CSI2 cameras for NXP 8MPLUSLPD4-EVK board with Yocto 4.2 and kernel L6.1.55_2.2.0_MX8MP
- NXP i.MX 8M Plus EVK: 8MPLUSLPD4-EVK
- camera + MINI-SAS Cable: camera with NXP EVK
Prepare adapter board and cable for connect to EVK board.
- Yocto demo image
There are 3 options to get an image, we suggest using first one is the most easy way.
- Using TechNexion's Prebuilt demo image, which contains the required device tree blobs and camera driver.
It can be available for download via TechNexion's server: Image Download Link - If you want to build a Yocto Project image by yourself, TechNexion BSP release providing support NXP i.mx series processors:
Fetch Yocto source
Build Yocto - You can following the NXP's requirements for Yocto Project BSP: i.MX Yocto Project User's Guide
- Using TechNexion's Prebuilt demo image, which contains the required device tree blobs and camera driver.
- SD Card
SD card capacity must be > 8GB and then Flash image to SD card.- Under Windows flash tool: balena etcher
- Under Linux flash tool: bmap-tools
Tip
Ensure the boot mode is configured as boot from SD card.
Following this page to boot up: getting-started-with-the-i-mx-8m-plus-evk:GS-iMX-8M-Plus-EVK
If using TechNexion's Prebuilt demo image or build form TechNexion BSP release, it's already installed so you can skip this topic.
1. Download the camera driver and device tree blobs.
$ git clone https://github.com/TechNexion-Vision/nxp_evk_camera.git
$ cd nxp_evk_camera/
~/nxp_evk_camera$ git checkout tn-imx_6.1.55_2.2.0-stable
2. Copy to your kernel source code.
~/nxp_evk_camera$ cp -r driver/media/i2c/tevs/ <fetch_kernel_folder>/driver/media/i2c/
~/nxp_evk_camera$ cp arch/arm64/boot/dts/freescale/imx8mp-evk-tevs.dts <fetch_kernel_folder>/arch/arm64/boot/dts/freescale/
3. Modify makefile to add driver
$ cd <fetch_kernel_folder>/driver/media/i2c/
~/<fetch_kernel_folder>/driver/media/i2c/$ vi Makefile
Add this line in Makefile.
obj-$(CONFIG_VIDEO_TEVS) += tevs/
Note
you can refer to linux-tn-imx/drivers/media/i2c/Makefile
Modify Kconfig to add camera config
~/<fetch_kernel_folder>/driver/media/i2c/$ vi Kconfig
Add this part under "Camera sensor devices" menu in Kconfig.
config VIDEO_TEVS
tristate "TechNexion TEVS sensor support"
depends on OF
depends on GPIOLIB && I2C && VIDEO_V4L2_SUBDEV_API
depends on MEDIA_CAMERA_SUPPORT
default y
select V4L2_FWNODE
help
This is a Video4Linux2 sensor driver for the TechNexion
TEVS camera sensor with a MIPI CSI-2 interface.
Note
you can refer to linux-tn-imx/drivers/media/i2c/Kconfig
4. Modify makefile to add device tree.
$ cd <fetch_kernel_folder>/arch/arm64/boot/dts/freescale/
~/<fatch_kernel_folder>/arch/arm64/boot/dts/freescale/$ vi Makefile
Add this line in Makefile.
dtb-$(CONFIG_ARCH_MXC) += imx8mp-evk-tevs.dtb
Note
you can refer to linux-tn-imx/arch/arm64/boot/dts/freescale/Makefile
5. Compile the kernel & module driver
Finally, you can start compiling your new Image files, then copy and replace the Image files in the SD card.
Specify camera DTB in u-boot
- Connect debug console cable to NXP 8MPLUSLPD4-EVK.
- Power on board, and enter u-boot prompt.
- Specify camera dtb via 'fdtfile' u-boot environment variable
$ setenv fdtfile imx8mp-evk-tevs.dtb
- Continue boot process.
$ saveenv
$ boot
We can check whether camera have been link via v4l2 control command :
$ v4l2-ctl --list-device
Get the device number of camera capture device.
mxc-isi-cap (platform:32e00000.isi:cap_devic):
/dev/video{X}
The following is an example.
Specify the capture device you just get and start Gstreamer to get video stream on screen :
$ gst-launch-1.0 v4l2src device=/dev/video{X} ! video/x-raw,width=<x>,height=<y> ! waylandsink
NXP 8MPLUSLPD4-EVK board TEVS Camera Usage Guide