i.MX Processors Knowledge Base

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

i.MX Processors Knowledge Base

Discussions

Sort by:
This post describes the setup detail for installing Ubuntu based distro in any i.Mx6x NXP Boards. Details are described on: 1. Select your board, Setting the host, Download and compile uboot , dtb and and the Kernel version on your board. 2. Installing the Ubuntu core, Lubuntu graphics desktop version and/or Build your own Ubuntu rootfs with debootstrap. 3. Modify rootfs and Installing needed packages 4. Setting with SD image. 5. Setting Ubuntu on target 6. Adding GPU acceleration 1: Select your board, Setting the host, Download and compile uboot , dtb and and the Kernel version on your board. Supported NXP HW boards: i.MX 6QuadPlus SABRE-SD Board and Platform i.MX 6Quad SABRE-SD Board and Platform i.MX 6DualLite SABRE-SD Board i.MX 6Quad SABRE-AI Board i.MX 6DualLite SABRE-AI Board i.MX 6SoloX SABRE-SD Board i.MX 6SoloX SABRE-AI Board Install host dependences (version tested 14.04): $ sudo apt-get install gparted git build-essential libncurses5 wget u-boot-tools zlib1g-dev ncurses-dev \ cmake libc-dev-armhf-cross pkg-config-arm-linux-gnueabihf build-essential checkinstall cmake \ pkg-config lzop libc6 libstdc++6 debootstrap qemu-user-static binfmt-support Download the compiler toolchain and extract it: $ cd ~/ $ wget -c https://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz $ tar xf gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz Create general variable environments: $ export target=mx6q (e.g. processor: mx6sx, mx6d, mx6dl,etc) $ export board=sabresd (e.g. sabresd, sabreauto) $ export ARCH=arm $ export CROSS_COMPILE=../gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf- $ unset LDFLAGS Download u-boot At the release of this document, latest uboot version was imx_3.14.52, it should work with other version as well, so please check the proper version for your board: $ cd ~/ $ wget –c http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/snapshot/uboot-imx-rel_imx_3.14.52_1.1.0_ga.tar.gz $ tar -xf uboot-imx-rel_imx_3.14.52_1.1.0_ga.tar.gz $ cd uboot-imx-rel_imx_3.14.52_1.1.0_ga $ make $targetboard_config    # e.g. mx6qsabresd_config $ make Linux Kernel, Firmware, headers, modules and DTS files $ cd ~/ $ wget –c http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/snapshot/linux-2.6-imx-rel_imx_3.14.52_1.1.0_ga.tar.gz $ tar xf linux-2.6-imx-rel_imx_3.14.52_1.1.0_ga.tar.gz $ cd linux-2.6-imx-rel_imx_3.14.52_1.1.0_ga $ make imx_v7_defconfig $ make menuconfig $ make -j4 zImage modules dtbs $ cd ~/ move your image to binary folder: $ sudo cp –v uboot-imx-rel_imx_3.14.52_1.1.0_ga/u-boot.imx binary/ $ sudo cp –v linux-2.6-imx-rel_imx_3.14.52_1.1.0_ga/arch/arm/boot/zImage binary/ $ sudo cp –v linux-2.6-imx-rel_imx_3.14.52_1.1.0_ga/arch/arm/boot/dts/i$target-$board.dtb binary/ Now you have the bootloader, device tree and kernel image of your board ready, let’s create the rootfs. 2: Installing the Ubuntu core, Lubuntu graphics desktop version and/or Build your own Ubuntu rootfs with debootstrap. Installing ubuntu core: $ cd ~/ $ sudo mkdir –p core /media/rootfs /media/kernel $ wget –c http://cdimage.ubuntu.com/ubuntu-core/releases/14.04/release/ubuntu-core-14.04.4-core-armhf.tar.gz $ sudo tar –xf ubuntu-core-14.04.4-core-armhf.tar.gz –C core $ sudo cp -vr core/* /media/rootfs $ cd linux-2.6-imx-rel_imx_3.14.52_1.1.0_ga $ sudo make modules_install firmware_install INSTALL_MOD_PATH=/media/rootfs/ ARCH=arm CROSS_COMPILE=../../gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf- $ sudo make ARCH=arm CROSS_COMPILE=../../gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf- headers_install INSTALL_HDR_PATH=/media/rootfs/usr Now you should have your ubuntu rootfs on /media/rootfs folder. and you can pass to part 3 of this post. Installing ubuntu Linaro LXDE: $ cd ~/ $ sudo mkdir –p core /media/rootfs /media/kernel $ wget https://releases.linaro.org/14.10/ubuntu/trusty-images/alip/linaro-trusty-alip-20141024-684.tar.gz $ sudo tar -xf linaro-trusty-alip-20141024-684.tar.gz –C core $ sudo mv core/binary/* core/ $ sudo rm –rf core/binary $ sudo cp -vr core/* /media/rootfs $ cd linux-2.6-imx-rel_imx_3.14.52_1.1.0_ga $ sudo make modules_install firmware_install INSTALL_MOD_PATH=/media/rootfs/ ARCH=arm CROSS_COMPILE=../../gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf- $ sudo make ARCH=arm CROSS_COMPILE=../../gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf- headers_install INSTALL_HDR_PATH=/media/rootfs/usr Now you should have your ubuntu rootfs on /media/rootfs folder. and you can pass to part 3 of this post. Installing with debootstrap $ cd ~/ $ target=rootfs $ distro=trusty $ sudo debootstrap --arch=armhf --foreign --include=ubuntu-keyring,apt-transport-https,ca-certificates,openssl $distro "$target" http://ports.ubuntu.com $ sudo cp /usr/bin/qemu-arm-static $target/usr/bin $ sudo cp /etc/resolv.conf $target/etc Now have a minimal Ubuntu rootfs - chroot to it and perform the 2nd stage install: $ sudo chroot $target  //Now we are in chroot # distro=trusty # export LC_ALL=C LANGUAGE=C LANG=C # /debootstrap/debootstrap --second-stage Edit the sources.list repositories # cat <<EOT > /etc/apt/sources.list deb http://ports.ubuntu.com/ubuntu-ports/ $distro main restricted universe multiverse deb http://ports.ubuntu.com/ubuntu-ports/ $distro-updates main restricted universe multiverse deb http://ports.ubuntu.com/ubuntu-ports/ $distro-security main restricted universe multiverse EOT # apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 40976EAF437D05B5 # apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 3B4FE6ACC0B21F32 # apt-get update # apt -y -f install # apt-get upgrade # apt-get install nano Now you should be able to login without password, then use passwd command to set one. If you like to add custom users: # passwd root # adduser <myuser> # usermod -a -G tty myuser # usermod -a -G dialout, adm, sudo, dip, plugdev myuser # visudo Under the line that looks like: root ALL=(ALL:ALL) ALL add the following (change user with your actual username) <myuser> ALL=(ALL) ALL your rootfs is ready, exit chroot # exit $ sudo rm $target/etc/resolv.conf $ sudo rm $target/usr/bin/qemu-arm-static $ sudo mv rootfs/* /media/rootfs $ cd linux-2.6-imx-rel_imx_3.14.52_1.1.0_ga $ sudo make modules_install firmware_install INSTALL_MOD_PATH=/media/rootfs/ ARCH=arm CROSS_COMPILE=../../gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf- $ sudo make ARCH=arm CROSS_COMPILE=../../gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf- headers_install INSTALL_HDR_PATH=/media/rootfs/usr Now you should have your ubuntu rootfs on /media/root. 3: Modify Rootfs and Install needed packages Edit and verify the sources.list repositories $ cd /media/rootfs $ sudo cat <<EOT > etc/apt/sources.list deb http://ports.ubuntu.com/ubuntu-ports/ trusty main restricted universe multiverse deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main restricted universe multiverse deb http://ports.ubuntu.com/ubuntu-ports/ trusty-security main restricted universe multiverse EOT Edit networks interfaces and append in the existing file: $ sudo nano etc/network/interfaces auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp If you require Serial Console, remove and include an additional line at the end of the file for  ttymxc0 output as below, $ sudo nano etc/init/tty1.conf exec /sbin/getty -8 38400 tty1 exec /sbin/getty -L 115200 ttymxc0 If you like to change the localhostname: $ sudo nano etc/hostname and change to “your name” e.g. imx6Q. Set the date and time clock and update $ sudo nano /etc/rc.local  Add this: if [ `date +"%Y"` -eq "1970" ]; then                     date --set="2016-04-01" fi exit 0 (optional for Linaro rootfs) Edit passwd and remove the x in root and linaro lines $ sudo nano etc/passwd root:x:0:0:root:/root:/bin/bash linaro:x:0:0.. and change like this:                                   root::0:0:root:/root:/bin/bash linaro:::0:.. Now you are ready to program your sd image. 4: Setup microSD/SD card For these instructions, we are assuming: DISK=/dev/sdg on your HOST, cat /proc/partitions is very useful for determining the device id. $ cd ~/ $ export DISK=/dev/sdg Erase microSD/SD card: $ sudo dd if=/dev/zero of=${DISK} bs=1M count=10 Install Bootloader $ cd binary/ $ sudo dd if=u-boot.imx of=${DISK} bs=512 seek=2 $ sync Create Partition layout: $ cd ~/ $ sudo fdisk ${DISK} steps:        d ///delete all partitions currently on sd n // create new partition p // Primary partition 1 // partition number 1 2048 //default +1G // n // created 2d parition p 2 default default 1 // firts B // to be fat32 W // write partiotions $ sudo mkfs.vfat ${DISK}1 $ sudo mkfs.ext3  ${DISK}2 Mount ext3 SD partition to /media/rootfs: $ sudo mount ${DISK1} /media/kernel_target $ sudo mount ${DISK}2 /media/rootfs_target Copy Files on the SD. $ cd ~/ $ sudo cp –v binary/ i$target-$board.dtb /media/kernel_target $ sudo cp –v binary/zImage /media/kernel_target $ sudo mv /media/rootfs/* /media/rootfs_target Remove SD: $ sync $ sudo umount /media/kernel_target $ sudo umount /media/rootfs_target Boot the target, in console you should be login as root. root@imx6QSabreSD:~# 5: Setting Ubuntu on target Note: If you have issues with sudo on user UID, need to logout and log as root: imx6Q login: root Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 3.14.52 armv7l) root@imx6Q:~# chown root:root /usr/bin/sudo root@imx6Q:~# chmod 4755 /usr/bin/sudo root@imx6Q:~# exit Login with <user $> or root # # apt-get update # apt-get –f install # apt-get install locales dialog wget # dpkg-reconfigure locales # apt-get upgrade Optional – install some useful packages: # apt-get install openssh-server can-utils usbutils build-essential automake autoconf libtool Get and Install the BSP packages (EULA required) # cd /home/user # mkdir –p vpu_pack # cd vpu_pack # wget http://www.nxp.com/lgfiles/NMG/MAD/YOCTO//firmware-imx-5.3.bin # wget http://www.nxp.com/lgfiles/NMG/MAD/YOCTO//imx-vpu-5.4.32.bin # wget http://www.nxp.com/lgfiles/NMG/MAD/YOCTO//libfslcodec-4.0.8.bin # wget http://www.nxp.com/lgfiles/NMG/MAD/YOCTO//imx-lib-5.1.tar.gz # chmod +x * # ./firmware-imx-5.3.bin --auto-accept --force # mkdir –p /lib/firmware/vpu # cp -ravf firmware-imx-5.3/firmware/* /lib/firmware/ # ./imx-vpu-5.4.32.bin --auto-accept --force # cd imx-vpu-* # make PLATFORM=IMX6Q all # make install # tar -xf imx-lib-5.1.tar.gz # cd  imx-lib-5.1/ # make -j1 PLATFORM="IMX6Q" # make PLATFORM="IMX6Q" install # cd .. # ./libfslcodec-4.0.8 --auto-accept –force # cd libfslcodec-* # ./autogent.sh --prefix=/usr --enable-fhw --enable-vpu # make # make install # mv /usr/lib/imx-mm/video-codec/* /usr/lib # mv /usr/lib/imx-mm/audio-codec/* /usr/lib # rm –rf /usr/lib/imx-mm/ # cd .. # mkdir –p gpu_pack # cd gpu_pack # wget http://www.nxp.com/lgfiles/NMG/MAD/YOCTO//imx-gpu-viv-5.0.11.p7.4-hfp.bin # wget http://www.nxp.com/lgfiles/NMG/MAD/YOCTO//xserver-xorg-video-imx-viv-5.0.11.p7.4.tar.gz # chmod +x * # ./imx-gpu-viv-5.0.11.p7.4-hfp –-auto-accept -–force # cd imx-gpu* # cp g2d/usr/include/* /usr/include/ # cp -d g2d/usr/lib/* /usr/lib/ # cp -Pr gpu-core/usr/* /usr # optional: install demos # cp -r gpu-demos/opt / # optional: install gpu tools # cp -axr gpu-tools/gmem-info/usr/bin/* /usr/bin/ # cd .. Installing gstreamer-imx, IPU, VPU and GPU support: Install build deps, gstreamer1.x, this step could take some time (~350MB): # apt-get install python pkg-config git gstreamer1.0-x gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev g++-multilib # git clone git://github.com/Freescale/gstreamer-imx.git # cd gstreamer-imx # ln –s /usr/lib/arm-linux-gnueabihf/gstreamer-1.0/ /usr/lib/gstreamer-1.0 # ./waf configure --prefix=/usr --kernel-headers=/include # ./waf # ./waf install # cd ../../ (optional) Install libimxvpuapi library: This library provides a community based open-source API to the NXP imx-vpu library (the low-level IMX6 VPU interface). # git clone git://github.com/Freescale/libimxvpuapi.git # cd libimxvpu* # ./waf configure –-prefix=/usr # ./waf # ./waf install # cd .. note './waf install' installs artifacts to its prefix + /lib/gstreamer-1.0 but they need to be installed to /usr/lib/arm-linux-gnueabihf/gstreamer-1.0 which is why we created a symlink above before installing note g2d lib required to build G2D note that x11 library is required to build EGL sink with Vivante direct textures (only needed for X11 support) note that libfslaudiocodec is required to build audio plugins Now you are ready to test gstreamer 6: Add GPU HW Acceleration for X11 NOTE: The original version of these build instructions can be found in the Gateworks wiki . Many thanks to them for writing this! IMX6 IPU, VPU, and GPU support via GStreamer and Gstreamer-imx plugins. Many of the pieces needed (firmware and source-code) are from NXP and not freely redistributable thus must be downloaded from their mirror and extracted from a shell script that forces you to read and agree to their End User License Agreement (EULA). The following instructions can be used on top of the debootstrap and should work on other sources of Ubuntu or other Linux distributions root filesystems as well You can easily add X11 support to a base image created with the debootstrap instructions above by adding a few package groups. You will need the following: X11 server - ie Xorg Display Manager - this controls the login to the X session Window Manager - manages window position, re-sizing, decorations, etc for X clients If in any case you have installed the Linaro LXDE rootfs, it includes the Xorg X11 server, the lxdm Display Manager, the openbox Window Manager, and others useful user applications including the Chromium browser, if you do not install linaro lxde and want to install it please do: this step could take some time (~650MB)   # apt-get install xinit lxde lxterminal lxappearance lxrandr lxshortcut lxinput xinit  xserver-xorg-dev mesa-utils mesa-utils-extra Notes: you will need to add a non-root user with adduser for Chromium browser to work. You may choose to set up auto-login for that user by editing /etc/lxdm/default.conf and setting the autologin property in the base section at the beginning of the config file. /etc/xdg/lubuntu/lxdm/lxdm.conf This document takes as based kernel version 3.14.52v, vivante 5.0.11p7.4 correspond to the kernel version used. you should check the BSP release notes in order to know which xserver and Vivante GPU files need to be downloaded from the NXP repos. $ sudo nano /etc/lxdm/default.conf    [base]    autologin=user To add hardware GPU acceleration to X11 you need to add some libraries and drivers provided by Freescale from the imx-gpu-viv package. This requires signing Freescales End User License Agreement (EULA). This package provides the following: libg2d - a documented low-level API to the GPU (used by things like libimxvpuapi for gstreamer-imx and the gpu-core drivers) gpu-core - provides all the various OpenGL libs (libGL, libGLESv1_CM, libGLESv1_CL, libGLESv2, libGLSLC, libCLC, libEGL, libGAL, libOpenCL, ls libOpenVG) typically provided by the mesa project. Note that several versions of libEGL/libGAL/libGLESv2/libVIVANTE are provided for different backend rendering systems: dfb, fb, wl, x11. # cd gpu_pack #cd imx-gpu-* # cp gpu-core/usr/lib/dri/vivante_dri.so /usr/lib/xorg/modules/drivers/ # chmod 644 /usr/lib/xorg/modules/drivers/vivante_dri.so # rm /usr/lib/arm-linux-gnueabihf/mesa/libGL.so* # rm /usr/lib/arm-linux-gnueabihf/mesa-egl/libEGL.so* # rm /usr/lib/arm-linux-gnueabihf/mesa-egl/libGLESv2.so* # rm /usr/lib/arm-linux-gnueabihf/mesa-egl/libOpenVG.so* # cd ../../ # cd gpu-pack # wget http://www.nxp.com/lgfiles/NMG/MAD/YOCTO//xserver-xorg-video-imx-viv-5.0.11.p7.4.tar.gz # tar –xf xserver* # cd xserver-org-video-imx* #looks lik have to made #git init # ./fastbuild.sh  BUILD_HARD_VFP=1 XSERVER_GREATER_THAN_13=1 # cd.. # cd kernel-modu* # make Switch to gpu-core x11 backend: # backend=x11 # ln -sf libEGL-${backend}.so /usr/lib/libEGL.so # ln -sf libEGL-${backend}.so /usr/lib/libEGL.so.1 # ln -sf libEGL-${backend}.so /usr/lib/libEGL.so.1.0 # ln -sf libGAL-${backend}.so /usr/lib/libGAL.so # ln -sf libGLESv2-${backend}.so /usr/lib/libGLESv2.so # ln -sf libGLESv2-${backend}.so /usr/lib/libGLESv2.so.2 # ln -sf libGLESv2-${backend}.so /usr/lib/libGLESv2.so.2.0.0 # ln -sf libVIVANTE-${backend}.so /usr/lib/libVIVANTE.so # ln -sf libGAL_egl.dri.so /usr/lib/libGAL_egl.so # for i in egl glesv1_cm glesv2 vg; do         cp /usr/lib/pkgconfig/${i}_${backend}.pc/usr/lib/pkgconfig/${i}.pc     done #rm /usr/lib/*-dfb.so /usr/lib/*-fb.so /usr/lib/*-wl.so (Optional in case you deploy your kernel version with GPU as module) make vivante kernel module (GPU kernel driver) load on boot: # echo vivante >> /etc/modules # nano /etc/udev/rules.d/10-imx.rules KERNEL=="galcore",  MODE="0660", GROUP="video" KERNEL=="mxc_asrc",  MODE="0666" Create an xorg.conf configured for the Vivante fbdev driver: # nano /etc/X11/xorg.conf Section "Device"     Identifier "i.MX Accelerated Framebuffer Device"     Driver "vivante"     Option "fbdev" "/dev/fb0"     Option "vivante_fbdev" "/dev/fb0"     Option "HWcursor" "false" EndSection Section "ServerFlags"     Option "BlankTime"  "0"     Option "StandbyTime"  "0"     Option "SuspendTime"  "0"     Option "OffTime"  "0" EndSection # cd .. Make sure the files copied into the correct places. If all compiled and copied, you should now see a bunch of new libraries in /usr/lib! Congratulations! After you finish you can reboot your system and start playing. Testing Gstreamer examples: show gstreamer-imx plugins: # gst-inspect-1.0 | grep imx imxvpu:  imxvpuenc_mjpeg: Freescale VPU motion JPEG video encoder imxvpu:  imxvpuenc_mpeg4: Freescale VPU MPEG-4 video encoder imxvpu:  imxvpuenc_h264: Freescale VPU h.264 video encoder imxvpu:  imxvpuenc_h263: Freescale VPU h.263 video encoder imxvpu:  imxvpudec: Freescale VPU video decoder imxv4l2videosrc:  imxv4l2videosrc: V4L2 CSI Video Source imxg2d:  imxg2dcompositor: Freescale G2D video compositor imxg2d:  imxg2dvideotransform: Freescale G2D video transform imxg2d:  imxg2dvideosink: Freescale G2D video sink imxipu:  imxipucompositor: Freescale IPU video compositor imxipu:  imxipuvideosink: Freescale IPU video sink imxipu:  imxipuvideotransform: Freescale IPU video transform imxpxp:  imxpxpvideotransform: Freescale PxP video transform imxpxp:  imxpxpvideosink: Freescale PxP video sink imxipuvideosink: # gst-launch-1.0 videotestsrc ! imxipuvideosink imxg2dvideosink: # gst-launch-1.0 videotestsrc ! imxg2dvideosink The imxeglvivsink allows hardware accelerated display to a window on the X11 host # export DISPLAY=:0.0 # gst-launch-1.0 videotestsrc ! imxeglvivsink To test if you have graphics support you can run any glmark2 and/or mesa-utils or can run example of the next route: # cd /opt/viv_samples/vdk/ # ./tutorial1                                                                      //any example root@imx6Q:~# glxgears -info GL_RENDERER   = Vivante GC2000 GL_VERSION    = 2.1 2.0.1 GL_VENDOR     = Vivante Corporation GL_EXTENSIONS = WGL_ARB_extensions_string WGL_EXT_extensions_string WGL_EXT_swap_control GL_EXT_texture_env_add GL_ARB_multitexture GL_ARB_multisample GL_ARB_texture_env_add GL_ARB_texture_compression GL_ARB_texture_env_combine GL_ARB_depth_texture GL_ARB_window_pos …. 1606 frames in 5.0 seconds = 321.130 FPS 1650 frames in 5.0 seconds = 329.834 FPS L_RENDERER   = Vivante GC2000 GL_VERSION    = 2.1 2.0.1 GL_VENDOR     = Vivante Corporation1629 frames in 5.0 seconds = 325.644 FPS 1621 frames in 5.0 seconds = 324.072 FPS 1650 frames in 5.0 seconds = 329.806 FPS 1651 frames in 5.0 seconds = 330.079 FPS
View full article
For more information verify the U-Boot User Manual[1].   First all configure your board IP, your host IP and the gateway IP:   => setenv ipaddr 10.29.244.91   => setenv serverip 10.29.244.27   => setenv gatewayip 10.29.244.27 You don't need to set the gatewayip when using cross'cable! Save this configuration to flash: => saveenv   Download the file to board RAM: => tftp 0x80000000 zImage   Where:   400000 is the memory position where the file will be placed;   zImage is the file that will be downloaded from TFTP server.  
View full article
How to load the camera driver modprobe ov3640_camera modprobe mxc_v4l2_capture How to encode audio gst-launch alsasrc ! mfw_mp3encoder ! filesink location= audio.mp3 Encoding an AVI audio only gst-launch alsasrc ! mfw_mp3encoder ! avimux ! filesink location=audio.avi You can use audiotestsrc instead of alsasrc Encoding Audio and Video (testsrc only) Raw video and Raw audio gst-launch videotestsrc num-buffers=250 ! 'video/x-raw-yuv,format=fourcc)I420,width=320,height=240,framerate=(fraction)25/1' ! queue ! mux. audiotestsrc num-buffers=440 ! audioconvert ! 'audio/x-raw-int,rate=44100,channels=2' ! queue ! mux. avimux name=mux ! filesink location=test.avi H.263 video and Raw audio gst-launch videotestsrc num-buffers=250 ! mfw_vpuencoder codec-type=1 ! queue ! mux. audiotestsrc num-buffers=440 ! audioconvert ! 'audio/x-raw-int,rate=44100,channels=2' ! queue ! mux. avimux name=mux ! filesink location=test.avi H.263 video and MP3 audio gst-launch videotestsrc num-buffers=250 ! mfw_vpuencoder codec-type=1 ! queue ! mux. audiotestsrc num-buffers=440 ! audioconvert ! mfw_mp3encoder ! queue ! mux. avimux name=mux ! filesink location=test.avi Real Source gst-launch-0.10 mfw_v4lsrc capture-mode=5 num-buffers=300 capture-width=320 capture-height=240 fps-n=15 blocksize=115200 ! queue2 max-size-buffers=1000 max-size-bytes=0 max-size-time=0 ! mfw_vpuencoder framerate=15 codec-type=2 name=venc  alsasrc num-buffers=300 ! audio/x-raw-int,rate=32000,channels=1,depth=16 ! audioconvert ! queue2 max-size-buffers=1000 max-size-bytes=0 max-size-time=0 ! mfw_mp3encoder name=aenc avimux name=mux ! filesink location=all_in_one.avi aenc. ! mux. venc. ! mux. The movie isn't that good, but you can improve that increasing num-buffers, width and heigh, and even framerate! STAMP If you face synchronization issues, you can try to use a non-standard plugin called stamp. Use the spec file gst-entrans.spec and this command line: gst-launch-0.10 mfw_v4lsrc capture-mode=5 num-buffers=160 capture-width=320 capture-height=240 fps-n=15 blocksize=115200 !  stamp sync-margin=1 sync-interval=1 ! queue2 max-size-buffers=1000 max-size-bytes=0 max-size-time=0  !  mfw_vpuencoder framerate=15 codec-type=2 name=venc  alsasrc num-buffers=160  !  audio/x-raw-int,rate=32000,channels=1,depth=16     !  audioconvert ! queue2 max-size-buffers=1000 max-size-bytes=0 max-size-time=0      !  mfw_mp3encoder name=aenc avimux name=mux ! filesink location=test_ALL.avi aenc. ! mux. venc. ! mux. Donwload the package from here: http://gentrans.sourceforge.net/ (source for stamp topic: http://blog.buberel.org/2008/03/using-a-usb-web.html)
View full article
LTIB Creating Uimage Uboot Configuration file for fw_(printenv/saveenv) utility Add new i.MX5x board on LTIB LTIB Creating Uimage Uboot U-boot expects uImage format for the kernel image. In order to LTIB generate a uImage file: $ export SYSCFG_KTARG=uImage $ ./ltib -p kernel Setup in U-Boot the kernel bootargs: u-boot> setenv bootargs noinitrd console=ttymxc0,115200 init=/linuxrc root=/dev/nfs nfsroot=10.29.244.27:/tftpboot/rootfs ip=dhcp Change 10.29.244.27 to your host IP. The procedure above is needed when default bootloader used by ltib was redboot. In some ltib releases (before 2010) default bootloader is u-boot. In this case, ltib will create uImage by default Configuration file for fw_(printenv/saveenv) utility # Configuration file for fw_(printenv/saveenv) utility. # Up to two entries are valid, in this case the redundant # environment sector is assumed present. # Notice, that the "Number of sectors" is ignored on NOR.               # MTD device name Device offset Env. size Flash sector size Number of sectors #/dev/mtd1 0x0000 0x4000 0x4000 #/dev/mtd2 0x0000 0x4000 0x4000 # NAND example /dev/mtd0 0x80000 0x40000 0x20000 2 Add new i.MX5x board on LTIB After porting u-boot to your i.MX5x board you might want add it on LTIB menu, "Choose your board for u-boot" section. For this, edit ltib/config/platform/imx/main.lkc to add your board: Enter board on menu: comment "Choose your board for u-boot" choice prompt "board" default BOARD_MX51_BBG depends on PLATFORM = "imx51" help This menu will let you choose the board you use. ... + config BOARD_MX53_MYBOARD + bool "mx53_myboard" ... endchoice Add the "mx53_myboard_config" that matches your board configuration on the u-boot Makefile to PKG_U_BOOT_CONFIG_TYPE: config PKG_U_BOOT_CONFIG_TYPE   string   ... + default "mx53_myboard_config" if ( PLATFORM = "imx51" && BOARD_MX53_MYBOARD && !PKG_KERNEL_UPDATER )   ...
View full article
This patch implements (or exposes) routines to poll the imx uarts. The KGDB drivers need these methods to be implemented or the ttymxc driver is not sufficient. The synthetic CONFIG_CONSOLE_POLL value activates these routines (or CONFIG_SERIAL_MXC_CONSOLE for the polled write). There is still no poll routines in -855-ge067785, which is the September 2010 Linux release from Freescale. Also not in Linux 2.6.36 drivers/serial/imx.c either. $ git diff drivers/serial/mxc_uart.c diff --git a/drivers/serial/mxc_uart.c b/drivers/serial/mxc_uart.c index ae6d2e1..728b607 100644 --- a/drivers/serial/mxc_uart.c +++ b/drivers/serial/mxc_uart.c @@ -1551,6 +1551,28 @@ mxcuart_pm(struct uart_port *port, unsigned int state, unsigned int oldstate)                             clk_enable(umxc->clk);    }  +#ifdef CONFIG_CONSOLE_POLL +/* + * Read a character from the UART. + */ +static inline int mxcuart_console_read_char(struct uart_port *port) +{ +       volatile unsigned int status; +    int ch; + +       do { +               status = readl(port->membase + MXC_UARTUSR2); +       } while ((status & MXC_UARTUSR2_RDR) == 0); +       ch = readl(port->membase + MXC_UARTURXD); +/* Ignore parity errors, etc. */ +/*  status = ch | UART_CREAD_BIT; */ +    ch &= 0xff; + +    return ch; +} +static void mxcuart_console_write_char(struct uart_port *port, char ch); +#endif +    /*!     * This structure contains the pointers to the control functions that are     * invoked by the core serial driver to access the UART hardware. The @@ -1575,14 +1597,18 @@ static struct uart_ops mxc_ops = {                 .config_port = mxcuart_config_port,                 .verify_port = mxcuart_verify_port,                 .send_xchar = mxcuart_send_xchar, +#ifdef CONFIG_CONSOLE_POLL +              .poll_put_char = mxcuart_console_write_char, +              .poll_get_char = mxcuart_console_read_char, +#endif };  -#ifdef CONFIG_SERIAL_MXC_CONSOLE +#if defined(CONFIG_SERIAL_MXC_CONSOLE) || defined (CONFIG_CONSOLE_POLL)     /*     * Write out a character once the UART is ready     */ -static inline void mxcuart_console_write_char(struct uart_port *port, char ch) +static void mxcuart_console_write_char(struct uart_port *port, char ch)    {            volatile unsigned int status;  @@ -1592,6 +1618,10 @@ static inline void mxcuart_console_write_char(struct uart_port *port, char ch)                writel(ch, port->membase + MXC_UARTUTXD);     }  +#endif + +#ifdef CONFIG_SERIAL_MXC_CONSOLE +    /*!     * This function is called to write the console messages through the UART port.     *
View full article
The i.MX6SX series of applications processors are powered by two asymmetrical cores: one ARM Cortex-A9 and one Cortex-M4. It allows the coexistence of real-time and non-real-time applications on the same processor (M4 core running an RTOS, and A9 core running Linux or Android). This document will explain how to compile and download a customized MQX application to the QSPI Flash of the IMX6SX-SDB board using a Ubuntu host. The example application will be connecting a 16x2 LCD to GPIO pins of the i.MX6SX. As the IMX6SX-SDB board doesn’t have GPIO header, we will use the pins from SD3 socket, so, it will be required to add the proper pin definitions to the MQX BSP. First of all, the Yocto image will be used as base to boot the A9 core (BSP L3.14.28_1.0.0), because it is the main core and the M4 core will be held on reset until the A9 removes the reset from it. The Yocto image includes many device tree files on the FAT partition, and the default DTB doesn’t consider the existence of the M4 core (only required when Linux applications would consider the M4 core as a resource), so, for changing the DTB file, launch the following command on U-Boot: => setenv fdt_file imx6sx-sdb-m4.dtb We are going to download and uncompress MQX 4.1 for i.MX6SX (Linux hosted) from the following link: http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MQX In this example, GCC compiler for ARM will be used, so, download and uncompress gcc-arm-none-eabi-4_8-2014q1 from the link below: https://launchpad.net/gcc-arm-embedded/+download Additional Linux commands consider that MQX and GCC were uncompressed on /home/user folder. In order to avoid compiler error, it will be required to set a couple of environments variables: $ export TOOLCHAIN_ROOTDIR=/home/user/gcc-arm-none-eabi-4_8-2014q1 $ export PATH=$PATH:/home/user/gcc-arm-none-eabi-4_8-2014q1/bin/ Before building any MQX example applications, it is required to build MQX libraries (included BSP and PSP), so, navigate to the next folders and launch the build script in each of them: $ cd /home/user/ Freescale_MQX_4.1.0_i.MX_6SoloX /mqx/build/make/bsp_imx6sx_sdb_m4/ $ ./build_gcc_arm.sh $ cd /home/user/ Freescale_MQX_4.1.0_i.MX_6SoloX /mqx/build/make/psp_imx6sx_sdb_m4/ $ ./build_gcc_arm.sh Now we can compile the example applications like the GPIO demo (that will be used as base for our customized application): /home/user/Freescale_MQX_4.1.0_i.MX_6SoloX/mqx/examples/gpio/ Our example application will configure the 6 pins of the SD3 socket (LWGPIO_PIN_SD3_DATA0, LWGPIO_PIN_SD3_DATA1, LWGPIO_PIN_SD3_DATA2, LWGPIO_PIN_SD3_DATA3, LWGPIO_PIN_SD3_CMD, LWGPIO_PIN_SD3_CLK) for using them by the M4 core on MQX; so, it will be required to add the proper definitions on the board’s header file for each pin (in this case, “imx6sx_sdb_m4.h”). The following corresponds to the LWGPIO_PIN_SD3_DATA0 pin (we are naming them as “SD2GPIO0 – SD2GPIO5”): #define BSP_SD2GPIO0_PROMPT         "SD2GPIO0" #define BSP_SD2GPIO0                (LWGPIO_PIN_SD3_DATA0) #define BSP_SD2GPIO0_MUX_GPIO       (LWGPIO_MUX_SD3_DATA0_GPIO) #define BSP_SD2GPIO0_MUX_IRQ        (LWGPIO_MUX_SD3_DATA0_GPIO) As this file is part of the BSP, it will be required to recompile the BSP after applying these modifications. The modified header file could be found on the attachments of this document. Now, we are going to copy the entire folder of the “gpio” example to the same location, and we will rename it as “sd2gpio”. Inside such folder, we should also rename the “gpio.c” file to “sd2gpio.c”. Besides, it is required to edit the “Makefile” file in order to redirect the included paths to the new folder. It is basically done on the following two lines: NAME = sd2gpio SOURCES += $(MQX_ROOTDIR)/mqx/examples/sd2gpio/sd2gpio.c The modified “Makefile” file is also available on the attachments. The “sd2gpio.c” file includes the main MQX task that will initialize the LWGPIOs using the definitions declared on the board’s header file. It also includes the functions used by the 16x2 LCD driver. This file is also included on the attachments of this thread. With all the modifications done and the BSP recompiled, we can now compile our customized application by launching the command: $ ./build_gcc_arm.sh Located on the following path: /home/user/Freescale_MQX_4.1.0_i.MX_6SoloX/mqx/examples/gpio/build/make/ gpio_imx6sx_sdb_m4/ The output file (an ELF file) will be located at the following path: /home/user/Freescale_MQX_4.1.0_i.MX_6SoloX/mqx/examples/gpio/build/make/ gpio_imx6sx_sdb_m4/cd gcc_arm/extflash_debug/ Now, we are going to move to this folder, and launching the following command to convert the ELF file to a BIN file. It is required because we will flash the QSPI Flash using the A9 core, and the symbols data of the ELF file is not required (actually, the flashing applications looks for “m4_qspi.bin” file): $ arm-none-eabi-objcopy -O binary sd2gpio_imx6sx_sdb_m4.elf m4_qspi.bin Next, copy the BIN file to the FAT partition of the SD card (considering it is mounted over /media/ 😞 $ cp m4_qspi.bin /media/Boot\ imx6sx/ && sync Now we will place the SD card on the SDB board and boot it. Stop the boot process on U-Boot and launch the following command for flashing the QSPI Flash from the BIN file: => run update_m4_from_sd Finally, start the MQX application by releasing the reset of the M4 by launching the following command: => run m4boot The figure below shows the LCD with the application working: Additional tests: If you want to run the M4 application out of reset you could modify the environment variable ‘bootcmd’. For displaying the default variable value, launch the following command: => printenv bootcmd So, for just removing the reset from M4 core without booting Linux, launch the command below: => setenv bootcmd=‘run m4boot’ If you want to avoid the count-down delay (for a faster boot), you could try the following command: => setenv bootdelay 0 Finally, if Linux is also boots after the M4, it will change some clock settings, and also mounts the SD3 driver, so, the pin configurations will be overrode. In order to avoid clock issues on the M4, add to boot parameters ‘uart_from_osc' like command below: => setenv mmcargs 'setenv bootargs no_console_suspend clk_ignore_unused uart_from_osc console=${console},${baudrate} root=${mmcroot}' Don’t forget to save the environment after changing environments variables and then, reboot: => saveenv
View full article
Video in Host Side Converting images (png, jpg, etc) to YUV format ffmpeg -f image2 -i test.png -pix_fmt yuv420p test.yuv Converting AVI files to YUV format To convert AVI to YUV you can use the lav2yuv program. In Ubuntu Linux this program is in mjpegtools package. This is the way to convert: lav2yuv myfile.avi > myfile.yuv Converting YUV video files to AVI (DivX) Use the ffmpeg tool: ffmpeg -s 176x144 -i kuuba_maisema_25fps_qcif.yuv -vcodec mpeg4 -sameq -aspect 4:3 ~/kuuba.avi You need to specify the video dimensions (176 × 144), the video codec (mpeg4), and the aspect ratio (4:3). Converting MP4 to AVI Use the mencoder tool: mencoder Bike1.mp4 -ovc lavc -oac lavc -o NewBike1.avi
View full article
Building Linux Kernel Building Linux Kernel Building Using LTIB Building Outside LTIB Downloading and installing GNU Toolchain and git Building Kernel from Freescale git repository Building Kernel Mainline About Linux Building Using LTIB Linux kernel can be easily built using Ltib. On Ltib menu, just select: [*] Configure the Kernel When you exit this menu, Ltib will show the Kernel Menuconfig as below: This is the Kernel Menuconfig, where it's possible to configure kernel options and drivers. After exit this menu, kernel will be built and stored at: <Ltib directory>/rootfs/boot Building Outside LTIB Downloading and installing GNU Toolchain and git When you install LTIB, a GNU toolchain is automatically installed on /opt/freescale/usr/local/ Kernel releases newer than 2.6.34 doesn't build on Toolchain 4.1.2, only on 4.4.1 or later Check on your host at /opt/freescale/usr/local/ the current installed Toolchain. Next step is to install GIT on host. For Ubuntu machines, use: sudo apt-get install git-core Building Kernel from Freescale git repository Freescale provides access to their own git kernel repository and can be viewed at: Freescale Public GIT To download the kernel source code, create a new folder and use the command: git clone git://git.freescale.com/imx/linux-2.6-imx.git OR git clone http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git After some minutes, a folder called linux-2.6-imx will be created containing the Linux kernel Create a local git branch from a remote branch you want to use. Let's use branch origin/imx_3.0.15 as example: cd linux-2.6-imx git checkout -b localbranch origin/imx_3.0.15 To check all available remote branches, use: git branch -r Export the cross compiler, architecture and the toolchain path: export ARCH=arm export CROSS_COMPILE=arm-none-linux-gnueabi- If using Toolchain 4.1.2: export PATH="$PATH:/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/" OR If using Toolchain 4.4.4: export PATH="$PATH:/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/" Copy the config file for the wanted platform on linux folder as example: cp arch/arm/configs/imx6_defconfig .config All platform config files are located at <linux directory>/arch/arm/configs/ Call menuconfig and change configuration (if needed) make menuconfig Now it's ready to be built: make uImage The zImage and uImage will be located at /arch/arm/boot/ folder. Building Kernel Mainline Mainline Kernel can be viewed on this link: https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git To download the kernel source code, create a new folder and use the command: git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git OR git clone http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git OR git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git After some minutes, a folder called linux will be created containing the Linux kernel Create a local git branch from a remote branch you want to use. Let's use branch origin/linux-3.8.y as example: cd linux git checkout -b localbranch origin/linux-3.8.y To check all available remote branches, use: git branch -r Export the cross compiler, architecture and the toolchain path: export ARCH=arm export CROSS_COMPILE=arm-none-linux-gnueabi- If using Toolchain 4.4.4: export PATH="$PATH:/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/" Configure to the platform you want to build kernel. For i.MX family, use imx_v6_v7_defconfig: make imx_v6_v7_defconfig All platform config files are located at <linux directory>/arch/arm/configs/ Call menuconfig and change configuration (only if needed, this is an optional step!) make menuconfig Now it's ready to be built: make -j4 uImage LOADADDR=0x70008000 - Use -j4 option to speed up your build in case or PC has 4 cores. It's optional. - IMPORTANT: Use the correct address for each processor. You can check the correct address value at linux/arch/arm/mach-imx/Makefile.boot. After build the uImage, build the dtb file (device tree binary). For i.MX53 QSB use: make imx53-qsb.dtb The uImage will be located at: linux/arch/arm/boot/ folder and dtb binary will be located at: linux/arch/arm/boot/dts About Linux For general Linux information, see About Linux
View full article
After Nokia acquisition of Trolltech, QT has become an even more interesting framework/tool for UI and graphics development. The new release 4.6 can be obtained under LGPL license and comes with a new integrated IDE for software development (QT Creator) with many demos, some of them using OpenGL. In order to create an environment to create, simulate and cross-compile, it's needed to build three versions of QT: Qt/X11, qmake-x11. This is the Qt version that you will be using on your PC. It is also used for building the tools, such as Designer and Linguist. Qt/QVFb, qmake-qvfb. This is an embedded Qt configuration that runs on host, but works with the virtual framebuffer instead of the actual screen. It let’s you emulate the target system, but run your code on your host machine. Qt/target, qmake-target. This is the embedded Qt configuration that runs on your target platform. This is what you use to build an actual application running on your embedded device. On Host you need TO install following package (for Ubuntu distri) to install this QT toolsuit: [X] libx11-dev [X] libpng-dev [X] libjpeg-dev [X] libxext-dev [X] x11proto-xext-dev [X] qt3-dev-tools-embedded [X] libxtst-dev Building Qt/X11 Extract downloaded Qt package (from here) and install it by running: ./configure make sudo make install Qt will be installed on /usr/local/Trolltech/Qt-version directory. We also need to build qvfb tool that will provide virtual framebuffer for X11. To build and install it run: cd tools/qvfb make sudo make install qvfb will be installed on /usr/local/Trolltech/Qt-version/bin directory. Building Qt/QVFb To build Qt/QVFb, will be needed some parameters on configure file. Extract again Qt package on other folder and build as following: ./configure -embedded -qt-gfx-qvfb -qt-kbd-qvfb -qt-mouse-qvfb -prefix /usr/local/Trolltech/Qt-qvfb-version make sudo make install Used parameters: -qt-gfx-qvfb, the graphics driver will be for QVFb, i.e., the virtual framebuffer. -qt-kbd-qvfb, the keyboard input will come from the QVFb. -qt-mouse-qvfb, the mouse input will come from the QVFb. -prefix /usr/local/Trolltech/Qt-qvfb-version, the prefix is used to separate the QVFb version of embedded Qt from the target version. Testing QVFb So far you have two versions of Qt: 1. Qt/X11 built for PC host using X11 and located at /usr/local/Trolltech/Qt-version 2. Qt/QVFb built for PC host using Qt virtual framebuffer and located at /usr/local/Trolltech/Qt-qvfb-version Call qvfb from X11 version cd /usr/local/Trolltech/Qt-version/bin ./qvfb & A simple virtual framebuffer will open. To change screen configuration and add a skin, click in "file -> configure". The following window will open: i.e., choose ClamshellPhone and click ok. A cell phone skin will open. On QVFb version, there are a lot of example applications that can be run using Qt virtual framebuffer. Let's open fluidlauncher demo: cd /usr/local/Trolltech/Qt-qvfb-version/demos/embedded/fluidlauncher ./fluidlauncher -qws The argument -qws is used to inform that the application will run on Qt virtual framebuffer. Building Qt/Target To build Qt for target (i.MX), it's necessary to build Ltib with some required packages. In this example, a kernel and rootfs will be built for i.MX51 EVK with the following extra packages. [x] amd-gpu-bin-mx51 [x] freetype [x] glib2 [x] gstreamer [x] gstreamer-plugins-base [x] gstreamer-plugins-good [x] gstreamer-plugins-bad [x] gstreamer-plugins-ugly [x] libxml2 [x] tslib [x] zlib If you are building for any other i.MX processor, you don't need the "amd-gpu-bin-mx51" option. After build ltib, make a symbolic link /tftpboot/ltib pointing to your rootfs folder. It's needed to make the i.MX libs and incs available to qmake. ln -s <rootfs folder dir> /tftpboot/ltib Restart nfs server. If using Ubuntu, the command is: sudo /etc/init.d/nfs-kernel-server restart Extract downloaded Qt package on a new folder. Export the crosscompiler path. Usually it's located at /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin: export PATH=$PATH:/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin If you are building Qt for i.MX51 Download the mkspec package and extract the folder linux-mxc-g++ under <Qt source code folder>/mkspecs/qws Configure, build and install with the following commands: ./configure -embedded arm -xplatform qws/linux-mxc-g++ -release -prefix /usr/local/Trolltech/Qt-target-version -qt-gfx-linuxfb -qt-kbd-tty -qt-mouse-tslib -opengl es2 -little-endian -host-little-endian make sudo make install For targets without 3D engine support If you are building Qt for a target that doesn't support OpenGL, i.e., i.MX25, 233: Download the makespecs_no3D package and extract the folder linux-mxc-g++ under <Qt source code folder>/mkspecs/qws Configure, build and install with the following commands: ./configure -embedded arm -xplatform qws/linux-mxc-g++ -release -prefix /usr/local/Trolltech/Qt-target-version -qt-gfx-linuxfb -qt-kbd-tty -qt-mouse-tslib -little-endian -host-little-endian make sudo make install Copy Cross Qt to target's RFS The crosscompiled version of Qt will be located on your host machine as indicated on -prefix, in this case /usr/local/Trolltech/Qt-target-version Copy Qt-target-version folder to rootfs: cd /tftpboot/usr/local mkdir Trolltech cd Trolltech cp -a /usr/local/Trolltech/Qt-target-version . Now it's ready to use. On target, run: /usr/local/Trolltech/Qt-qvfb-version/demos/embedded/fluidlauncher/fluidlauncher -qws See some pictures of the same application running on host and on EVK: Tips 1. To clean all Qt configuration settings: make confclean 2. To check the current configuration: On Qt source code folder, you can open the file config.status to check the current configuration settings.
View full article
This tutorial teaches how to flash bootloader using ATK. ATK (Advanced Toolkit) ATK (Advanced Toolkit) is a Windows software for programming the flash memory of i.MX boards. Using ATK This section will describe the procedure to erase the flash memory and program the bootloader. 1 - Connect a serial cable between PC and i.MX board. 2 - Some hardware configurations (switches) must be done to flash the board.    Set S18 switch as below: Switch S18 -> 111100 3 - Run ATK by clicking Start -> Programs -> AdvancedToolKit -> AdvancedToolKit      Set the options:    Device memory -> DDR; Custom Initial File -> (keep it unmarked)    Communication Channel -> Serial Port (Usually COM1) 4 - Click Flash Tools to erase, program or dump the the flash memory and click GO Flash Programming The next step is to program the bootloader image into the board's Flash following the steps below. 1 - Select the parameters as shown in the figure below and press Program.    The bootloader binary image file can be found into your Board Support PackageSet Program, NOR Spansion, Bi Swap 2 - Add it on Image File field and press Program. 3 - Close ATK, turn off the board and set switch back as shown in the picture below. Installing ATK on Linux Download ATK: Download. Extract ATK: # unzip ATK_1_41_STD_installer.zip Execute the default install process: # wine SETUP.EXE Get mfc42.dll and msvcp60.dll from a Windows Machine (C:\Windows\System32) and copy to wine system32 (/root/.wine/drive_c/windows/system32) Run ATK: # wine ADSToolkit_std.exe
View full article
INTRODUCTION REQUIREMENTS KERNEL DRIVER DEVICE NODE NFC LIBRARY TESTING NFC READER REFERENCES 1. INTRODUCTION This document is a step by step guide of the AN11697 PN7120 Linux Software Stack Integration Guidelines application note that can be downloaded from http://www.nxp.com/documents/application_note/AN11697.pdf . It explains how to add the PN7120 driver and NFC libraries to a Linux OS running in the i.MX6Q. 2. REQUIREMENTS The board used in this document is the Udoo Board thanks to the easy pin access. More information about this board can be found at Ultimate Single Board Mini PC for Android and Linux - UDOO A modified FSL L3.14.28 BSP. The modifications can be found in these 2 documents Basic Device Tree for the Udoo Board and  U-Boot Migration Example . If you have followed the previous documents, you already have a working yocto image and toolchain (meta-toolchain), if not you must follow this awesome training first Yocto Training - HOME . The OM5577/PN7120S demonstration kit. You can find more details of this board at http://www.nxp.com/documents/user_manual/UM10878.pdf 3. KERNEL DRIVER According to the AN11697.pdf we must follow the below steps: From the Linux source directory: $ cd drivers/misc $ git clone https://github.com/NXPNFCLinux/nxp-pn5xx.git Add the below line in the Makefile of the current directory obj-y += nxp-pn5xx/ Include the driver config in the drivers/misc/Kconfig file source "drivers/misc/nxp-pn5xx/Kconfig" Export the environment variables $ source source /opt/poky/1.7/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi $ export ARCH=arm $ export CROSS_COMPILE=$TARGET_PREFIX $ make imx_v7_defconfig Using menuconfig include the driver as module (<M>).  Compile the modules and install the .ko files into the target rootfs. $ make  modules You can send the .ko files with scp $ make  INSTALL_MOD_PATH=~/Desktop/modules modules_install $ cd ~/Desktop/modules $ sudo scp -r lib/modules/3.14.28+g91cf351/kernel root@<board_ip>:/lib/modules/3.14.28+g91cf351/ 4. DEVICE NODE The PN7120 interfaces with an MCU or MPU via I2C interface, therefore the device must be described into a i2c node. The signals used in the PN7120 are shown below: As you can see besides power, ground and I2C lines, an IRQ and Reset pins are needed. These pins must be configured as GPIO and one must generate an interrupt to the iMX6Q. The chosen connection is shown below: To achieve the above configuration, the device tree must be changed. The changes consist on adding a device node in the corresponding I2C bus, describing the PN7120. &i2c1 {         clock-frequency = <100000>;         pinctrl-names = "default";         pinctrl-0 = <&pinctrl_i2c1>;         status = "okay";         pn547: pn547@28 {                 compatible = "nxp,pn547";                 reg = <0x28>;                 clock-frequency = <400000>;                 interrupt-parent = <&gpio6>;                 interrupt-gpios = <&gpio6 2 0>;                 enable-gpios = <&gpio5 22 0>;         }; }; The pinctrl_i2c1 phandle contains the I2C pins configuration. Make sure that the PADs connected to the PN7120 are not used in other device node. &iomuxc {         imx6q-udoo {                       ...                 pinctrl_i2c1: i2c1grp {                         fsl,pins = <                         MX6QDL_PAD_GPIO_5__I2C3_SCL             0x4001b8b1                         MX6QDL_PAD_GPIO_6__I2C3_SDA             0x4001b8b1                         >;                 };         }; }; After this you can generate the dtb file and send it with scp make dtbs sudo scp arch/arm/boot/dts/imx6q-udoo.dtb root@<board_ip>:/run/media/mmcblk0p1/imx6q-udoo.dtb NOTE: Attached you can find the complete dts and dtsi files used in this document. 5. NFC LIBRARY     To work with the PN7120 in Linux the libnfc-nci stack is needed. You can find more details in http://www.nxp.com/documents/application_note/AN11697.pdf​ . This sections explains how to cross-compile the libray and install the required files in the target (The below steps must be performed in the host). Get the library $  git clone https://github.com/NXPNFCLinux/linux_libnfc-nci.git Generate the configuration script $ ./bootstrap Mount the target rootfs to /mnt in the host. $ sudo mount /dev/sdX2 /mnt Generate the Makefile $ ./configure --host=arm-none-linux --prefix=/opt/poky/1.7/sysroots/x86_64-pokysdk-linux/usr --sysconfdir=/mnt/etc Build and install the source code $ make $ make install After a succesful bulding the libraries and a application demo are built in .libs directory. Copy the libaries to /usr/lib directory of the target and nfcDemoApp to /usr/sbin $ cd linux_libnfc-nci/.libs $ sudo cp * /mnt/usr/lib/ 6. TESTING NFC READER     To test the application you have to follow the below steps on the target: Install the .ko file $ insmod /lib/modules/3.14.28+g91cf351/kernel/drivers/misc/nxp-pn5xx/pn5xx_i2c.ko Run the nfcDemoApp $  nfcDemoApp poll You should get a console output like the shown below when placing a NFC tag next to the NFC reader. 7. REFERENCES     Integrating NFC Controller library with KSDK http://www.nxp.com/documents/application_note/AN11697.pdf http://www.nxp.com/documents/user_manual/UM10878.pdf
View full article
If you already followed the i.MX31ADS Compiling Uboot steps or got a compiled U-boot image, copy u-boot.bin to /tftpboot: $ cp u-boot.bin /tftpboot If you have RedBoot on your board follow the "Installing RedBoot using U-Boot", but if you already have been installed U-Boot and are just installing a new version jump to "Installing U-Boot using U-Boot". Installing U-Boot using RedBoot Load the U-boot image to board RAM: RedBoot> load -v -r -b 0x100000 /tftpboot/u-boot.bin -h 10.29.244.27 Where: 0x100000 is the memory position where the firmware image will be downloaded; 10.29.244.27 is your host IP which is running the TFTP server. Erase the Flash: RedBoot> fis erase -f 0xA0000000 -l 0x00040000 To make sure about what area you should erase, perform the fis list command and compare the areas Write the image to Flash: RedBoot> fis write -f 0xA0000000 -b 0x100000 -l 0x00040000 Reset the board: RedBoot> reset You should see something like this: U-Boot 1.3.3 (May 26 2008 - 11:19:43) CPU: Freescale i.MX31 at 531 MHz Board: MX31ADS DRAM: 128 MB Flash: 32 MB In: serial Out: serial Err: serial Hit any key to stop autoboot: 0 => Installing U-Boot using U-Boot First upload the U-Boot firmware using Network (Transferring file over network ) or Serial (Transferring File Over Serial) This is a common serial transfer output: => loady ## Ready for binary (ymodem) download to 0x80800000 at 115200 bps... CCmode, 1359(SOH)/0(STX)/0(CAN) packets, 9 retries ## Total Size = 0x0002a388 = 172936 Bytes Unprotect the bootloader flash area: protect off A0000000 A003FFFF Erase the flash blocks: erase A0000000 A003FFFF Copy from RAM to Flash: If firmware has been thansfered over serial: cp.b 80800000 A0000000 2a388 If firmware has been transfered over tftp: cp.b 100000 A0000000 2a388 Installing U-Boot using OpenOCD JTAG/GDB To do that you need to compile U-Boot with this define: #define CONFIG_SKIP_LOWLEVEL_INIT 1 Then enter in GDB and execute: (arm-gdb) restore u-boot.bin binary 0x87f00000 Restoring binary file u-boot.bin into memory (0x87f00000 to 0x87f2c790) (arm-gdb) set $pc = 0x87f00000 (arm-gdb) c You will see U-Boot starting in the serial console. Then compile a new U-Boot without the CONFIG_SKIP_LOWLEVEL_INIT and follow the Installing U-Boot using U-Boot to install U-Boot in the flash. Installing U-Boot using LogicLoader losh> ifconfig sm0 dhcp losh> load raw 0x81000000 115764 /tftp/10.29.244.27:u-boot.bin.lite losh> exec 0x81000000 -
View full article
U-boot expects uImage format for the kernel image. In order for LTIB to generate a uImage file: $ export SYSCFG_KTARG=uImage $ ./ltib -p kernel Setup in U-Boot the kernel bootargs: u-boot> setenv bootargs noinitrd console=ttymxc0,115200 init=/linuxrc root=/dev/nfs nfsroot=10.29.244.27:/tftpboot/rootfs ip=dhcp Change 10.29.244.27 to your host IP. The procedure above is needed when default bootloader used by ltib was redboot. In some ltib releases (before 2010) default bootloader is u-boot. In this case, ltib will create uImage by default
View full article
You can power on/off i.MX31 PDK LEDs using U-Boot: u-boot> mw.b B6020000 FF Where B6020000 is the CPLD LED address and FF is the 8 bits hexadecimal value which will be displayed on LEDs.
View full article
Changing Freescale's BSP U-boot using LTIB This quick recipe demonstrates how to compile U-boot using Freescale BSP. 0. After installing i.MX51 BSP: 1. Extract u-boot source: ./ltib -m prep -p u-boot 2. (optional) If you wish to apply changes to the code, the source is located at: <ltib path>/rpm/BUILD/u-boot-2009.08 3. Compile u-boot for the i.MX51 EVK ./ltib -m scbuilb -p u-boot 4. Copy the compiled file to a SD card on your host machine, insert the SD card and: $ sudo dd if=rpm/BUILD/u-boot-2009.08/u-boot.bin of=/dev/mmcblk0 bs=512 /dev/mmcblk0 should replaced according to your host, use "dmesg" after inserting the SD to find out where is the SD on your host. Unmount it before issuing the dd command.   5. Insert the SD on the i.MX 51 EVK, set the switches for SD Card boot and power on the board.
View full article
Introduction The "smart" package management system is available in  Yocto Project for managing  packages on a target machine. A host is configured as a server for the packages and on the target the "package-management" feature is enabled for working with the packages. The steps for setup and usage are described below. Resources The Yocto Project package management system will work with many hosts and targets. The following were used for creating this document: Host: Ubuntu 14.04 64-bit Target: MCIMX6Q-SDP Freescale Yocto Project Release Documentation: Linux 3.14.38_6ul BSP & Multimedia Codecs Documentation (fsl-yocto-L3.14.38_6ul-ga.tar.gz) Host You have successfully installed a Freescale Yocto Project release. (Refer to Freescale Yocto Project Release Documentation). There are two steps for adding package management and then building: 1. Modify conf/local.conf EXTRA_IMAGE_FEATURES = "debug-tweaks package-management" ‍ 2. Build the image: bitbake core-image-minimal ‍ The core-image-minimal recipe provides an image enabling the target board to boot and support a serial console. 3. Create SDCARD: $ cd <build>/tmp/deploy/images/imx6qsabresd $ sudo dd if=core-image-minimal-imx6qsabresd.sdcard of=/dev/sdb bs=4M && sync ‍‍ Note - verify location of SDCARD on your host, /dev/sdb in this example. Examine 'cat /proc/partitions' 4. Setup web server and add link to rpm packages A web server, lighttpd, is installed. $ sudo apt-get install lighttpd ‍ Provide user write capability in /var/www $ sudo chmod 777 /var/www ‍ Create a soft link in the default web server directory to the rpm directory from the build. Note: Please update $HOME/<build> to your actual location: $ ln -s $HOME/<build>/tmp/deploy/rpm /var/www/imx6qsd ‍‍‍ Target Insert the SDCARD created from step 3 above, connect power and console cable  and power on the MCIMX6Q-SDP. Login using the "root" id, no password required. The /usr/bin/smart application is now used to setup the channels and perform package commands. For all smart options: smart --help ‍ 1. Add channels To add the packages from the host to your target, the smart  channel --add is used: Please enter the IP adress of your server, replacing SERVERIP below: smart channel --add all type=rpm-md name=all baseurl= http://SERVERIP/imx6qsd/all smart channel --add cortexa9hf_vfp_neon type=rpm-md name=cortexa9hf_vfp_neon baseurl= http://SERVERIP/imx6qsd/cortexa9hf_vfp_neon smart channel --add imx6qsabresd type=rpm-md name=imx6qsabresd baseurl= http://SERVERIP/imx6qsd/imx6qsabresd ‍‍‍‍‍‍‍‍‍ Check  the added channels: root@imx6qsabresd:~# smart channel --list all imx6qsabresd rpmsys cortexa9hf_vfp_neon ‍‍‍‍‍ 2. Update  local package cache Once the chanels have been added, the local package cache is updated. Note  SERVERIP below will be the host IP address in your network. root@imx6qsabresd:~# smart update Loading cache... Updating cache...               ######################################## [100%] Fetching information for 'all'...                                           -> http://SERVERIP/imx6qsd/all/repodata/repomd.xml                          repomd.xml                      ######################################## [ 16%]                                                                             Fetching information for 'imx6qsabresd'... -> http://SERVERIP/imx6qsd/imx6qsabresd/repodata/repomd.xml                 repomd.xml                      ######################################## [ 41%]                                                                             Fetching information for 'cortexa9hf_vfp_neon'... -> http://SERVERIP/imx6qsd/cortexa9hf_vfp_neon/repodata/repomd.xml          repomd.xml                      ######################################## [ 66%] Updating cache...               ######################################## [100%] Channels have no new packages. 3. Searching for packages Let us look at all packages containing the string client root@imx6qsabresd:~# smart search client* Loading cache... Updating cache...               ######################################## [100%] libice-dbg - ICE: Inter-Client Exchange library - Debugging files libice-dev - ICE: Inter-Client Exchange library - Development files libice-doc - ICE: Inter-Client Exchange library - Documentation files libice-staticdev - ICE: Inter-Client Exchange library - Development files (Static Libraries) libice6 - ICE: Inter-Client Exchange library libsm-dbg - SM: Session Management library - Debugging files libsm-dev - SM: Session Management library - Development files libsm-doc - SM: Session Management library - Documentation files libsm-staticdev - SM: Session Management library - Development files (Static Libraries) libsm6 - SM: Session Management library libx11-6 - Xlib: C Language X Interface library libx11-dbg - Xlib: C Language X Interface library - Debugging files libx11-dev - Xlib: C Language X Interface library - Development files libx11-doc - Xlib: C Language X Interface library - Documentation files libx11-locale - Xlib: C Language X Interface library libx11-staticdev - Xlib: C Language X Interface library - Development files (Static Libraries) libx11-xcb1 - Xlib: C Language X Interface library libxau-dbg - Xau: X Authority Database library - Debugging files libxau-dev - Xau: X Authority Database library - Development files libxau-doc - Xau: X Authority Database library - Documentation files libxau-staticdev - Xau: X Authority Database library - Development files (Static Libraries) libxau6 - Xau: X Authority Database library python-netclient - Python Internet Protocol clients xtrans-dbg - XTrans: X Transport library - Debugging files xtrans-dev - XTrans: X Transport library - Development files xtrans-doc - XTrans: X Transport library - Documentation files ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ Adding openssh client to core-image minimal The core-image-minimal does not provide openssh client applications like ssh or scp. Let's add them on the host then update the target cache of packages and then install. Host Run bitbake to exercise all the tasks for packagegroup-core-ssh-openssh $ bitbake packagegroup-core-ssh-openssh ‍ After building a package individually, always update the package-index $ bitbake package-index ‍ Target Run smart to update the local cache which will pickup the new packages from the bake above. root@imx6qsabresd:~# smart update Loading cache... Updating cache...               ######################################## [100%] Fetching information for 'all'...                                              -> http://SERVERIP/imx6qsd/all/repodata/repomd.xml                           repomd.xml                      ######################################## [ 16%] -> http://SERVERIP/imx6qsd/all/repodata/primary.xml.gz                       primary.xml.gz                  ######################################## [ 25%] -> http://SERVERIP/imx6qsd/all/repodata/filelists.xml.gz                     filelists.xml.gz                ######################################## [ 33%]                                                                                Fetching information for 'imx6qsabresd'... -> http://SERVERIP/imx6qsd/imx6qsabresd/repodata/repomd.xml                  repomd.xml                      ######################################## [ 50%] -> http://SERVERIP/imx6qsd/imx6qsabresd/repodata/primary.xml.gz              -> http://SERVERIP/imx6qsd/imx6qsabresd/repodata/filelists.xml.gz            filelists.xml.gz                ######################################## [ 58%] primary.xml.gz                  ######################################## [ 66%]                                                                                Fetching information for 'cortexa9hf_vfp_neon'... -> http://SERVERIP/imx6qsd/cortexa9hf_vfp_neon/repodata/repomd.xml           repomd.xml                      ######################################## [ 83%] -> http://SERVERIP/imx6qsd/cortexa9hf_vfp_neon/repodata/primary.xml.gz       primary.xml.gz                  ######################################## [ 91%] -> http://SERVERIP/imx6qsd/cortexa9hf_vfp_neon/repodata/filelists.xml.gz     filelists.xml.gz                ######################################## [100%] Updating cache...               ######################################## [100%] Channels have 15 new packages. Saving cache... ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ Examine information about local cache: root@imx6qsabresd:~# smart stats Loading cache... Updating cache...               ######################################## [100%] Installed Packages: 80 Total Packages: 3586 Total Provides: 6580 Total Requires: 1611 Total Upgrades: 3565 Total Conflicts: 25 ‍‍‍‍‍‍‍‍‍‍‍ See what ssh packages are now available: root@imx6qsabresd:~# smart search *ssh* Loading cache... Updating cache...               ######################################## [100%] openssh - Secure rlogin/rsh/rcp/telnet replacement openssh-dbg - Secure rlogin/rsh/rcp/telnet replacement - Debugging files openssh-dev - Secure rlogin/rsh/rcp/telnet replacement - Development files openssh-doc - Secure rlogin/rsh/rcp/telnet replacement - Documentation files openssh-keygen - Secure rlogin/rsh/rcp/telnet replacement openssh-misc - Secure rlogin/rsh/rcp/telnet replacement openssh-ptest - Secure rlogin/rsh/rcp/telnet replacement - Package test files openssh-scp - Secure rlogin/rsh/rcp/telnet replacement openssh-sftp - Secure rlogin/rsh/rcp/telnet replacement openssh-sftp-server - Secure rlogin/rsh/rcp/telnet replacement openssh-ssh - Secure rlogin/rsh/rcp/telnet replacement openssh-sshd - Secure rlogin/rsh/rcp/telnet replacement packagegroup-core-ssh-openssh - OpenSSH SSH client/server packagegroup-core-ssh-openssh-dbg - OpenSSH SSH client/server - Debugging files packagegroup-core-ssh-openssh-dev - OpenSSH SSH client/server - Development files ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ Install openssh root@imx6qsabresd:~# smart install openssh Loading cache... Updating cache...               ######################################## [100%] Computing transaction... Installing packages (9):   openssh-6.7p1-r0@cortexa9hf_vfp_neon                                            openssh-keygen-6.7p1-r0@cortexa9hf_vfp_neon                                     openssh-scp-6.7p1-r0@cortexa9hf_vfp_neon                                        openssh-ssh-6.7p1-r0@cortexa9hf_vfp_neon                                        openssh-sshd-6.7p1-r0@cortexa9hf_vfp_neon                                       shadow-4.2.1-r0@cortexa9hf_vfp_neon                                             shadow-base-4.2.1-r0@cortexa9hf_vfp_neon                                        shadow-securetty-4.2.1-r3@imx6qsabresd                                          util-linux-sulogin-2.25.2-r1@cortexa9hf_vfp_neon                              1.4MB of package files are needed. 3.2MB will be used. Confirm changes? (Y/n): y Fetching packages...                                                           -> http://SERVERIP/imx6qsd/.../openssh-6.7p1-r0.cortexa9hf_vfp_neon.rpm      -> http://SERVERIP/imx6qsd/.../shadow-securetty-4.2.1-r3.imx6qsabresd.rpm    shadow-securetty-4.2.1-r3.imx.. ######################################## [ 11%] -> http://SERVERIP/imx6qsd/.../openssh-scp-6.7p1-r0.cortexa9hf_vfp_neon.rpm openssh-scp-6.7p1-r0.cortexa9.. ######################################## [ 22%] openssh-6.7p1-r0.cortexa9hf_v.. ######################################## [ 33%] -> http://SERVERIP/imx6qsd/.../openssh-sshd-6.7p1-r0.cortexa9hf_vfp_neon.rpm openssh-sshd-6.7p1-r0.cortexa.. ######################################## [ 44%] -> http://SERVERIP/imx6qsd/.../shadow-4.2.1-r0.cortexa9hf_vfp_neon.rpm       -> http://SERVERIP/imx6qsd/.../openssh-ssh-6.7p1-r0.cortexa9hf_vfp_neon.rpm openssh-ssh-6.7p1-r0.cortexa9.. ######################################## [ 55%] -> http://SERVERIP/imx6qsd/.../shadow-base-4.2.1-r0.cortexa9hf_vfp_neon.rpm shadow-base-4.2.1-r0.cortexa9.. ######################################## [ 66%] shadow-4.2.1-r0.cortexa9hf_vf.. ######################################## [ 77%] -> http://SERVERIP/.../util-linux-sulogin-2.25.2-r1.cortexa9hf_vfp_neon.rpm util-linux-sulogin-2.25.2-r1... ######################################## [ 88%] -> http://SERVERIP/.../openssh-keygen-6.7p1-r0.cortexa9hf_vfp_neon.rpm       openssh-keygen-6.7p1-r0.corte.. ######################################## [100%]                                                                                Committing transaction... Preparing...                    ######################################## [  0%]    1:Installing openssh-ssh     ######################################## [ 11%] Output from openssh-ssh-6.7p1-r0@cortexa9hf_vfp_neon:                          update-alternatives: Linking /usr/bin/ssh to /usr/bin/ssh.openssh                 2:Installing openssh-scp     ######################################## [ 22%] Output from openssh-scp-6.7p1-r0@cortexa9hf_vfp_neon:                          update-alternatives: Linking /usr/bin/scp to /usr/bin/scp.openssh                 3:Installing shadow-secure.. ######################################## [ 33%]    4:Installing shadow-base     ######################################## [ 44%] Output from shadow-base-4.2.1-r0@cortexa9hf_vfp_neon:                          update-alternatives: Linking /usr/bin/newgrp to /usr/bin/newgrp.shadow         update-alternatives: Linking /usr/bin/groups to /usr/bin/groups.shadow update-alternatives: Linking /bin/login to /bin/login.shadow update-alternatives: Linking /bin/su to /bin/su.shadow    5:Installing util-linux-su.. ######################################## [ 55%] Output from util-linux-sulogin-2.25.2-r1@cortexa9hf_vfp_neon:                  update-alternatives: Linking /sbin/sulogin to /sbin/sulogin.util-linux            6:Installing openssh-keygen  ######################################## [ 66%]    7:Installing shadow          ######################################## [ 77%] Output from shadow-4.2.1-r0@cortexa9hf_vfp_neon:                               update-alternatives: Linking /usr/bin/passwd to /usr/bin/passwd.shadow         update-alternatives: Linking /usr/bin/chfn to /usr/bin/chfn.shadow update-alternatives: Linking /usr/bin/chsh to /usr/bin/chsh.shadow update-alternatives: Linking /usr/sbin/chpasswd to /usr/sbin/chpasswd.shadow update-alternatives: Linking /sbin/vipw to /sbin/vipw.shadow update-alternatives: Linking /sbin/vigr to /sbin/vigr.shadow Output from openssh-sshd-6.7p1-r0@cortexa9hf_vfp_neon:                         Removing any system startup links for sshd ...                                Running useradd commands... NOTE: Performing useradd with [ --system --no-create-home --home-dir /var/run/sshd --shell /bin/false --user-group sshd] and 10 times of retry    8:Installing openssh-sshd    ######################################## [ 88%] Adding system startup for /etc/init.d/sshd.                                   Starting OpenBSD Secure Shell server: sshd   generating ssh RSA key...   generating ssh ECDSA key...   generating ssh DSA key...   generating ssh ED25519 key... done.    9:Installing openssh         ######################################## [100%] ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ Check for the scp command: root@imx6qsabresd:~# which scp /usr/bin/scp ‍‍ Summary To add a new package on the server host, run bitbake <recipe> then bitbake package-index to update the rpm tracking information. On the target board, run smart update and then smart install <package>. Use smart search <regular expression string> to hunt for a package to install.
View full article
Recipes to include Amazon's Alexa Voice Services in your applications. Step 1 : Get iMX Yocto AVS setup environment Review the steps under Chapter 3 of the i.MX_Yocto_Project_User'sGuide.pdf on the L4.X LINUX_DOCS to prepare your host machine. Including at least the following essential Yocto packages $ sudo apt-get install gawk wget git-core diffstat unzip texinfo \ gcc-multilib build-essential chrpath socat libsdl1.2-dev u-boot-tools Install the i.MX NXP AVS repo Create/Move to a directory where you want to install the AVS yocto build enviroment. Let's call this as <yocto_dir> $ cd <yocto_dir> $ repo init -u https://source.codeaurora.org/external/imxsupport/meta-avs-demos -b master -m imx-alexa-sdk-4.9.51-8mq_ga.xml Download the AVS BSP build environment: $ repo sync Step 2: Setup yocto for Alexa_SDK image with AVS-SETUP-DEMO script: Run the avs-setup-demo script as follows to setup your environment for the imx8mqevk board: $ MACHINE=imx8mqevk DISTRO=fsl-imx-xwayland source avs-setup-demo.sh -b <build_sdk_8M> Where <build_sdk> is the name you will give to your build folder. After acepting the EULA the script will prompt if you want to enable: Sound Card selection The following Sound Cards are supported on the build: 2-Mic Synaptics/Conexant 2-Mic TechNexion Voice Hat (with DSPConcepts SW) The script will prompt to select the soundcard you will be using: Which Sound Card are you going to use? Synaptics/Conexant .................... 1 VoiceHat (for DSPConcepts SW) ......... 2 Type the number of your selection and press Enter... Install Alexa SDK Next option is to select if you want to pre-install the AVS SDK software on the image. Do you want to build/include the AVS_SDK package on this image(Y/N)? If you select YES, then your image will contain the AVS SDK ready to use (after authentication). Note this AVS_SDK will not have WakeWord detection support, but it can be added on runtime. If your selection was NO, then you can always manually fetch and build the AVS_SDK on runtime. All the packages dependencies will be already there, so only fetching the AVS_SDK source code and building it is required. Finish avs-image configuration At the end you will see a text according with the configuration you select for your image build. Next is an example for a Preinstalled AVS_SDK with Synaptics Sound Card support ============================================================ AVS configuration is now ready at conf/local.conf - Sound Card = Synaptics - Alexa SDK 1.7 pre-installed - Wifi supported You are ready to bitbake your AVS demo image now:   bitbake avs-image If you want to use QT5DisplayCards, use then:   bitbake avs-image-qt5 ============================================================ Step 3: Build the AVS image Go to your <build_sdk> directory and start the build of the avs-image There are 2 options Regular Build: $ cd  <yocto_dir>/<build_sdk>   $ bitbake avs-image With QT5 support included: $ cd  <yocto_dir>/<build_sdk>   $ bitbake avs-image-qt5 The image with QT5 is useful if you want to add some GUI for example to render DisplayCards. Step 4 : Deploying the built images to SD/MMC card to boot on target board. After a build has succesfully completed, the created image resides at <build_sdk>/tmp/deploy/images/imx8mqevk/ In this directory, you will find imx8mqevk-avs--.sdcard image or imx8mqevk-avs-qt5--.sdcard, depending on the build you chose on Step3. To Flash the .sdcard image into an SD Card follow the next steps: Extract and copy the .sdcard file to your SD Card $ cd <build_sdk>/tmp/deploy/images/imx8mqevk/ $ cp -v imx8mqevk-avs-synaptics-1.7.sdcard.bz2 <workdir> $ cd <workdir> $ sudo bzip2 -d imx8mqevk-avs-synaptics-1.7.sdcard.bz2 $ sudo dd if=imx8mqevk-avs-synaptics-1.7.sdcard.bz2 of=/dev/sd<part> bs=1M && sync $ sync Properly eject the SD Card: $ sudo eject /dev/sd<part> Insert the flashed SD Card on the 8M EVK and boot. Follow the instructions at startup to setup your AVS and run the SampleApp. NXP Documentation For a more comprehensive understanding of Yocto, its features and setup; more image build and deployment options and customization, please take a look at the i.MX_Yocto_Project_User's_Guide.pdf document from the Linux documents bundle mentioned at the beginning of this document. For a more detailed description of the Linux BSP, u-boot use and configuration, please take a look at the i.MX_Linux_User's_Guide.pdf document from the Linux documents bundle mentioned at the beginning of this document.
View full article
In order to create this Ogg Theora encoder example you need to add libogg, libvorbis and libtheora to your system. Download these libs from http://www.theora.org/downloads/ : libogg-1.1.3, libvorbis-1.2.0 and libtheora-1.0.tar.bz2 Copy them to /opt/ltib/pkgs Create the directories ltib/dist/lfs-5.1/libogg, ltib/dist/lfs-5.1/libvorbis, ltib/dist-5.1/lfs/libtheora. Copy these spec files to its respective directories: File:Libogg.gz File:Libvorbis.gz File:Libtheora.gz Execute this sequence to compile and install these libs: $ ./ltib -p libogg.spec -m prep $ ./ltib -p libogg.spec -m scbuild $ ./ltib -p libogg.spec -m scdeploy $ ./ltib -p libvorbis.spec -m prep $ ./ltib -p libvorbis.spec -m scbuild $ ./ltib -p libvorbis.spec -m scdeploy $ ./ltib -p libtheora.spec -m prep $ ./ltib -p libtheora.spec -m scbuild $ ./ltib -p libtheora.spec -m scdeploy Now download and compile yuv2theora.c encoder example: File:Yuv2theora.gz $ ./ltib -m shell LTIB> gcc yuv2theora.c -o yuv2theora `pkg-config --libs --cflags theora` In this example we used a video sample (YUV420) on CIF format: http://140.116.72.80/~jhlin5/ns2/yuv_to_avi/paris_cif.yuv Update: All these libraries were added on LTIB Savannah CVS, then you just need to use them and compile the above code.
View full article
Overview i.MX28EVK Setup Build Yocto Project image Create a SDCARD from the Linux Host Boot i.MX28EVK Create file system on USB Create Mount Point and Mount the USB device Create 250 MB File Create Exports File Restart NFS Server Ubuntu Linux Host Setup Create Mount Directory Mount i.MX28EVK Exported Directory Access the NFS mounted directory Overview This document describes the steps for configuring a NFS Server running on an i.MX Application Processor - in this case the evaluation board i.MX28 EVK. Once the NFS server is running, an Ubuntu 12.04 Linux host is then configured to NFS mount the i.MX28EVK exported directory. The Ethernet interface is used for the connection transport. A block diagram of the connection setup is shown below: An Ethernet switch provided the Ethernet connection between the Linux Host and the i.MX28EVK. A thumb drive was connected to the USB port on the i.MX28EVK which was used for the exported directory. i.MX28EVK Setup Build Yocto Project image Use core-image-minimal and add packages to conf/local.conf to support NFS MACHINE=imx28evk source setup-environment mx28-evk echo "CORE_IMAGE_EXTRA_INSTALL += \"bash kernel-modules nfs-utils\" " >> conf/local.conf bitbake core-image-minimal When bitbake finishes the images are found in tmp/deploy/images/imx28evk Create a SDCARD from the Linux Host sudo dd if=/tmp/deploy/images/imx28evk/core-image-minimal-imx28evk.sdcard of=/dev/sdc bs=4M && sync Boot i.MX28EVK Insert the SDCARD into slot 0 on the bottom side of the i.MX28EVK and connect the serial console. Power-on and push the POWER button on the lower conner to turn on. The Login credentials are User Name: root      There is no password configured by default. Create file system on USB The USB drive had one partition which was formatted with vfat file system: mkfs.vfat /dev/sdb1 Create Mount Point and Mount the USB device mkdir /mnt/usb mount /dev/sdb1 /mnt/usb Create 250 MB File dd if=/dev/zero of=/mnt/usb/file1.txt bs=512K count=500 Create Exports File echo "/mnt/usb *(rw,sync,no_root_squash,no_subtree_check)" > /etc/exports Restart NFS Server /etc/init.d/nfsserver stop /etc/init.d/nfsserver start Ubuntu Linux Host Setup Create Mount Directory sudo mkdir /mnt/remote Mount i.MX28EVK Exported Directory sudo mount -t nfs 10.85.1.10:/mnt/usb /mnt/remote Access the NFS mounted directory ls /mnt/remote
View full article
In every i.MX BSP you will find a pre-compiled binary to flash on your board, but if you need to recompile, this tutorial will be useful. Redboot source code and pre-built images for many platforms are available on Linux Board Support Package (BSP). As an example, let's compile redboot version 2009_10 that comes with Freescale Linux BSP.   For detailed information about Redboot, check <redboot_folder>/doc Locate the file ecostools.tar.gz and decompress it on /opt directory. (Create this folder if it is not there) $ cd /opt $ sudo tar zxvf <redboot_folder>/tools/ecos_config_tools.tar.gz $ sudo tar zxvf <redboot_folder>/tools/arm-2008q1.tar.gz This creates /opt/ecostools directory with two subdirectories: arm-2008q1 -- GNU tools for compiling, linking, etc. tools -- mainly to have ecosconfig utility program Add /opt/arm-2008q1/bin and /opt/tools/bin to your environment PATH variable. $ export PATH=$PATH:/opt/arm-2008q1/bin:/opt/tools/bin Generating RedBoot Image Decompress the ecos-trunk-080727.tar.bz2 base line source code into <redboot_folder>/src. There should be a 'packages' directory under <redboot_folder>/src/ecos if it is done correctly. $ tar xjvf ecos-trunk-080727.tar.bz2 Go to ecos subdirectory and apply the patches; $ cd ecos $ bunzip2 -c patch-redboot-200910-base.bz2 | patch -p1 The above command assumes the patch file is under the same directory as the <redboot_folder>/src/ecos. Specify the path name for the patch file if necessary. Apply the patch for specific platform. In this case, the used patch is: patch-redboot-200834-mx3.bz2 $ patch-redboot-200910-mx3.bz2 | patch -p1 Define the ECOS_REPOSITORY. On <redboot_folder>, put the entire (absolute) path to redboot folder. I.e. ~/<redboot_folder>/src/ecos/packages $ export ECOS_REPOSITORY=<redboot_folder>/src/ecos/packages To build redboot (for i.MX31 in this example), create a new folder in order to have a clean build: $ mkdir new_redboot $ cd new_redboot $ ecosconfig new mx31_3stack redboot $ ecosconfig import $ECOS_REPOSITORY/hal/arm/mx31/3stack/current/misc/redboot_ROMRAM.ecm $ ecosconfig tree $ make This creates the Redboot image (redboot.bin) under install/bin directory. This image can run from either SDRAM or flash. Note: You can change the board MACH-TYPE at this file: src/ecos/packages/hal/arm/mx27/ads/current/cdl/hal_arm_board.cdl
View full article