/
conga-SMX8-Plus daA3840-30mc Basler camera support

conga-SMX8-Plus daA3840-30mc Basler camera support

Important Note

The documented BSP is a preliminary version with restrictions and can change at any time.
The sole purpose of the BSP is to allow early adopters to start with their development.

This document is a guideline how to get support for Basler daA3840-30mc MIPI-CSI camera for the i.MX 8M Plus based congatec modules #051320/1/2 SMX8P. The guide describes how to download and install necessary tools and drivers to Congatec Linux distribution based on Yocto project.
The first section contains information how to get supporting software packages. The second section describes how to incorporate camera support to Yocto build environment. The third section provides quick user guide for Basler camera supporting software and the last section describes how to build device trees for other Basler camera modules.

1. Basler Camera Support Download Instructions

1.1 Linux Yocto

Congatec software package supporting i.MX 8M Plus modules is based on Yocto Project Linux distribution. Manifest file to dedicated Yocto distributions are listed in the table bellow. It is recommended to download specific version of manifest.

Yocto Version

Yocto BSP guide

Repo Manifest File

Recommended Manifest Tag

GIT SHA String

Notes

Yocto Version

Yocto BSP guide

Repo Manifest File

Recommended Manifest Tag

GIT SHA String

Notes

Yocto 3.0 (Zeus)

i.MX 8M Plus Yocto 3.0 (Zeus)

cgtimx8mp-basler__imx-5.4.70-2.3.0.xml

N/A

99f02100c3af09f238f22b2fb3520a10816d6c89

SX8P & QX8P X

Yocto 3.0 (Zeus)

i.MX 8M Plus Yocto 3.0 (Zeus)

cgtqx8p-basler__imx-5.4.70-2.3.2__ea.xml

N/A

cbe243556714a0847798831d7e008a16345a7771

QX8P A

The repo tool dowloads all files into the working directory, so it is a good idea to create a dedicated directory for the purpose, e.g.

$ mkdir ~/yocto $ cd ~/yocto

To download Basler enabled Congatec Yocto distribution use latest repo tools:

$ repo init -u git@git.congatec.com:arm-nxp/imx8-family-ea/imx8m/manifest-imx8m-ea \ -b cgtimx8mp__imx-linux-zeus \ -m <Repo Manifest File> $ repo syncgit log

Please follow instructions in paragraph 2 and Yocto BSP guide for additional detail (link is in the table above).

1.2 Basler Camera Supporting Package

Basler camera utilities and supporting libraries - can be downloaded from Basler web pages. The name of supporting software package is Camera Enablement Package for NXP®s i.MX 8M Plus Applications Processor | GA and approppriate links are in the table bellow.
Note: To download Basler utilities it is necessary to register on Basler website and accept license terms.

Yocto Version

Basler Download Link

Notes

Yocto Version

Basler Download Link

Notes

Yocto 3.0 (Zeus)

Basler package v.1.2.0

SX8P & QX8P X

Yocto 3.0 (Zeus)

Basler package v.1.3.1

QX8P A

Store the Basler supporting in <yocto-dir>/sources directory and unpack it.
Note: supposing that package format is tar gzip

$ cd <yocto-dir>/sources $ tar -xzf <package-name>.tar.gz

2. Build Instructions

2.1 Configuration of the Build Directory and Environment

Downloaded Yocto source contains ....-setup-release.sh script (depending on Yocto version). This script prepares and configures build environment.
To make build process easier Congatec Basler Camera supporting package contains updated version setup script that is located in ~/<yocto-dir>/sources/meta-basler-cgt. The name of this script depends on Yocto version (listed in the table bellow).

Yocto Version

Env. Setup Script Name

Yocto Version

Env. Setup Script Name

Yocto 3.0 (Zeus)

cgt-imx-setup-release.sh

Update link to ....-setup-release.sh :

To setup environment use these commands:

Module

Machine Identification

Module

Machine Identification

conga-SMX8-Plus

imx8mp-cgt-sx8p-basler

conga-QMX8-Plus

imx8mp-cgtqx8p-basler

The script takes three inputs in this example - machine the build is being made for (variable MACHINE), distribution to use (variable DISTRO) and name of the build directory (the -b parameter).

2.2 Image Build

To build the image launch the Bitbake tool with name of image. Only supported image for Congates Basler demo is cgt-image-validation-imx-basler

