building linux 3.14.28 fsl-image-gui with opencv using yocto on imx6q

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

building linux 3.14.28 fsl-image-gui with opencv using yocto on imx6q

4,475 Views
jingyizhang
Contributor I

Hi,

I am in the process of building a linux 3.14.28 fsl-image-gui image with opencv using YOCTO, below are the steps I'm following and since the image bitbake command is taking so long I just wanted to double check that what I'm doing makes sense. I followed multiple tutorials and I will list all the steps here.

My board is the imx6q sabre SD and came with two cameras.

ENVIRONMENT SETUP (Freescale_Yocto_Project_User's_Guide.pdf)

$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \

  build-essential chrpath  socat

$ sudo apt-get install libsdl1.2-dev xterm  sed cvs subversion coreutils texi2html \

docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils \

libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidoc

$ sudo apt-get install u-boot-tools

$ mkdir ~/bin (this step may not be needed if the bin folder already exists)

$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo  > ~/bin/repo

$ chmod a+x ~/bin/repo

$ export PATH=~/bin:$PATH

YOCTO PROJECT SETUP (Freescale_Yocto_Project_User's_Guide.pdf)

$ mkdir fsl-release-bsp

$ cd fsl-release-bsp

$ git config --global user.name "Your Name"

$ git config --global user.email "Your Email"

$ git config --list

$ repo init -u git://git.freescale.com/imx/fsl-arm-yocto-bsp.git -b imx-3.14.28-1.0.0_ga

$ repo sync

CHOOSE BUILD TARGET (Freescale_Yocto_Project_User's_Guide.pdf)

MACHINE=imx6qsabresd source fsl-setup-release.sh -b build-x11 -e x11


ADD OPENCV LIB TO IMAGE (http://imxcv.blogspot.ca/2014/02/building-opencv-24x-for-freescales-imx6.html)
file affected: ~/fsl-release-bsp/build-x11/conf/local.conf

MACHINE ??= 'imx6qsabresd'

DISTRO ?= 'poky'

PACKAGE_CLASSES ?= "package_rpm"

EXTRA_IMAGE_FEATURES = "debug-tweaks dev-pkgs"

USER_CLASSES ?= "buildstats image-mklibs image-prelink"

PATCHRESOLVE = "noop"

BB_DISKMON_DIRS = "\

STOPTASKS,${TMPDIR},1G,100K \

STOPTASKS,${DL_DIR},1G,100K \

STOPTASKS,${SSTATE_DIR},1G,100K \

ABORT,${TMPDIR},100M,1K \

ABORT,${DL_DIR},100M,1K \

ABORT,${SSTATE_DIR},100M,1K"

PACKAGECONFIG_pn-qemu-native = "sdl"

ASSUME_PROVIDED += "libsdl-native"

CONF_VERSION = "1"

BB_NUMBER_THREADS = '4'

PARALLEL_MAKE = '-j 4'

DL_DIR ?= "${BSPDIR}/downloads/"

ACCEPT_FSL_EULA = "1"

CORE_IMAGE_EXTRA_INSTALL += "gpu-viv-bin-mx6q gpu-viv-bin-mx6q-dev"

CORE_IMAGE_EXTRA_INSTALL += "libopencv-core-dev libopencv-highgui-dev libopencv-imgproc-dev libopencv-objdetect-dev libopencv-ml-dev"

LICENSE_FLAGS_WHITELIST = "commercial"

file affected: ~/fsl-release-bsp/build-x11/conf/bblayers.conf

when I tried to bitbake, i get the error saying networking depends on python, hence I added this layer

LCONF_VERSION = "6"

BBPATH = "${TOPDIR}"

BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../..')}"

BBFILES ?= ""

BBLAYERS = " \

  ${BSPDIR}/sources/poky/meta \

  ${BSPDIR}/sources/poky/meta-yocto \

  \

  ${BSPDIR}/sources/meta-openembedded/meta-oe \

  ${BSPDIR}/sources/meta-openembedded/meta-multimedia \

  \

  ${BSPDIR}/sources/meta-fsl-arm \

  ${BSPDIR}/sources/meta-fsl-arm-extra \

  ${BSPDIR}/sources/meta-fsl-demos \

"

##Freescale Yocto Release layer

BBLAYERS += " ${BSPDIR}/sources/meta-fsl-bsp-release/imx/meta-fsl-arm "

BBLAYERS += " ${BSPDIR}/sources/meta-fsl-bsp-release/imx/meta-fsl-demos "

BBLAYERS += " ${BSPDIR}/sources/meta-browser "

BBLAYERS += " ${BSPDIR}/sources/meta-openembedded/meta-gnome "

BBLAYERS += " ${BSPDIR}/sources/meta-openembedded/meta-networking "

BBLAYERS += " ${BSPDIR}/sources/meta-openembedded/meta-ruby "

BBLAYERS += " ${BSPDIR}/sources/meta-openembedded/meta-python "

BBLAYERS += " ${BSPDIR}/sources/meta-qt5 "

BBLAYERS += " ${BSPDIR}/sources/meta-fsl-bsp-release/imx/meta-fsl-qt5 "

BBLAYERS += " ${BSPDIR}/sources/meta-fsl-bsp-release/imx/meta-fsl-bluez "

BUILD IMAGE (Freescale_Yocto_Project_User's_Guide.pdf)

$ bitbake fsl-image-gui

FLASH IMAGE ONTO SD CARD (Freescale_Yocto_Project_User's_Guide.pdf)

$ cd ~/fsl-release-bsp/build-x11/tmp/deploy/images/imx6qsabresd/

$ sudo dd if=<image name>.sdcard  of=/dev/sd<partition> bs=1M && sync

BUILD TOOLCHAIN (http://imxcv.blogspot.ca/2014/02/building-opencv-24x-for-freescales-imx6.html)

$ cd ~/fsl-release-bsp/build-x11/

$ bitbake fsl-image-gui -c populate_sdk

INSTALL TOOLCHAIN (http://imxcv.blogspot.ca/2014/02/building-opencv-24x-for-freescales-imx6.html)

$ cd ~/fsl-release-bsp/build-x11/tmp/deploys/sdk/

$ ./poky-eglibc-x86_64-fsl-image-gui-cortexa9hf-vfp-neon-toolchain-1.5.4.sh

SETUP CROSS COMPILE ENVIRONMENT (http://imxcv.blogspot.ca/2014/02/building-opencv-24x-for-freescales-imx6.html)

*open a new terminal

$ cd /opt/poky/1.5.4

$ . ./environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi

CROSS COMPILE SAMPLE OPENCV VIDEO CAPTURE WRAPPER (http://jafp.github.io/blog/2014/10/23/using-the-ov5640-mipi-csi2-camera-on-imx6-with-opencv/)

since the camera's driver are not compatible with opencv by default, I found this wrapper that is supposed to help the situation.

cross compile the bin on host then copy over to target board for testing

Tags (3)
0 Kudos
2 Replies

785 Views
jingyizhang
Contributor I

Hi again,

So the above process succeeded and I was able to capture 30 frames as the app is supposed to do.

However, when I try to display the stream to a window using:

while(1) {

     capture.read(frame);

     cv::imShow("dp", frame);

}

I can see my screen is showing the window "dp", but there is no visual/content displayed.

I also get the warnings:

QT Warning: Could not find a location of the system's compose files. consider setting the QTCOMPOSE environment variables

Init done

Unable to find an x11 visual which matches EGL config 1

Because I built the fsl-image-gui, and there's another fsl-image-qt, should I be using the qt image instead??

Any suggestions would be greatly appreciated.

0 Kudos

785 Views
Yuri
NXP Employee
NXP Employee

Hello !

   I think it is good idea to use the qt configuration /image.


Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos