i.MX Processors Knowledge Base

cancel
Showing results for 
Search instead for 
Did you mean: 

i.MX Processors Knowledge Base

Discussions

GmSSL is an open source cryptographic toolbox that supports SM2 / SM3 / SM4 / SM9 and other national secret (national commercial password) algorithm, SM2 digital certificate and SM2 certificate based on SSL / TLS secure communication protocol to support the national security hardware password device , To provide in line with the national standard programming interface and command line tools, can be used to build PKI / CA, secure communication, data encryption and other standards in line with national security applications. For more information, please access GmSSL official website http://gmssl.org/english.html.   Software environments as the belows: Linux kernel: imx_4.14.98_2.0.0_ga cryptodev: 1.9 HW platform: i.MX6UL, i.MX7D/S, i.MX8M/MM, i.MX8QM/QXP. The patches include the following features: 1, Support SM2/SM9   encryption/decryption/sign/verify/ key exchange ,   RSA  encryption/decryption, DSA/ECDSA sign/verify, DH/ECDH key agreement, ECC & DLC & RSA key generation and big number  operation and   e lliptic  c urve   m ath by CAAM hardware   accelerating . 2, run "git apply 0001-Enhance-cryptodev-and-its-engine-in-GmSSL-by-CAAM-s-.patch" under folder sources/poky, and "git apply 0001-Add-public-key-cryptography-operations-in-CAAM-drive.patch"   under folder   sources/meta-fsl-bsp-release for patch these codes. 3, GmSSL Build command: $ tar zxvf GmSSL-master-iMX.tgz $  cd  GmSSL-master-iMX (For i.MX8M/MM, i.MX8QM/QXP) $  source /opt/arm-arch64/environment-setup-aarch64-poky-linux  $  ./Configure -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS -DHW_ENDIAN_SWAP  --prefix= ~/install64   --openssldir=/etc/gmssl --libdir=/usr/lib no-saf no-sdf no-skf no-sof no-zuc -no-ssl3 shared linux-aarch64 $  make  $  make install                              /*image and config file will be installed to folder   ~ /install64   */   (For  i.MX6UL, i.MX7D/S ) $   source /opt/arm-arch32/environment-setup-cortexa7hf-neon-poky-linux-gnueabi $   ./Configure -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS --prefix= ~ /install32   --openssldir=/etc/gmssl --libdir=/usr/lib no-saf no-sdf no-skf no-sof no-zuc -no-ssl3 shared linux-armv4 $  make  $  make install                             /*image and config file will be installed to folder   ~ /install32   */   4, How to use GmSSL: copy image gmssl to /usr/bin on i.MX board;  copy  gmssl libcrypto.so.1.1 and libssl.so.1.1 to /usr/lib  on i.MX board; copy folder etc/ gmssl to /etc/ on i.MX board. copy test examples (dhtest, dsatest, rsa_test, ecdhtest, ecdsatest, eciestest, sm3test, sms4test, sm2test, sm9test) under GmSSL-master-iMX/test  to U disk for running. You can run test examples by the following commands: #insmod /lib/modules/4.14.98-imx_4.14.98_2.0.0_ga+g5d6cbeafb80c/extra/cryptodev.ko #/run/media/sda1/dhtest #/run/media/sda1/dsatest #/run/media/sda1/rsa_test #/run/media/sda1/ecdhtest #/run/media/sda1/ecdsatest #/run/media/sda1/eciestest #/run/media/sda1/sm3test #/run/media/sda1/sms4test #/run/media/sda1/sm2test #/run/media/sda1/sm9test and speed test commands: #gmssl speed sm2 #gmssl genrsa -rand -f4 512 #gmssl speed dsa #gmssl genrsa -rand -f4 1024 #gmssl speed rsa #gmssl genrsa -rand -f4 2048 #gmssl speed ecdsa #gmssl genrsa -rand -f4 3072 #gmssl speed ecdh #gmssl genrsa -rand -f4 4096   ++++++++++++++++++++++++++++     updating at 2019-09-10    +++++++++++++++++++++++++++++++++++++++++++++ 0001-fix-the-bug-which-hash-and-cipher-key-don-t-use-DMA-.patch fix the issue which   dismatching on key buffer between crytodev and caam driver. Crytodev uses stack's buffer for key storage and caam driver use it to dma map which cause flush cache failure. The patch need to apply on cryptodev-module in Yocto build.   ++++++++++++++++++++++++++++     updating at 2019-10-14   +++++++++++++++++++++++++++++++++++++++++++++ This updating is for China C-V2X application. The package meta-cv2x_4.14.98_2.0.0_ga.tgz is Yocto layer which bases on GmSSL and Cryptodev. I add HW SM2 verification by dedicated CAAM job descriptor and enhanced SW  SM2 verification by precomputed multiples of generator and ARMv8 assembler language to accelerate point  operation.  Software environments as the belows: Linux kernel: imx_4.14.98_2.0.0_ga cryptodev: 1.9 HW platform: i.MX8M/MM/MN, i.MX8QM/QXP. How to build: 1, decompress  meta-cv2x_4.14.98_2.0.0_ga.tgz and copy meta-cv2x to folder (Yocto 4.14.98_2.0.0_ga dir)/sources/ 2, Run DISTRO=fsl-imx-wayland MACHINE=imx8qxpmek source fsl-setup-release.sh -b build-cv2x and add BBLAYERS += " ${BSPDIR}/sources/meta-cv2x " into ( Yocto 4.14.98_2.0.0_ga dir ) /build-cv2x/conf/bblayers.conf and  IMAGE_INSTALL_append += " gmssl-bin "  into local.conf 3, Run bitbake fsl-image-validation-imx. 4, You can find  cv2x-verify.c under (build dir)/tmp/work/aarch64-poky-linux/cryptodev-tests/1.9-r0/git/tests. It is example for using CAAM cryptdev interface to do C-V2X verification (includes SM2 p256, NIST p256 and brainpoolP256r1).   cv2x_benchmark.c   under ( build dir )/tmp/work/aarch64-poky-linux/gmssl/1.0-r0/gmssl-1.0/test is the benchmark test program of C-V2X verifying. It includes HW, SW and HW+SW(one CPU) verifying for  SM2 p256, NIST p256 and brainpoolP256r1. 5, Run the below command on your i.MX8QXP MEK board. modprobe cryptodev ./cv2x_benchmark Note: the udpated GmSSL also support projective coordinates and affine coordinates (CAAM only support affine  coordinates ). Affine  coordinates is used  by default. You can call EC_GROUP_set_coordinates() and EC_GROUP_restore_coordinates() to change coordinates and restore default. When you hope to use some EC APIs under expected coordinates, you need to call EC_GROUP_set_coordinates() before EC APIs and  EC_GROUP_restore_coordinates()  after them. Like the below example: orig_coordinate = EC_GROUP_set_coordinates(EC_PROJECTIVE_COORDINATES); group = EC_GROUP_new_by_curve_name(NID_sm2p256v1); EC_GROUP_restore_coordinates(orig_coordinate);   ++++++++++++++++++++++++++++     updating at 2020-11-09   +++++++++++++++++++++++++++++++++++++++++++++ This updating is for Yocto release of Linux 5.4.47_2.2.0​​. The package meta-gmcrypto_L5.4.47-2.2.0.tgz is Yocto layer which also support c-v2x feature in previous release .  Software environments as the belows: Linux kernel: imx_5.4.47_2.2.0 cryptodev: 1.10 HW platform: i.MX6UL, i.MX7D/S, i.MX8M/8M Mini/8M Nano/8M Plus, i.MX8/8X. How to build: 1, decompress meta-gmcrypto_L5.4.47-2.2.0.tgz and copy meta-gmcrypto to folder (Yocto 5.4.47_2.2.0 dir)/sources/ 2, Run DISTRO=fsl-imx-wayland MACHINE=imx8mmevk source imx-setup-release.sh -b build-imx8mmevk and add BBLAYERS += " ${BSPDIR}/sources/meta-gmcrypto " into ( Yocto 5.4.47_2.2.0 dir ) /build-imx8mmevk/conf/bblayers.conf and  IMAGE_INSTALL_append += " gmssl-bin "  into local.conf 3, Run bitbake fsl-image-validation-imx. 4, You can find  cv2x-verify.c under (build dir)/tmp/work/aarch64-poky-linux/cryptodev-tests/1.10caam-r0/git/tests. It is example for using CAAM cryptdev interface to do C-V2X verification (includes SM2 p256, NIST p256 and brainpoolP256r1).   cv2x_benchmark.c   under ( build dir )/tmp/work/aarch64-poky-linux/gmssl/1.0-r0/gmssl-1.0/test is the benchmark test program of C-V2X verifying. It includes HW, SW and HW+SW(one CPU) verifying for  SM2 p256, NIST p256 and brainpoolP256r1. 5, Run the below command on your i.MX8M Mini evk board. modprobe cryptodev ./cv2x_benchmark gmssl speed sm2 gmssl speed dsa gmssl speed rsa gmssl speed ecdsa gmssl speed ecdh gmssl genrsa -rand -f4 -engine cryptodev 4096 Note: 1, the udpated GmSSL also support projective coordinates and affine coordinates (CAAM only support affine  coordinates ). Affine  coordinates is used  by default. You can call EC_GROUP_set_coordinates() and EC_GROUP_restore_coordinates() to change coordinates and restore default. When you hope to use some EC APIs under expected coordinates, you need to call EC_GROUP_set_coordinates() before EC APIs and  EC_GROUP_restore_coordinates() after them. Like the below example: orig_coordinate = EC_GROUP_set_coordinates(EC_PROJECTIVE_COORDINATES); group = EC_GROUP_new_by_curve_name(NID_sm2p256v1); EC_GROUP_restore_coordinates(orig_coordinate); 2, Yocto Zeus integrates openssl 1.1.1g, so I change library name of gmssl from libcrypto to libgmcrypto and from libssl to libgmssl to avoid name confliction with openssl 1.1.1g (lib name are also libcrypto.so.1.1 and libssl.so.1.1). You should use -lgmcrypto and -lgmssl when you link gmssl library instead of -lcrypto and -lssl.
View full article
1. HW Environment:     IMX8mm-evk board.     ITE6122 mipi dsi to lvds bridge board.     B101UAN02.1 1920x1200 LVDS panel   2. SW Environment:     IMX YOCTO 4.14.98-2.0.0ga release.   3. Patch operation:     a. git clone https://source.codeaurora.org/external/imx/linux-imx.git     b. git checkout -b  imx_4.14.98_2.0.0_ga remotes/origin/imx_4.14.98_2.0.0_ga     c. patch -p1 < ../ite6122_imx8mm_4.14.98ga_18c3fd8837fc3c6_0512.patch   4. Tested on imx8mm-evk board:   5. Attached doc list:      i.MX8MM(MN)_IT6122FN_ user guide_V0.20.pdf ------  ite6122 bridge board HW guide      i.MX8MM(MN)_IT6122FN_V11_20200513.pdf  ------   ite6122 bridge board SCH      ite6122_imx8mm_4.14.98ga_18c3fd8837fc3c6_0512.patch  ------  Linux kernel driver patch      B101UAN02.1_Ver1.0.pdf -------  panel spec              2020/10/30: 6122-hw-version-2010-10-30.zip ------ updated new HW design.        
View full article
BSP: L5.4.47-2.2.0-rc2 Board: imx8QM B0 HW:  LVDS2HDMI , MIPIDSI2HDMI. It is the porting of i.MX8QM dpu loopback to isi . to the 5.4.y, with the addition of the MIPI-DSI loopback and the HDMI loopback.  Overview of the DC capture configuration: For enabling the capture: only DC 0 Stream 0  and DC 1 Stream 1 can be captured The pixel link Master address should be set to 3 because the Receiver Address at ISI is 3 and can't be changed. To continue displaying the stream, the Receiver Address at LVDS and DSI or HDMI should be changed to 3. It is possible to change the RA by using GPIO of the modules.   Patches: Create V4L2 device enabling the capture of by the ISI of DC loop-backs. Enable ISI capture from DSI 0 / LVDS 1 in 1920x1080 (at the same time.) Enable ISI capture from HDMI in 2840x2160 (half with even pixel) in 1920x2160. While capturing with the ISI, the captured screen continue to be displayed. Remark: Ov5640 cameras are also enabled in the same dtb. So 4 stream in 1920x1080 can be captured at the same time. Installation and gstreamer command: See readme
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.   This is a detailed programming aid for the registers associated with i.MX 8/8X DDR initialization.  For more details, refer to the i.MX 8/8X main DDR tools page: https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8-8X-Family-DDR-Tools-Release/ta-p/1121519   To reduce the number of attachments, older RPAs may be found in the attached zip file.
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.   This is a detailed programming aid for the registers associated with i.MX 8/8X DDR initialization.  For more details, refer to the i.MX 8/8X main DDR tools page: https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8-8X-Family-DDR-Tools-Release/ta-p/1121519   To reduce the number of attachments, older RPAs may be found in the attached zip file.
View full article
Harware: - i.MX7D-SDB board - QCA9880 card with MINI PCIe Interface The Wifi module is connected to the PCIe slot on the board.     Software: - Ubuntu 18.04 LTS Host - L4.19.35_1.1.0 BSP   Tool: - uuu 1.2.68 for linux (run on ubuntu host)   Toolchain: - The toolchain can be obtained from the Yocto BSP. Please read and follow the steps in i.MX_Yocto_Project_User's_Guide to build the BSP and then read the Chapter of "How to build U-Boot and Kernel in standalone environment" in i.MX_Linux_User's_Guide to build the toolchain.   Build the Kernel: # mkdir imx_build # cd imx_build # git clone https://source.codeaurora.org/external/imx/linux-imx -b imx_4.19.35_1.1.0 # cd linux-imx # source /opt/fsl-imx-fb/4.19-warrior/imx6/environment-setup-cortexa9hf-neon-poky-linux-gnueabi # export ARCH=arm # make clean # make imx_v7_defconfig # make menuconfig - Select the PCIe driver and the Wifi support - PCI controller drivers--->                    DesignWare PCI Core Support----> - Networking support----->                             Wireless----->   - Select the ath10 driver (it supports QCA988X) Device Drivers---->             Network device support----->                                      Wirless LAN----> - Save and Exit. - Add the firmware in the .config file: Get the firmware file (e.g. firmware-2.bin) from your wifi vendor or download it from the web. Put the firmware in linux-imx/firmware/ folder. Edit the .config file and add these two lines: CONFIG_EXTRA_FIRMWARE="board.bin firmware-2.bin" CONFIG_EXTRA_FIRMWARE_DIR="/home/jimmy/imx_build/linux-imx/firmware" - Build the kernel # make Then the zImage will be obtained in arch/arm/boot.   Using uuu to program the SD card: - Downloading demo image of L4.19.35_1.10 from the nxp website. - Copy the zImage to the directory - Copy the uuu (V1.2.68) to the directory - Copy the samples/example_kernel_emmc.uuu to imx7d_kernel_emmc.uuu - Modify the image the imx7d_kernel_emmc.uuu - In the demo image, you will see the files like this: - run uuu and the script to program the images.   Wifi driver loaded and wlan0 is up: # dmesg | grep pci   # ifconfig -a   Reference Document: - i.MX_Linux_User's_Guide.pdf - i.MX_Porting_Guide.pdf  
View full article
As of this writing, April 2015, the default sdcard image created from a Yocto Project build has all the software images nicely aligned to create a SDCARD. 10/7/2020: Update - SDCARD image names have been updated to images ending with .wic as the default from Yocto Project.  The process is the same for both .sdcard and .wic files.   There are two partitions within the image: A W95 FAT32 (LBA) partition that contains the Linux zImage, and various device tree binary (dtb) files A Linux root file system. Each partition can be mounted from your Linux host computer, then you can read or write the partition contents. Here are the steps based on the core-image-base recipe for the imx6sxsabresd machine using Yocto Project release L3.14.28_1.0.0_GA.   The name of the image: core-image-base-imx6sxsabresd.sdcard Run the fdisk command to view the contents of the image: $ fdisk -l core-image-base-imx6sxsabresd.sdcard Disk core-image-base-imx6sxsabresd.sdcard: 100 MB, 100663296 bytes 4 heads, 32 sectors/track, 1536 cylinders, total 196608 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00074663 Device Boot Start End Blocks Id System core-image-base-imx6sxsabresd.sdcard1 8192 24575 8192 c W95 FAT32 (LBA) core-image-base-imx6sxsabresd.sdcard2 24576 188415 81920 83 Linux   Determine the byte offset into the sdcard image of where each partition starts:  core-image-base-imx6sxsabresd.sdcard1 starts at sector 8192. One sector unit is 512 bytes.                 8192 * 512 = 4194304 core-image-base-imx6sxsabresd.sdcard2 starts at sector 24576. 24576 * 512 = 12582912   Mount Partitions First create mount points: $ sudo mkdir /mnt/{mp1,mp2}    sdcard1 partition $ sudo mount -o loop,offset=4194304 core-image-base-imx6sxsabresd.sdcard /mnt/mp1 NOTE: An alternate method for determining the offset, see below: $ sudo mount -o loop,offset=$((512 * 8192)) core-image-base-imx6sxsabresd.sdcard /mnt/mp1 sdcard2 partition $ sudo mount -o loop,offset=12582912 core-image-base-imx6sxsabresd.sdcard /mnt/mp2 View the contents of each mounted partition $ ls /mnt/mp1 imx6sx-sdb.dtb imx6sx-sdb-lcdif1.dtb imx6sx-sdb-reva.dtb imx6sx-sdb-sai.dtb imx6sx-sdb-emmc.dtb imx6sx-sdb-m4.dtb imx6sx-sdb-reva-ldo.dtb zImage $ ls /mnt/mp2 bin boot dev etc home lib lost+found media mnt proc run sbin sys tmp usr var   When done release the mount points and remove them from /mnt $ sudo umount /mnt/{mp1,mp2} $ sudo rm /mnt/{mp1,mp2}  
View full article
To enable USB 2.0 port on BB for USB OTG, you need to apply below two changes: device/fsl.git   diff --git a/imx8q/mek_8q/init.usb.rc b/imx8q/mek_8q/init.usb.rc index af4e388..0f3ab0b 100644 --- a/imx8q/mek_8q/init.usb.rc +++ b/imx8q/mek_8q/init.usb.rc @@ -44,7 +44,7 @@ on early-boot      mount functionfs mtp /dev/usb-ffs/mtp rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1      mount functionfs ptp /dev/usb-ffs/ptp rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1      setprop sys.usb.mtp.device_type 3 -    setprop vendor.usb.config "5b110000.usb3" +    setprop vendor.usb.config "ci_hdrc.0"      write /sys/module/libcomposite/parameters/disable_l1_for_hs "y"      symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1   vendor/nxp-opensource/kernel_imx.git           revert below patch:           commit 2f9586c120971312e61df464264993899cf34536           Author: yang.tian <yang.tian@nxp.com>           Date:   Tue Jan 7 13:30:02 2020 +0800       MA-15242 Set usb2.0 port as usb host only for mek_8q  
View full article
This document is a user guide for the GStreamer version 1.0 based accelerated solution included in all the i.MX 8 family SoCs supported by NXP BSP L5.4.24_1.1.0. Some instructions assume a host machine running a Linux distribution, such as Ubuntu, connected to i.MX 8 device. These commands were tested using Ubuntu 18.04 LTD, and while Ubuntu is not required on the host machine, other distributions have not been tested. These instructions are targeted for use with the following hardware: • i.MX 8MQ EVK • i.MX 8MN EVK • i.MX 8MN EVK • i.MX 8QXP MEK B0 • i.MX 8QM MEK B0   Release History v1.0 - Mar 2020 - Initial release. v2.0 - Sep 2020: Added the following content: - Mux/Demux Examples - Audio Examples - Image Examples - Transcode Examples - Streaming Examples - Multi-Display Examples - Scaling and Rotation Examples - Zero-copy Examples - Debug Examples Maintainers: . Marco Franchi . Pedro Jardim
View full article
1. HW Environment:     IMX8mp-evk board.     ITE6151 mipi dsi to eDP bridge board.   2. SW Environment:       IMX YOCTO 5.4.24-2.1.0 release.   3. Patch operation:     a. git clone   https://source.codeaurora.org/external/imx/linux-imx.git     b. git checkout -b  imx_5.4.24_2.1.0 origin/imx_5.4.24_2.1.0     c. patch -p1 < ../ite6151_mipi2edp_linux_5.4.24_20200921.patch   4. Tested on imx8mp-evk board with DP monitor on 1080p mode: 5. Attached doc list:     IT6151 demo board user guide v1.0.pdf ------  ite6151 bridge board HW guide     it6151_qfn48_v20_20190905-01_end.pdf  ------   ite6151 bridge board   SCH     imx8mp_ite6151_mipi2edp_linux_5.4.24_20200921.patch ------  Linux kernel driver patch     Image + imx8mp-evk-it6151.dtb  ------  test image and dtb  
View full article
After following instructions on how to change DRAM PLL frequency, here is a quick comparison of Stream, running on the i.MX 8MM. Normalized to LPDDR4-3000, based on  5.4.24_2.1.0​ BSP Stream LP4-3000 LP4-2400 DDR4-2400 LPDDR-1866 Copy: 1 0.810 0.735 0.497 Scale: 1 0.896 0.765 0.756 Add: 1 0.899 0.683 0.762 Triad: 1 0.902 0.680 0.767      
View full article
Description       This doc explain how to enable the plugin boot on i.MX6Q/6DL and which used for change the pll2 clock and add the spread spectrum support to pass the EMI test. we still list the source codes of 3.0.35 and 4.1.15. to explain the dts/non-dts kernel support.       本文旨在说明如何在i.MX6Q/6DL上实现plugin启动,以支持展频和改变pll2的频率,其目的是为了通过 EMI测试。也附上了基于3.0.35和4.1.15的源代码,以供参考   Products Product Category NXP Part Number URL MPU i.MX6 Family https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/i-mx-applications-processors/i-mx-6-processors:IMX6X_SERIES   Tools NXP Development Board URL i.MX6 SabreSDP https://www.nxp.com/design/development-boards:EVDEBRDSSYS#/collection=softwaretools&start=0&max=25&query=typeTax%3E%3Et633::archived%3E%3E0::Sub_Asset_Type%3E%3ETSP::deviceTax%3E%3Ec731_c380_c127_c126&sorting=Buy%2FSpecifications.desc&language=en&siblings=false          Version: MX6Q_PLUGIN_FC_SSC_V7-20200915_chn..pdf(chinese version)add baidou support MX6Q_PLUGIN_FC_SSC_V7-20170504_eng-chapter-imx6dl.doc+MX6Q_PLUGIN_FC_SSC_V3-20170309_eng.doc(english version)      
View full article
- In LTIB generate a rootfs.jffs2 with a erase block size of 16KB: ./ltib -c ---Target Image Generation   Options ---> ---Choose your root file system image type     Target image: (jffs2) --->   (16) jffs2 erase block size in KB - Copy the generated rootfs.jffs2 to /tftpboot : cp rootfs.jffs2 /tftpboot - Program 200732 Redboot binary. The 200732 Redboot is available in the 20071008 BSP iso. After mounting the iso go to the bootloaders directory, extract the redboot_200732.tar.gz file and use the pre-built mx31ads_redboot.bin inside the bin directory. - Boot from NAND and setup the network parameters fis init load -r -b 0x100000 /tftpboot/zImage fis create -l 0x200000 kernel load -r -b 0x100000 /tftpboot/rootfs.jffs2 fis create -l 0x1d000000 root - Pass the following kernel command line: fis load kernel exec -b 0x100000 -l 0x200000 -c "noinitrd console=ttymxc0,115200 root=/dev/mtdblock6 rootfstype=jffs2 init=linuxrc ip=none mtdparts=mx" You need to replace mtdblock6 with your rootfs partition, see below: mx31# cat /proc/mtd dev:    size  erasesize  name mtd0: 00040000 00020000 "RedBoot" mtd1: 001a0000 00020000 "kernel" mtd2: 0001f000 00008000 "FIS directory" mtd3: 00001000 00008000 "RedBoot config" mtd4: 00040000 00004000 "RedBoot" mtd5: 00200000 00004000 "kernel" mtd6: 01d00000 00004000 "root" mtd7: 00003000 00004000 "FIS directory" mtd8: 00001000 00004000 "RedBoot config" mx31#
View full article
How to connect i.MX51 and Ubuntu using USB cable: i.MX51 Side Plug in USB cable. getprop debug.adb.usb - Shows that debug.adb.usb are not set by default setprop persist.service.adb.enable 0 -> disable adb setprop debug.adb.usb 1 - adb will be through USB (for Ethernet, use setprop debug.adb.usb 0) setprop persist.service.adb.enable 1 -> enable adb Example: # getprop debug.adb.usb  # # # setprop persist.service.adb.enable 0 disabling adb # adb_release android_usb gadget: high speed config #1: android setprop debug.adb.usb 1 # # setprop persist.service.adb.enable 1 enabling adb # adb_open adb_release adb_open android_usb gadget: high speed config #1: android # Ubuntu Side On Ubuntu side, the most important tip is regarding permission. ADB server MUST be started with root right. Example of right mistake: $ sudo <AND_SDK_DIR>/android-sdk-linux_86/tools/adb devices List of devices attached ????????????    no permissions  $ sudo <AND_SDK_DIR>/android-sdk-linux_86/tools/adb shell error: insufficient permissions for device How to proceed to get permission: $ sudo <AND_SDK_DIR>/android-sdk-linux_86/tools/adb kill-server $ sudo <AND_SDK_DIR>/android-sdk-linux_86/tools/adb start-server * daemon not running. starting it now * * daemon started successfully * $ sudo <AND_SDK_DIR>/android-sdk-linux_86/tools/adb devices List of devices attached 0123456789ABCDEF    device  $ sudo <AND_SDK_DIR>/android-sdk-linux_86/tools/adb shell ADB over Ethernet/Wi-Fi To make ADB work in i.MX51 using TCP: In your host machine: - Install Android SDK - export ADBHOST=BOARD_IP (setenv ADBHOST=xxx.xxx.xxx.xxx) - adb kill-server In your board: - make sure that ro.secure property is *not* set when the adbd daemon is launched, so edit the file default.prop - make sure that /dev/android_adb or /dev/android do *not* exist - stop adbd - start adbd Now you will be able to list the device: hamilton@saygon:/opt/work/androidsdk/android-sdk-linux_86/tools$ ./adb kill-server hamilton@saygon:/opt/work/androidsdk/android-sdk-linux_86/tools$ ./adb devices * daemon not running. starting it now * * daemon started successfully * List of devices attached emulator-5554   device
View full article
Creating an image A kernel image and a root file system can be created using 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 0x40000 -s 0x800 -n -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 connection errors can be avoided by Configuring RedBoot. The process below uses TFTP to copy the files between host and target. Copy the kernel image and the root file system image to the TFTP dir. For example, in All Boards 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 fis create -f 0x100000 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 i.MX35 PDK) fis create -f 0x600000 root 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/ltib 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/mtdblock8 /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/mtdblock8 rw rootfstype=jffs2 ip=dhcp" >> 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
In order to get USB cameras (web cams) working on i.MX 51 EVK board running Ubuntu, a few steps must be followed, and they are: Enable USB Camera's drivers on Kernel Test it using Gstreamer or another compatible software (as Cheese) Kernel Driver USB cameras (web cameras) on Linux work over GSPCA driver, to enable this driver you need to go to: ./ltib -c   [*] Configure the kernel     Device Drivers -->          Multimedia Devices -->               [*] Video Capture Adapters -->                    [*] V4L USB Devices -->                         <*> USB Video Class (UVC)                                      [*] UVC input events device support                         <*> GSPCA Based WebCams --> From this point, you need to choose your specific driver. If you don't know, you can select all of those options as a built-in module "<*>" that will work. GSPCA Drivers USB Camera Detection Connect your USB camera to the USB Host port on i.MX 51 EVK board and then type "dmesg", and also check if there is a video0 device using: ubuntu@ubuntu-desktop:~$ ls /dev/video0 /dev/video0 USB Camera Detection Gstreamer Command Line In order to test your USB camera using Gstreamer plugin, use the following command line to perform it: ubuntu@ubuntu-desktop:~$ gst-launch-0.10 v4l2src ! ffmpegcolorspace ! ximagesink and the results: Hi there !!! EOF !
View full article
The system controller timer service is responsible for: Watchdog - The watchdog resource is managed by the SCU. The SCFW exposes a "virtual" watchdog to all CPUs. This virtual watchdog is managed by software and it is based on a low power timer, the SCU also features a physical watchdog timer that is used to ensure the correct operation of the device. Some of the features implemented by this watchdog service are: - Update of the watchdog timeout - Start/stop of the watchdog - Refresh of the watchdog - Return of the watchdog status such as maximum watchdog timeout that can be set, watchdog timeout interval, and watchdog timeout interval remaining. Since this is usually handled by the OS itself no examples are provided in this guide. Real Time Clock (RTC) - The SCFW is responsible for providing access to the RTC. The features supported by the API are: - Set/get time - Setting alarms Only the partition that owns the SC_R_SYSTEM resource is allowed to set the time, alarms and calibration values for the RTC. All other partitions are able to read the RTC time.  Here is an example on setting the RTC from the M4 side: struct time_date { uint16_t year ; uint8_t month ; uint8_t day ; uint8_t hour ; uint8_t min ; uint8_t sec ; } rtc_time ; sc_err_t sc_status ; sc_ipc_t ipc ; /* Open IPC channel */ sc_status = sc_ipc_open ( & ipc , SC_IPC_AP_CH0 ) ; if ( sc_status != SC_ERR_NONE ) printf ( "Error opening Inter Processor Channel\n" ) ; /* Initialize RTC */ /* Hard code RTC time to January 5th 2018 at 12:00 hours */ sc_status = sc_timer_set_rtc_time ( ipcHandle , 2018 , 1 , 5 , 12 , 0 , 0 ) ; if ( sc_status != SC_ERR_NONE ) printf ( "Error initializing RTC. \r\n" ) ; /* Return time */ sc_status = sc_timer_get_rtc_time ( ipcHandle , & ( rtc_time . year ) , & ( rtc_time . month ) , & ( rtc_time . day ) , & ( rtc_time . hour ) , & ( rtc_time . min ) , & ( rtc_time . sec ) ) ; printf ( "Year: %d, Month: %d, Day: %d, Hour: %d, Minutes: %d, Seconds: %d. \r\n" , rtc_time . year , rtc_time . month , rtc_time . day , rtc_time . hour , rtc_time . min , rtc_time . sec ) ; ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ https://community.nxp.com/docs/DOC-342654 
View full article
About this document This document describe the setup detail for Interfacing, Installing, programming (basis) and testing depth cameras with MX6QDL based boards using Ubuntu as rootfs on i.MX6 processors boards. 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 Depth sensors tested: Microsoft Kinect, ASUS Xtion. Prime Sense Carmine Software:   Gcc, Ubuntu 14.04v,  Openni, Python, ROS. 1. Depth Sensor Depth sensors are 3D vision sensors, mainly used in 3D vision application and motion gaming and robotics. For this paper we are going to use Kinect sensor and Asus Xtion connection to i.MX6 Processor boards and will get 3D images that are converted to finer points called point cloud. a) Microsoft Kinect Kinect mainly has an IR camera, IR projector and RGB camera, the IR and projector generates the 3D point cloud of the surroundings. It also has a mic array and motorized tilt for moving up and down. Kinect reveal that both the video and depth sensor cameras have a 640 x 480-pixel resolution and run at 30 FPS (frames per second). The RGB camera capture 2D color images, whereas the depth camera captures monochrome depth images. Kinect has a depth sensing range from 0.8mts to 3.5 mts b) Asus Xtion: Another alternative to kinect is Asus Xtion Pro.  Is a 3D sensor designed for motion sensing applications, this sensor is only for 3D sensing and it doesn’t have sound sensing. It has an infrared projector and a monochrome CMOS sensor to capture the infrared data. Xtion can be powered from USB itself and can calculate a sense depth from 0.8mts to 3.5 mts from the sensor. c) Prime Sense Carmine: The Prime Sense team (apple bought this company in November 2013) developed the Microsoft Kinect 3D vision, later develop their own 3D vision sensor Carmine. It also works with IR projector, RGB CMOS sensor and a depth CMOS sensor. All sensor are interfaced in System On Chip and is powered trough USB. Carmine capture 640x480 at 30 FPS and can sense from 0.35 mts to 3 mts. Developers can program the device using OpenNI and its wrapper libraries. All these sensors (Kinect, Carmine and Xtion) support the same software, so there is no special need for programming or general usage. Can be interface to i.MX processor using USB 2.0 interface and programmed using OPENNI and OPENCV. 2. Installation on Ubuntu For installation steps of Ubuntu trusty on iMX6 boards in your board, please follow up: https://community.freescale.com/docs/DOC-330147 Install the dependencies: $ sudo apt-get install -y g++ git python libusb-1.0-0-dev libudev-dev freeglut3-dev doxygen graphviz openjdk-6-jdk libxmu-dev libxi-dev Create a devel folder $  sudo mkdir –p devel $ cd devel Get OpenNI and the drivers $ git clone https://github.com/OpenNI/OpenNI.git -b unstable $ git clone git://github.com/ph4m/SensorKinect.git $ git clone https://github.com/PrimeSense/Sensor.git -b unstable Set the compile flags to build for the i.MX $ nano OpenNI/Platform/Linux/CreateRedist/Redist_OpenNi.py From: MAKE_ARGS += ' -j' + calc_jobs_number() To: MAKE_ARGS += ' –j2' Must also change the Arm compiler settings for this distribution $ nano OpenNI/Platform/Linux/Build/Common/Platform.Arm From: CFLAGS += -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp #-mcpu=cortex-a8 To: CFLAGS += -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard Then run $ cd OpenNI/Platform/Linux/CreateRedist/ $ ./RedistMaker.Arm $ cd ../Redist/OpenNI-Bin-Dev-Linux-Arm-v1.5.x.x $ sudo ./install.sh Also edit the Sensor and SensorKinect makefile CFLAGS parameters $cd ~/devel/ $ nano Sensor/Platform/Linux/Build/Common/Platform.Arm $ nano  SensorKinect/Platform/Linux/Build/Common/Platform.Arm For both files From: CFLAGS += -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp #-mcpu=cortex-a8 To: CFLAGS += -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard And the Sensor and SensorKinect redistribution scripts $ nano Sensor/Platform/Linux/CreateRedist/RedistMaker $ nano SensorKinect/Platform/Linux/CreateRedist/RedistMaker for both, change: make -j$(calc_jobs_number) -C ../Build to: make –j2 -C ../Build The create the redistributables Sensor (xtion and primesense) and Kinect (sensor Kinect) $ cd Sensor/Platform/Linux/CreateRedist/ $ ./RedistMaker Arm $ cd ~/devel/ $ cd SensorKinect/Platform/Linux/CreateRedist/ $ ./RedistMaker Arm $ cd ~/devel/ Then install PrimeSense and Kinect $ cd Sensor/Platform/Linux/Redist/Sensor-Bin-Linux-Arm-v5.1.x.x $ sudo ./install.sh $ cd ~/devel/SensorKinect/Platform/Linux/Redist/Sensor-Bin-Linux-Arm-v5.1.2.x $ sudo ./install.sh 3. Testing Installation: Connect the sensor power supply , Connect the Kinect to the NXP board USB port. (check with lsusb) . For my board: Imx6q@imx6q:~/devel$ lsusb Bus 001 Device 022: ID 045e:02ae Microsoft Corp. Xbox NUI Camera Bus 001 Device 021: ID 045e:02ad Microsoft Corp. Xbox NUI Audio Bus 001 Device 019: ID 045e:02c2 Microsoft Corp. Kinect for Windows NUI Motor Now edit theglobal Kinect settings in Ubuntu $ sudo nano /usr/etc/primesense/GlobalDefaultsKinect.ini and uncomment this line UsbInterface=1 and changed it to 1 instead of 2 UsbInterface=2 $ sudo modprobe -r gspca_kinect And then blacklisting to avoid it to be auto-loaded on boot: $ sudo sh -c 'echo "blacklist gspca_kinect" > /etc/modprobe.d/blacklist-kinect.conf' Then: $ cd ~/devel/OpenNI/Platform/Linux/Bin/Arm-Release $ sudo ./Sample-NiSimpleRead You should get something like: Reading config from: '../../../../Data/SamplesConfig.xml' … Frame 40 Middle point is: 5050. FPS: 30.771788 Frame 41 Middle point is: 5050. FPS: 30.866173 Frame 42 Middle point is: 5050. FPS: 30.850958 Frame 43 Middle point is: 5050. FPS: 30.779032 Frame 44 Middle point is: 5050. FPS: 30.767746 Frame 45 Middle point is: 5050. FPS: 30.800463 Frame 46 Middle point is: 5050. FPS: 30.653118 Frame 47 Middle point is: 5050. FPS: 30.741659 Frame 98 Middle point is: 5050. FPS: 30.339321 LibFreenect: $ cd ~/devel/ $ git clone https://github.com/OpenKinect/libfreenect.git $ cd libfreenect $ mkdir build $ cd build $ cmake .. –L –DBUILD_AUDIO=ON $ make $ sudo make install Connect the kinect sensor power supply , connect the Kinect to the NXP board USB port and t est any sample such as: $ sudo freenect-glview Note: If glview gives a shared library error: You need to refresh your ldconfig cache. The easiest way to do this is to create a file usr-local-libs.conf (or whatever name you wish) with the following lines: /usr/local/lib Switch to root account and move it to /etc/ld.so.conf.d/usr-local-libs.conf. Then update the ldconfig cache: $ su root $ mv ~/usr-local-libs.conf /etc/ld.so.conf.d/usr-local-libs.conf $ /sbin/ldconfig –v $ exit References: 1)      https://openkinect.org/ 2)      https://www.asus.com/us/3D-Sensor/Xtion_PRO_LIVE/ 3)      Learning Robotics using phyton by Lentin Joseph. http://www.amazon.com/Learning-Robotics-Python-Lentin-Joseph/dp/1783287535/ref=sr_1_1 4)      Computer Vision on i.MX Processors
View full article