i.MX Processors Knowledge Base

cancel
Showing results for 
Search instead for 
Did you mean: 

i.MX Processors Knowledge Base

Discussions

Flashing Kernel and Root File System using RedBoot Creating an image A kernel image and a root file system can be created using All Boards LTIB or compiling the kernel and setting the correct set of files. Create a root file system image from a set of files converting the files to a jffs2 file system. For this, install the package mtd-tools. In Ubuntu type apt-get install mtd-tools For making an root file system for flash, use the jffs2 file system like: mkfs.jffs2 -r rootfs/ -e 0x20000 -n -p -o rootfs.jffs2 Where rootfs/ is the original set of file for the file system and rootfs.jffs2 is the output image file. Flashing Some connections errors can be avoided by All Boards Configuring RedBoot. The process below uses TFTP to copy the files between host and target. See All Boards TFTP for detail in configurations. Copy the kernel image and the root file system image to the TFTP dir. For example, in  LTIB dir, type sudo cp ./rootfs/boot/zImage /tftpboot sudo cp rootfs.jffs2 /tftpboot/ Where /tftpboot is the dir configured for TFTP The next steps are performed in a Minicom session, and happens on the board. Formatting the flash: fis init Flashing kernel Load kernel image (zImage) using the command below. Remember to modify the host IP address: load -r -b 0x100000 /tftpboot/zImage -h 10.29.244.99 The address 0x100000 is used as a temporary location Create the kernel at the right address (0x200000, for IMX31PDK) fis create -f 0x200000 kernel Flashing root file system Load root file system image (rootfs.jffs2) to the temporary address. Remember to modify the host IP address: load -r -b 0x100000 /tftpboot/rootfs.jffs2 -h 10.29.244.99 Create the root file system in the right address (0x600000, for IMX31PDK. fis create -f 0x600000 root Testing You can now load your kernel in the flash by typing: fis load kernel To know if the root file system written in the flash was correctly saved, execute the NFS file system and mount the flash. For load the the root file system by NFS, type: exec -b 0x100000 -l 0x200000 -c "noinitrd console=ttymxc0,115200 root=/dev/nfs nfsroot=10.29.244.99:/tftpboot/rootfs init=/linuxrc ip=10.29.241.6:10.29.244.99" Wait the system go up, then mount the flash at /mnt. Reminde that the flash has a jffs2 file system. mount -t jffs2 /dev/mtdblock2 /mnt ls /mnt List the /mnt contents. The output must be the right file system. Modifying the initial script Reset the board and press CTRL-C. Type fc to modify the configurations and insert the initialization script. RedBoot> fc Run script at boot: true Boot script: Enter script, terminate with empty line >> fis load kernel >> exec -c "noinitrd console=ttymxc0,115200 root=/dev/mtdblock2 rw rootfstype=jffs2 ip=none" >> Boot script timeout (1000ms resolution): 1 Use BOOTP for network configuration: false Gateway IP address: 10.29.241.254 Local IP address: 10.29.241.6 Local IP address mask: 255.255.254.0 Default server IP address: 10.29.244.99 Board specifics: 0 Console baud rate: 115200 Set eth0 network hardware address [MAC]: false GDB connection port: 9000 Force console for special debug messages: false Network debug at boot time: false Update RedBoot non-volatile configuration - continue (y/n)? y ... Read from 0x07ee0000-0x07eff000 at 0x00080000: . ... Erase from 0x00080000-0x000a0000: . ... Program from 0x07ee0000-0x07f00000 at 0x00080000: . RedBoot> Remember to save the configuration in the flash by typing y Reset the system. To certify that the board is loading the system from flash, remove the ethernet cable.
View full article
Debugging with Eclipse and GDB on Linux user space This is a good open-source choice to debug i.MX processors. The integration of popular tools like Eclipse and GDB offers a good and stable connection between host and target. The first step is to install the tools on host. Click here to get instructions of how to install the tools. Let's debug a ready hello world program into the ltib. To extract the hello world package, type on ltib directory: $./ltib -m prep -p helloworld Change the code of hello.c to: #include <stdio.h> int main(int argc, char** argv) {     int i;     for (i = 0; i < 100; ++ i)     {         printf(“Welcome to GDB ! %d /n”, i);     }     return 0; } Change the Makefile to add debug symbols Change the two following lines from: CFLAGS = -Wall CXXFLAGS = -Wall To: CFLAGS = -Wall -g CXXFLAGS = -Wall -g Build and deploy the new source-code: $./ltib –p helloworld –m scbuild $./ltib –p helloworld –m scdeploy Configuring the Target On target, gdbserver needs to be run to perform debug. The gdbserver command has the following structure: gdbserver ip_host:port /full/path/app/app_name If gdbserver is not installed on target, select gdb package on ltib configuration. In this example our host has the 192.168.16.35 IP address and our HelloWorld application is located at /usr/bin/hello on the target board. Execute the gdbserver: gdbserver 192.168.16.35:10000 /usr/bin/hello You can use other port number as long as you use the same number when configuring the Eclipse. Setting a GDB Debug Session on Eclipse Now we will configure Eclipse C/C++ to start a GDB session with our remote i.MX board. We will need to know which is the target board’s IP address. To get your target’s IP address: /sbin/ifconfig In our example the target board has the 192.168.16.36 IP address. Open-up Eclipse and choose the C/C++ perspective. We will import the HelloWorld executable built by LTIB. Go to the menu File -> Import You will see the “Import” screen. Select “C/C++ Executable” option. Hit the “Next” button. Eclipse automaticaly creates a new project when whe use the “Import” option. In the next screen, select the “Search Directory” option and hit the “Browse” button. This session is incomplete and is being edited...
View full article
<analytics uacct="UA-5520491-1" /> How to enable WIFI support for i.MX53 QSB Android After applying every QSB patch, enable WiFi support according to your hardware. Android R4 can be downloaded from Adeneo´s website. AR6102  Change file device/fsl/imx53_loco/BoardConfig.mk -BOARD_WLAN_CHIP_AR6102  := false +BOARD_WLAN_CHIP_AR6102  := true AR6003  Change file device/fsl/imx53_loco/BoardConfig.mk -BOARD_WLAN_CHIP_AR6003  := false +BOARD_WLAN_CHIP_AR6003  := true After complete build ar6000.ko will be created under /system/etc/modules To turn WIFI on, go to Settings > Wireless & network s > Wi-Fi Error message case  In case logcat shows the following error message: E/WifiHW  ( 2086): Cannot access "/data/misc/wifi/wpa_supplicant.conf":Permission denied Reconfigure nfs server file /etc/default/nfs-kernel-server delete this line:   RPCMOUNTDOPT=--manage-gids
View full article
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 s hould 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
Important:  If you have any questions or would like to report any issues with the DDR tools or supporting documents please create a support ticket in the   i.MX community.  Please note that any private messages or direct emails are not monitored and will not receive a response. i.MX 6/7 Family DDR Stress Test   i.MX6/7 DDR Stress Test Tool is a PC-based software to fine-tune DDR parameters and verify the DDR performance on a non-OS, single-task environment(it is a light-weight test tool to test DDR performance). It performs write leveling, DQS gating and read/write delay calibration features.   There are three options to run the DDR Stress test. Each of these options are provided in the attached zip files. The following is a high-level overview of each option along with the naming convention of the associated zip file:   Option 1 GUI based: Run the GUI executable and connect your board to the host PC via USB Archive file: ddr_stress_tester_vX.xx.zip The tool will first need to run a DDR initialization script for the specified i.MX SoC (refer to Load Init Script in the GUI tool).  Example initialization scripts based on NXP's development boards can be found in this zip file under the script folder.  Note, these scripts may need to be modified for your custom board and memory.   Option 2 DDR Stress Tester: JTAG Interface A hardware debugger connected to the board via the JTAG interface is used to download an elf file into the i.MX SoC OCRAM (internal RAM) and then begin execution. Results are shown on the UART serial port (115200-8-n-1). Archive file: ddr_stress_tester_jtag_vX.xx.zip As with the GUI tool, the JTAG/debugger option will first need to run a DDR initialization script for the specified i.MX SoC. Refer to the GUI tool description above for the location of the example scripts (which are found in the ddr_stress_tester_vX.xx.zip file). Note that the scripts are available either in the RealView ICE format (.inc file) or the DS-5 DSTERAM format (.ds). For other debuggers, the user will have to modify the script's command syntax for their specific debugger. This is also true if converting from a RealView Ice (.inc) format to a DS-5 DSTREAM (.ds) format and vice versa. The DDR Stress Tester executable (starting with V2.20) has an auto UART detection feature. If a different UART port for the serial console has been chosen than used on the NXP development tool (EVK, SABRE) specific commands can be added to the DDR initialization script that allows you to configure for the specific UART and then load and run the elf executable. Refer to the FAQ section of this community post and the txt file found in the JTAG archive file for instructions.   Option 3 U-Boot: The boot loader u-boot is running and commands in u-boot are used to download the bin file into SoC OCRAM and begin execution. Results are shown on the UART serial port (115200-8-n-1) Archive file: ddr_stress_tester_uboot_vX.xx.zip When downloading the DDR Stress Tool by u-boot, please copy the ddr-test-uboot-jtag-mxxxx.bin to SD card and load it to IRAM using the 'fatload' u-boot command. For i.MX6, please load the binary to 0x00907000. For i.MX7D, please load the binary to 0x00910000.  It is imperative to first disable the I and D cache in u-boot as shown below as the DDR Stress Test re-configures and re-enables the cache and MMU page table. The following is an example of downloading and running the DDR stress test from u-boot: u-boot> dcache off u-boot> icache off u-boot> fatload mmc 0:1 0x00907000 ddr-test-uboot-jtag-mx6ul.bin u-boot> go 0x00907000   Stress Test Revision Features Comments 3.00 Add i.MX 7ULP support in the GUI version Known issues: USB connection is unstable when under USB HUB or some PC environments 2.92 Minor correction with write leveling calibration code error check to avoid a corner case of flagging an error when none have occurred.  2.91 Resolved issue with write leveling calibration code where a race condition in the code may result in the calibration routine not being able to find any delay values.   Only applies to MX6 series SoCs that support DDR3.   2.90 Reserve write delay line register (MMDC_MPWRDLCTL) configuration as DDR script does when do write calibration. In previous releases, MMDC_MPWRDLCTL would be changed to 0x40404040 by default.  * Further details available in the release notes  _________________________________________________________________________________________________________________________________________    FAQ   Q. I see an error message that states "ERROR: DCD addr is out of valid range.", why is this and how do I resolve? A. Sometimes, when using the register programming aid, there are registers writes that are not supported in the DCD range.  Try looking for the following items and comment them out from the DDR initialization script: wait = on setmem /16 0x020bc000 = 0x30 // disable watchdog (note the address for this may be different between i.MX6x devices)  Q. How do I select the "DDR Density" pull-down menu and what is the purpose of this? A. The DDR Density pull-down menu gives the user the option of testing a DDR density smaller than what they actually have on their board.  The advantage of doing this is to speed up test time to allow the user to perform a "quick test" of their system.  IMPORTANT: it is imperative that the user not set this value higher than the supported density on their board, doing so will cause the stress test to fail and/or lock up. The DDR Density has a different meaning depending on the memory type being tested (DDR3 or LPDDR2): For DDR3, this is the density per CHIP SELECT.  So if your board has two chip selects, and each chip select has 512MB, you would simply select 512MB or lower.  The default setting will simply set this to the detected density per chip select. For LPDDR2, this is the density per CHANNEL.  This is only relevant for MX6 devices that support 2 channel LPDDR2 memories (MX6DQ, MX6DL).  For other MX6 devices that support only one LPDDR2 channel, then this is the total density (for the maximum setting) for that channel. Note that for LPDDR2, the number of chip selects (per channel) is irrelevant when selecting the density to test as the stress test combines both chip-selects into one combined density per channel.  For example, lets say you have a 2GB LPDDR2 device, which 2 channels and 2 chip-selects per channel.  That means you have 512MB per chip select, per channel.  Or, it also means you have 1GB per channel when combining both chip selects per channel.  In this case, you would choose (a maximum setting of) 1GB in the DDR Density drop down menu.  However, this is also the same setting as the default setting (which you are welcome to still choose 1GB to convince yourself that 1GB per channel is indeed being tested). Now let's assume you have only one channel (LPDDR2) and one chip select, with a density of 128MB; in this case, the maximum DDR Density you can select is 128MB. Let's assume you have one channel and two chip selects, each chip select is 128MB;  in this case, the maximum DDR Density you can select is 256MB (a combination of both chip selects).   Note, for the MX7D, an actual density needs to be entered. For the MX6x series, simply leaving this field as Default will cause the DDR stress test to ascertain the supported density from the DDR init script. As the MX7D DDR controller is different, this feature is not supported, hence it is required for the user to enter an actual density (for more details regarding MX7D usage of density and number of chip-selects, see the next FAQ on the DDR CS setting).   Q.  What is the purpose of the "DDR CS" pull-down option? A.  The answer depends on which processor you are testing:   For the i.MX 6x series: This pull down menu gives you the option of testing one chip select (CS0) or ALL (both) chip selects *IF* you have a two-chip select configuration.  If you have a two-chip select configuration, then this allows you to test only one chip select for faster test time; else you can choose to test both chip selects.  Note that if you have a one-chip select configuration and you choose "ALL", the stress test will return an error.   For the iMX 7D: Because the MX7D DDR controller is different, the DDR stress test will need the user to supply the entire supported density found on their board. The chip select field should be left as is (0) as the test will naturally test one chip select to the next. For example, let’s assume you are using two chip selects, with each chip select being 512MB. In this case, you would enter 1GB for the DDR Density field ensuring that both chip selects will be tested. The user is allowed to enter a density less than the density found on their board (for quicker testing), but keeping in mind both chip selects may not be tested in this case.   Q. I run DDR calibration using the DDR Stress Test Tool to obtain the calibration results.  Are these calibration parameters are written to the uboot flash_header.S automatically or manually? A. The calibration values obtained from the DDR Stress Test Tool will need to be manually updated in the flash_header.S file or any other DDR initialization script.   Q. When running the DDR stress test on MX7D and I try to perform calibration, I get an error stating that calibration is not supported, is this expected? A. Yes, calibration is not supported or needed when using MX7.  The reason is, MX7 uses a different memory controller than the MX6 series.  The MX6 series memory controller has built-in support for calibration where the MX7 memory controller does not.   Q. When running the GUI version of the DDR stress test, on MX7 and I leave DDR Density as default, I get an error in the tool stating I must supply a density.  Why is this? A. This is due to the fact that MX7 uses a different memory controller than the MX6 series.  In the MX6 series, it was possible to calculate the memory density from the memory controller register settings.  The MX7 memory controller is different and does not lend itself to easily calculate the supported density based on the register settings.  Instead, the user should verify the density on their board and selected this value in the DDR Density pull-down menu.    Q. I noticed that when I run write-leveling calibration I sometimes see a note that due to the write-leveling calibration value being greater than 1/8 clock cycle that WALAT must be set to 1.  What does this mean? A. In the MMDC chapter of the reference manual for the specific i.MX 6 device, the need to set WALAT is described in the MDMISC register as follows: " The purpose of WALAT is to add time delay at the end of a burst write operation to ensure that the JEDEC time specification for Write Post Amble Delay (tWPST) is met (DQS strobe is held low at the end of a write burst for > 30% a clock cycle before it is released). If the value of any of the WL_DL_ABS_OFFSETn register fields are greater than ‘1F’, WALAT should be set to ‘1’ (cycle additional delay). WALAT should be further increased for any full-cycle delays added by the WL_CYC_DELn register fields. " Therefore, if the write-leveling calibration routine detects any write-leveling delay value greater than 0x1F, it will note to the user that WALAT must be set and the user should update their DDR3 init script to ensure WALAT is set.  Sometimes, a user may find that the write-leveling delay value may fluctuate from one run to the next, which is quite normal.  If it is found that this delay is "borderline" meaning sometimes it is greater than 0x1F and sometimes it might be slightly less, then it is ok to go ahead and set WALAT permanently in your init script as there is no harm in doing so and will ensure you will stay within JEDEC's tWPST.   Q. I sometimes see that after running write-leveling calibration that delay values being reported back are zero'd out (0x00), and then at times I see a non-zero value being reported, why is this? A. It is quite normal to see slight variations in the delay value between write-leveling calibration runs.  The write-leveling calibration routine assumes a majority of users have designed their board such that the DDR3 memories are placed close to the i.MX 6 SoC. There’s a mechanism in NXP’s DDR Stress test write leveling calibration code that checks the returned write leveling value. If the write-leveling calibration routine detects that the returned delay value is greater than ¾ of a clock cycle, it will "zero out" the delay value. It does this because it assumes that such a large delay result is due to the fact that the DQS signal is already delayed relative to the SDCLK, and to align DQS with SDCLK requires the calibration routine to delay DQS even further to align it to the next SDCLK edge, something we ideally would like to avoid.  JEDEC specs that the DQS edge must be within 25% of a SDCLK cycle with respect to the SDCLK edge, so having DQS initially slightly delayed from SDCLK is actually ok, hence why the calibration routine “zero’s” this out when the returned value exceeds ¾ of a clock cycle.  In cases like this, the DQS edge and SDCLK edge are so close together that in some calibration runs, the DQS edge may slightly precede SDCLK (resulting in a very small write-leveling delay value) and other runs, it may be slightly delayed relative to the SDCLK (resulting in a very large write-leveling delay value that will try to align DQS to the next SDCLK edge, hence needs to be zero’d out).   Q. When using the JTAG version of the DDR stress test, how can I select a different UART port for my serial port? A. Under the folder ddr_stress_tester_jtag_v2.52, there's a text file that describes how to add a different UART port by adding a few additional commands to your DDR init script.  The following is an outline of these commands: 1. Ungate UART module clocks (most NXP scripts ungate all of the peripheral clocks at the beginning of the script, so this part is already done) 2. Configure the IOMUX options for the pins you wish the UART to use (normally an IOMUX option for UART_TX and UART_RX, and a daisy chain option for the UART_RX input) 3. Enable the desired UART module via the register UCR1, bit UART_EN 4. Disable other UART modules (UCR1[UART_EN] = 0).  Normally disabling UART1 should be sufficient, but it doesn't hurt to disable all of the other un-used UART options for the purpose of the stress test.   Here's an example in the .ds file vernacular of a set up as follows: MX6DQ, UART4 on KEY_COL0 and KEY_ROW0 (assume clock is ungated to all peripherals): mem set 0x020E01F8 32 0x00000004   #// config_pad_mode(KEY_COL0, ALT4) mem set 0x020E01FC 32 0x00000004   #// config_pad_mode(KEY_ROW0, ALT4); mem set 0x020E0938 32 0x00000001   #// Pad KEY_ROW0 is involved in Daisy Chain. mem set 0x02020080 32 0x00000000   #//disable UART1 in UART1_UCR1 (Note, you can disable other UART modules as well) mem set 0x021F0080 32 0x00000001   #//enable UART4 in UART4_UCR1   Here's another example in the .inc file vernacular of a set up as follows: MX6SX, UART5 on SD4_DATA4 abd SD4_DATA5 (assume clock is ungated to all peripherals): setmem /32 0x020E0294 = 0x2 //IOMUXC_SW_MUX_CTL_PAD_SD4_DATA5, ALT2; UART5_TX_DATA setmem /32 0x020E0290 = 0x2 //IOMUXC_SW_MUX_CTL_PAD_SD4_DATA4, ALT2; UART5_RX_DATA setmem /32 0x020E0850 = 0x00000000 // IOMUXC_UART5_IPP_UART_RXD_MUX_SELECT_INPUT, daisy chain for UART5_RX input to use SD4_DATA4 setmem /32 0x021F4080 = 0x00000001 // Enable UART_EN in UCR1 of UART5 // Disable UART_EN in UCR1 of UART1, UART2, UART3, and UART4 setmem /32 0x02020080 = 0x00000000 // UART1 setmem /32 0x021F0080 = 0x00000000 // UART2 setmem /32 0x021EC080 = 0x00000000 // UART3 setmem /32 0x021E8080 = 0x00000000 // UART4   Related Resources Links: iMX 8M Mini Register Programming Aid DRAM PLL setting  i.MX 8/8X Series DDR Tool Release  i.MX 8M Family DDR Tool Release 
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