-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release 2022.03 for hardknott-5.10.72-2.2.0
Upstream hash: bdfcbec24e776b6bf66d03ebe0a0353163d1add8 Changes: - First public release via github - Unified support for imx8mp, imx8mq, imx8mm - GenTL producers are updated to Version 2.0.0 - Added packagegroup-dart-bcon-mipi for easier integration
- Loading branch information
Stefan Klug
committed
Mar 13, 2022
1 parent
bd52b97
commit b1b6d66
Showing
57 changed files
with
3,787 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Copyright (C) 2021-2022 Basler AG | ||
|
||
Redistribution and use in source and binary forms, with or without modification, | ||
are permitted provided that the following conditions are met: | ||
1. Redistributions of source code must retain the above copyright notice, | ||
this list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
3. Neither the name of the copyright holder nor the names of its contributors | ||
may be used to endorse or promote products derived from this software | ||
without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | ||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | ||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | ||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Different components of meta-basler-imx8 are under different licenses (a mix | ||
of BSD and proprietary). Please see: | ||
|
||
COPYING.BSD | ||
licenses/* (Various EULAs, included by recipes) | ||
|
||
All metadata is BSD licensed unless otherwise stated. Source code and binaries | ||
included in tree for individual recipes are under the LICENSE stated in | ||
the associated recipe (.bb file) unless otherwise stated. | ||
|
||
License information for any other files is either explicitly stated | ||
or defaults to BSD. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,242 @@ | ||
OpenEmbedded/Yocto BSP layer for basler mipi cameras on the imx8 platform | ||
========================================================================= | ||
OpenEmbedded/Yocto layer for Basler dart BCON for Mipi cameras on the i.MX8 platform | ||
==================================================================================== | ||
|
||
This layer contains drivers and support files to use Basler mipi cameras on an imx8 | ||
|
||
Introduction: | ||
------------- | ||
The following instructions help you to build yocto images. This will allow you to | ||
stream images from a Basler dart BCON for MIPI camera ("Basler MIPI camera" for short) used with an NXP i.MX8 board. | ||
You can save the images to an SD card and process them using the Basler pylon SDK and the pylonViewer app. | ||
|
||
Prerequisites | ||
------------- | ||
Make sure you have a yocto working environment on your PC before you continue with the instructions. | ||
The instructions here are based on NXP's user guide [i.MX_Yocto_Project_User's_Guide.pdf](https://www.nxp.com/docs/en/user-guide/IMX_YOCTO_PROJECT_USERS_GUIDE.pdf). It is continously updated by | ||
NXP as new software versions are released, and may therefore apply to a version later than #KERNEL_VERSION#. | ||
NXP provides further documentation for the specific release [lf-5.10.72-2.2.0](https://www.nxp.com/webapp/Download?colCode=Llf-5.10.72-2.2.0_LINUX_DOCS) targeted by this readme. | ||
|
||
The user's guide includes information about how to establish the yocto working environment and details about NXP yocto builds. | ||
|
||
The instructions assume that the hardware installation for the camera is complete and that the system is up and running. | ||
The NXP i.MX8 board, however, is assumed to be switched off. It is also assumed that a monitor program, e.g. Tera Term, is running. | ||
|
||
For details about hardware installation, see the Quick Install Guide Basler Add-on Camera Kit dart BCON for MIPI document (AW001568). | ||
You can download the document free of charge from the Basler website: baslerweb.com. | ||
|
||
Supported boards: | ||
----------------- | ||
This Basler Camera Enablement Package supports the following NXP i.MX8 boards: | ||
|
||
- imx8mmevk (NXP: 8MMINILPD4-EVK) | ||
- imx8mmddr4evk (NXP: 8MMINID4-EVK) | ||
- imx8mpevk (NXP: 8MPLUSLPD4-EVK) | ||
- imx8mqevk (NXP: MCIMX8M-EVKB (B Silicon)) | ||
|
||
|
||
To build a yocto image for a NXP i.MX8 board | ||
--------------------------------------------- | ||
1. Create a new working folder for the yocto sources and images from the Basler MIPI camera and the NXP i.MX8 board. | ||
``` | ||
$ mkdir imx-yocto-bsp | ||
``` | ||
2. Check out the NXP imx yocto Board Support Package (BSP) to the working folder and grab all sources: | ||
``` | ||
$ cd imx-yocto-bsp | ||
$ repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-hardknott -m imx-lf-5.10.72-2.2.0.xml | ||
$ repo sync | ||
``` | ||
3. Add the basler meta layers | ||
``` | ||
$ cd imx-yocto-bsp/sources | ||
$ git clone --branch hardknott https://github.com/basler/meta-basler-tools.git | ||
$ git clone --branch hardknott-lf-5.10.72-2.2.0 https://github.com/basler/meta-basler-imx8.git | ||
$ cd .. | ||
It should look like this: | ||
└── sources | ||
├── base | ||
├── meta-basler-imx8 | ||
├── meta-basler-tools | ||
├── meta-browser | ||
├── meta-clang | ||
├── meta-freescale | ||
├── meta-freescale-3rdparty | ||
├── meta-freescale-distro | ||
├── meta-imx | ||
├── meta-nxp-demo-experience | ||
├── meta-openembedded | ||
├── meta-python2 | ||
├── meta-qt5 | ||
├── meta-rust | ||
├── meta-timesys | ||
└── poky | ||
``` | ||
4. Set the DISTRO and MACHINE variables and do the fsl setup. | ||
`<machine>` can be one of imx8mmevk, imx8mmddr4evk, imx8mpevk, imx8mqevk | ||
``` | ||
$ cd imx-yocto-bsp | ||
$ DISTRO=fsl-imx-xwayland MACHINE=<machine> source imx-setup-release.sh -b build-xwayland-<machine> | ||
``` | ||
5. In the `imx-yocto-bsp/build-xwayland-<MACHINE>/` directory: | ||
Append the following lines to the conf/bblayers.conf file to add the required meta layers for the Basler MIPI camera: | ||
``` | ||
BBLAYERS += "${BSPDIR}/sources/meta-basler-imx8" | ||
BBLAYERS += "${BSPDIR}/sources/meta-basler-tools" | ||
``` | ||
6. Append the following lines to the `imx-yocto-bsp/build-xwayland-<MACHINE>/conf/local.conf` file | ||
``` | ||
IMAGE_INSTALL_append = "packagegroup-dart-bcon-mipi" | ||
``` | ||
7. Call bitbake to create the required image. | ||
Building the image can take several hours. TODO: is fsl-image-validation-imx really the best proposal? | ||
For minimal testing | ||
``` | ||
$ cd imx-yocto-bsp/build-xwayland-<MACHINE>/ | ||
$ bitbake fsl-image-validation-imx | ||
``` | ||
Including all machine learning support | ||
``` | ||
$ cd imx-yocto-bsp/build-xwayland-<MACHINE>/ | ||
$ bitbake imx-image-full | ||
``` | ||
8. Enable the NXP i.MX8M Plus EVK board for SD card use. | ||
- Set the SW4 switch to 0011 in order to boot from SD card. | ||
- Flash SD card. | ||
Insert an SD card of at least 4 GB size into an SD card writer and flash according to the operating system: | ||
``` | ||
$ cd imx-yocto-bsp/build-xwayland-<MACHINE>/ | ||
$ bzip2 -cd tmp/deploy/images/<MACHINE>/fsl-image-validation-imx-<MACHINE>.wic.bz2 | dd of=/dev/sdX bs=1M status=progress | ||
$ sync | ||
``` | ||
or if image is imx-image-full: | ||
``` | ||
$ cd imx-yocto-bsp/build-xwayland-<MACHINE>/ | ||
$ bzip2 -cd tmp/deploy/images/<MACHINE>/imx-image-full-<MACHINE>.sdcard.bz2 | dd of=/dev/sdX bs=1M status=progress | ||
$ sync | ||
``` | ||
The '/dev/sdX' device in the above command is not to be taken literally, it is a placeholder for the actual block | ||
device created by your system, so you need to find that device by comparing the list of existing devices matching the | ||
pattern '/dev/sd?' prior to card insertion to the one after that. | ||
Writing to the SD card of course requires sufficient access permissions, which would usually mean that the command must | ||
be executed by the 'root' user. | ||
If the SD card already contains a file system, or partitions containing file systems, these may be automatically | ||
mounted upon insertion by your desktop environment. If this happens to be the case, you need to unmount those file systems | ||
prior to executing the 'dd' command. | ||
After flashing the image to the SD card, there will be two partitions /dev/sdX1 and /dev/sdX2, the latter containing the root file system. | ||
Depending on the size of your SD card, there may be some unallocated space after the rootfs partition, which can be reclaimed by | ||
growing it using a disk partitioning tool like gparted or cfdisk. After growing the partition, make sure that the file system contained in it is also | ||
resized. Resizing the rootfs partition is all optional. If you are uncomfortable using those low-level tools, just leave the partition as it is. | ||
- Make sure the NXP i.MX8 board is switched off. | ||
- Insert the SD card into the SD card slot of the NXP i.MX8 board. | ||
9. - Connect the Basler MIPI camera to the first CSI-2 port (imx8mp port #1 and/or port #2) on the NXP i.MX8 board. | ||
Note: The following boot sequence will proceed very quickly. You will have the opportunity to break into the startup sequence only in a three-second-window while "Hit any key to stop autoboot" appears. | ||
Assuming a monitor app is installed and running on the host system: | ||
- Switch on the NXP i.MX8 board and stop the boot process in u-boot mode looking at the UART monitor. | ||
- Set the corresponding device tree file in u-boot console before Linux is started. | ||
## Available device treefile | ||
The correct device tree file depends on the SoC and the number and type of connected cameras. | ||
There are two types of Basler MIPI cameras: | ||
- Cameras **with integrated ISP** (usually named daA*-mci). | ||
- Cameras **without integrated ISP** (usually named daA*-mc). | ||
The following table lists all possible combinations of SoC and cameras. | ||
**imx8mp** | ||
| Device tree file name | Camera on CSI1 | Camera on CSI2 | | ||
| ------------------------------------- | --------------------------------------- | ------------------------------------- | | ||
| `imx8mp-evk-basler.dtb` | without ISP, max 500MPix/s | -- | | ||
| `imx8mp-evk-dual-basler.dtb` | without ISP, max 266MPix/s, max 1080P | without ISP, max 266MPix/s, max 1080P | | ||
| `imx8mp-evk-basler-mixed-isp-isi.dtb` | without ISP, max 500MPix/s | with ISP, max width 2048 pix | | ||
| `imx8mp-evk-basler-isi0.dtb` | with ISP, max width 4096 pix | -- | | ||
| `imx8mp-evk-basler-isi0-isi1.dtb` | with ISP, max width 2048 pix | with ISP, max width 2048 pix | | ||
**imx8mm** | ||
| Device tree file name | Camera on CSI1 | Camera on CSI2 | | ||
| ------------------------------------- | ---------------------------- | ---------------------------- | | ||
| `imx8mm-evk-basler-camera.dtb` | with ISP | -- (no second csi port) | | ||
**imx8mmddr4** | ||
| Device tree file name | Camera on CSI1 | Camera on CSI2 | | ||
| ------------------------------------- | ---------------------------- | ---------------------------- | | ||
| `imx8mm-ddr4-evk-basler-camera.dtb` | with ISP | -- (no second csi port) | | ||
**imx8mq** | ||
| Device tree file name | Camera on CSI1 | Camera on CSI2 | | ||
| ------------------------------------- | ---------------------------- | ---------------------------- | | ||
| `imx8mq-evk-basler-camera.dtb` | with ISP | with ISP | | ||
Examples: | ||
- daA2500-60mci connected on CSI1, no camera on CSI2: imx8mp-evk-basler-isi0.dtb | ||
- daA3840-30mc connected on CSI1, daA3840-30mc on CSI2: imx8mp-evk-dual-basler.dtb | ||
Cameras will be limited to 266MPIX/s bandwidth and 1080P resolution. | ||
Chose the correct device tree file from the above list: | ||
imx8mpevk: | ||
``` | ||
u-boot=> setenv fdtfile imx8mp-evk-basler.dtb | ||
u-boot=> saveenv | ||
u-boot=> reset | ||
``` | ||
The system is ready for use. | ||
10. To start the Basler pylon Viewer, enter the following line in the Wayland terminal window: | ||
``` | ||
# GENICAM_GENTL64_PATH=/opt/dart-bcon-mipi/lib /opt/pylon6/bin/pylonviewer | ||
``` | ||
or use the shorthand: | ||
``` | ||
# pylon | ||
``` | ||
Now you can operate the camera | ||
- Select the Basler MIPI camera. | ||
- Open the camera. | ||
- Start streaming. | ||
---------------------------------------------------------------------- | ||
Supplementary Information | ||
------------------------- | ||
- re 7. Optionally, it is possible to use the bitbake populate_sdk command to create a yocto SDK which enables | ||
local cross compilation for the `<MACHINE>` target device. This can be used to develop own applications without using the yocto image build. | ||
``` | ||
$ bitbake -c populate_sdk fsl-image-validation-imx | ||
``` | ||
- remote X support: In order to establish a remote ssh -X session call on host | ||
``` | ||
$ ssh -X root@<ip-address> | ||
Once the remote connection is established call | ||
# GENICAM_GENTL64_PATH=/opt/dart-bcon-mipi/lib /opt/pylon6/bin/pylonviewer | ||
``` | ||
- re 10. gstreamer usage for daA2500-60mc and daA3840-30mc | ||
it is possible to display live video via gstreamer using: | ||
``` | ||
gst-launch-1.0 -v v4l2src device=/dev/video2 ! waylandsink | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# We have a conf and classes directory, add to BBPATH | ||
BBPATH .= ":${LAYERDIR}" | ||
|
||
# We have recipes-* directories, add to BBFILES | ||
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ | ||
${LAYERDIR}/recipes-*/*/*.bbappend" | ||
|
||
BBFILE_COLLECTIONS += "basler-imx8" | ||
BBFILE_PATTERN_basler-imx8 = "^${LAYERDIR}/" | ||
BBFILE_PRIORITY_basler-imx8 = "50" | ||
LAYERVERSION_basler-imx8 = "1" | ||
LAYERSERIES_COMPAT_basler-imx8 = "hardknott" | ||
|
||
LICENSE_PATH += "${LAYERDIR}/licenses" | ||
|
||
# Override/extend machine configurations | ||
|
||
# imx8mmddr4evk | ||
KERNEL_DEVICETREE_append_imx8mmddr4evk = " \ | ||
freescale/imx8mm-ddr4-evk-basler-camera.dtb" | ||
|
||
# imx8mmevk | ||
KERNEL_DEVICETREE_append_imx8mmevk = " \ | ||
freescale/imx8mm-evk-basler-camera.dtb" | ||
|
||
# imx8mqevk | ||
KERNEL_DEVICETREE_append_imx8mqevk = " \ | ||
freescale/imx8mq-evk-basler-camera-csi1.dtb \ | ||
freescale/imx8mq-evk-basler-camera-csi2.dtb \ | ||
freescale/imx8mq-evk-basler-camera.dtb" | ||
|
||
# imx8mpevk | ||
KERNEL_DEVICETREE_append_imx8mpevk = " \ | ||
freescale/imx8mp-evk-basler.dtb \ | ||
freescale/imx8mp-evk-dual-basler.dtb \ | ||
freescale/imx8mp-evk-basler-mixed-isp-isi.dtb \ | ||
freescale/imx8mp-evk-basler-isi0-isi1.dtb \ | ||
freescale/imx8mp-evk-basler-isi0.dtb " | ||
|
||
|
Oops, something went wrong.