The build process takes several hours depending on the build hardware.
Some hosting operating system could have a problem to build this image - see Yocto BSP guide for details.

2.3 Images

After the bitbake finishes, the following files can be found in the ~/<yocto-dir>/<build-dir>/tmp/deploy/images/<Machine Identification>/ subdirectory of the build folder. The name of final SD card image differs in each Yocto version:

Yocto Version

SD Card Image Name

Yocto Version

SD Card Image Name

Yocto 3.0 (Zeus)

<bitbake image name>-<Machine Identification>.wic.bz2

3. Quick User Guide

Basler daA3840-30mc MIPI-CSI camera can be used with Gstreamer linux tool or Basler Pylon gui

###LIMITATION on SX8P:
current basler camera driver supports only MIPI CSI0 port on SoC, which is routed to X58 connector on SMC carrier board.
(X58 is usually referenced as CSI1, which could lead to confusion)

Bring up steps:

  • connect camera to SMC X58 connector

  • boot the system

  • after system is online the camera is ready to use

  • command to use camera with gst-launch:

  • or you can use Basler Pylon software:

After a while the screen of Pylon application is opened. Pylon applicaton start with greeting window that contains useful notes about application and updates. Close this window to continue.

Select your camera in the list on the top left listing window and click to red power button on top left side - follow arrows.

Setup of camera hardware takes several seconds. After camera is activated, camera control menu is unshaded. Click to the button with camera symbol. The output of the camera will be showed on right window.

4. Adjustments

To provide support for other Congatec i.MX 8M Mini modules it is necessary to change device kernel tree configuration.

Current image contains several dtb configuration files:

DTB file name

Description

DTB file name

Description

imx8mp-cgtsx8p-basler_vvcam_csi0.dtb

[DEFAULT] DTB with Basler daA3840-30mc camera on CSI0 support

imx8mp-cgtsx8p-basler_cam_csi0.dtb

DTB with Basler daAXXXX-XXmci camera on CSI0 support

imx8mp-cgtsx8p-basler_cam_csi1.dtb

DTB with Basler daAXXXX-XXmci camera on CSI1 support

imx8mp-cgtsx8p.dtb

DTB without Basler camera support

imx8mp-cgtqx8p-basler-csi0.dtb

DTB with Basler daAXXXX-XXmci camera on CSI0 support

imx8mp-cgtqx8p-basler-csi1.dtb

DTB with Basler daAXXXX-XXmci camera on CSI1 support

It is possible to change dtb in uboot section by the command:

It is possible to build own DTB. Kernel sources can be found inside Yocto build tree at location:
~/<yocto-dir>/<build-dir>/tmp/work/imx8mm_cgt_basler-poky-linux/linux-congatec/<kernel-version>/git
To build device tree for the kernel it is necessary to install device tree compiler.

Device tree structure depends on Yocto version. Next sections describes how to adjust and compile device tree for supported Yocto.
Compiled device tree file basler-demo.dtb need to be coppied to SD card "boot" partition.
U-boot needs to be reconfigured for new DTB. To do that interrupt boot sequence inside ubuoot. Then update kernel DTB setting. The guide how to work with U-boot bootloader is at: i.MX 8M Mini Bootloader

4.1 DTB for Yocto 3.0 (Zeus)

The location of kernel source code is: ~/<yocto-dir>/<build-dir>/tmp/work/imx8mm_cgt_basler-poky-linux/linux-congatec/4.14.98-r0/git

To change dtb source file [*.dts] it is good to start with some existing file e.g.- imx8mp-cgtsx8p.dts. Copy this file to the same directory with diferrent name - referrenced as <DT-file-name>.dts.

Edit arch/arm64/boot/dts/congatec/<DT-file-name>.dts:
Add Basler camera configuration at the end of DTS file:

(This is an example for Basler camera daA3840-30mc connected to CSI0 port of SoC (X58 on SMC board which is marked as CSI1)

There is another example for Basler Camera module that is equiped with internal ISP (inside camera) like daA4200-30mci. This type do not use ISP integrated on imx8mp SoC an it needs to download ISP firmware to camera.
Due this fact this camera can be used only with attached PylonWiever software from Basler.

Then compile device tree source and save the resulting DTB file to SD card boot partition. Finaly update fdt_file variable to basler-demo.dtb in U-boot shell.