Skip to content

TechNexion-Vision/nxp_evk_camera

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

NXP i.MX 8M Plus Camera Driver

p3

Producer: Technexion License: GPL v2

Overview

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

Prerequisites

  • NXP i.MX 8M Plus EVK8MPLUSLPD4-EVK
  • camera + MINI-SAS Cablecamera 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.
    1. 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
    2. 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
    3. You can following the NXP's requirements for Yocto Project BSP: i.MX Yocto Project User's Guide
  • SD Card
    SD card capacity must be > 8GB and then Flash image to SD card.

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

Driver Installation instructions

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/

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.

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

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.

Instructions for testing camera

Specify camera DTB in u-boot

  1. Connect debug console cable to NXP 8MPLUSLPD4-EVK.
  2. Power on board, and enter u-boot prompt.
  3. Specify camera dtb via 'fdtfile' u-boot environment variable
$ setenv fdtfile imx8mp-evk-tevs.dtb
  1. Continue boot process.
$ saveenv
$ boot

Start camera video stream via gstreamer

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

Additional information

NXP 8MPLUSLPD4-EVK board TEVS Camera Usage Guide