i.MX Processors Knowledge Base

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

i.MX Processors Knowledge Base

Discussions

Sort by:
The Linux L4.9.88_2.0.0 Rocko, i.MX7ULP Linux/SDK2.4 RFP(GA) release files are now available. Linux on IMX_SW web page, Overview -> BSP Updates and Releases ->Linux L4.9.88_2.0.0 SDK on https://mcuxpresso.nxp.com/ web page.   Files available: Linux:  # Name Description 1 imx-yocto-L4.9.88_2.0.0.tar.gz L4.9.88_2.0.0 for Linux BSP Documentation. Includes Release Notes, User Guide. 2 L4.9.88_2.0.0_images_MX6QPDLSOLOX.tar.gz i.MX 6QuadPlus, i.MX 6Quad, i.MX 6DualPlus, i.MX 6Dual, i.MX 6DualLite, i.MX 6Solo, i.MX 6Solox Linux Binary Demo Files 3 L4.9.88_2.0.0_images_MX6SLEVK.tar.gz i.MX 6Sololite EVK Linux Binary Demo Files 4 L4.9.88_2.0.0_images_MX6UL7D.tar.gz i.MX 6UltraLite EVK, 7Dual SABRESD, 6ULL EVK Linux Binary Demo Files 5 L4.9.88_2.0.0_images_MX6SLLEVK.tar.gz i.MX 6SLL EVK Linux Binary Demo Files 6 L4.9.88_2.0.0_images_MX8MQ.tar.gz i.MX 8MQuad EVK Linux Binary Demo files 7 L4.9.88_images_MX7ULPEVK.tar.gz i.MX 7ULP EVK Linux Binary Demo Files  8 L4.9.88_2.0.0-ga_mfg-tools.tar.gz Manufacturing Toolkit for Linux L4.9.88_2.0.0 iMX6,7 BSP 9 L4.9.88_2.0.0_mfg-tool_MX8MQ.tar.gz Manufacturing Toolkit for Linux L4.9.88_2.0.0 i.MX8MQ BSP 10 imx-aacpcodec-4.3.5.tar.gz Linux AAC Plus Codec for L4.9.88_2.0.0   SDK:   On https://mcuxpresso.nxp.com/, click the Select Development Board to customize the SDK based on your configuration then download the SDK package.    Target board: i.MX 6QuadPlus SABRE-SD Board and Platform i.MX 6QuadPlus SABRE-AI Board 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 6SoloLite EVK Board i.MX 6SoloX SABRE-SD Board i.MX 6SoloX SABRE-AI Board i.MX 7Dual SABRE-SD Board i.MX 6UltraLite EVK Board i.MX 6ULL EVK Board i.MX 6SLL EVK Board i.MX 7ULP EVK Board i.MX 8MQ EVK Board   What’s New/Features: Please consult the Release Notes.   Known issues For known issues and more details please consult the Release Notes.   More information on changes of Yocto, see: README: https://source.codeaurora.org/external/imx/imx-manifest/tree/README?h=imx-linux-rocko ChangeLog: https://source.codeaurora.org/external/imx/imx-manifest/tree/ChangeLog?h=imx-linux-rocko
View full article
Introduction The SABRE Board for Smart Devices Based on the i.MX 6 Series is an evalutaion board featuring the i.MX6 Quad Core Cortex-A9 processor. Freescale ported the Linux Operating System (as of this writing version 3.0.35) and the Board Support Package (BSP) containing the Linux Kernel, build system called LTIB, GCC compiler tools, boot loader, u-boot, and root file system is available for download, install, and build. LTIB is a perl script and is the acroynm for Linux Target Image Builder. This document describes setting up a CentOS 6.3 64-bit host in a virtual machine for using the BSP and running the images on i.MX6Q-SDB evaluation board. References Description Reference CentOS 6.3 LiveCD installed in a virtual machine from virtual box. http://centos.org CentOS-6.3-x86_64-LiveCD.iso 9953ff1cc2ef31da89a0e1f993ee6335 Virtual Box - A Virtual Machine used for creating the CentOS host. Virtual Box installed on Windows 7 64-bit Pro, then create the VM. Allocated 20 GB Hard disk and 1 MB RAM. The steps for installations are found at the virtual box web site. http://www.virtualbox.org The BSP provides, a build system called ltib, GNU tools, U-Boot, Linux Kernel, and root file system: Download archive from http://freescale.com/sabresdb L3.0.35_12.09.01.0_GA_source.tar.gz 5ab4198278e92e03be74ca602227afad Document Conventions Bold lines are Linux commands and edits run on CentOS. The '$' indicates running the command as a regular user The '#' indicates running the command as root user. CentOS Host Setup For this example a virtual machine is used, however a dedicated PC running only CentOS linux could be used. 1. Add user login to sudo'ers file           Login as user root and run the visudo command          # visudo           Add the following line and save the file:           user     ALL=(ALL)     ALL 2. Update the system packages:           $ sudo yum udpate 3. Install package for "ltib" operations:           $ sudo yum install make gcc gcc-c++ kernel-devel bison libuuid-devel ncurses-devel zlib-devel lzo-devel intltool libtool tcl rpm-build perl-ExtUtils-MakeMaker ld-linux.so.2 zlib-1.2.3-27.el6.i686 4. Update sudo'ers file for supporting ltib rpm           $ sudo visudo           Add the following line and save the file:           user     ALL=NOPASSWD: /bin/rpm,/opt/freescale/ltib/usr/bin/rpm Install BSP The sources are in a tar gziped archive file which is downloaded from http://freescale.com/sabresdb, selecting the Software & Tools tab then expanding Run-time Software in the middle of the page. A free login is required for download which can be registered for by selecting the Login at the top right of the freescale.com page. Once downloaded, verify the md5 checksum (see references above for the value). $ mkdir ~/imx6 $ tar -zxf L3.0.35_12.09.01.01_GA_source.tar.gz -C ~/imx6 $ cd ~/imx6/*source $ ./install Read and accept the licensing information. Choose a directory to install too, for this example entered .. which is the parent directory. Build the i.MX6Q SDB $ cd ~/imx6/ltib $ ./ltib After some time (depends on how fast your host computer is) the menuing system is shown which allows you to select build configurations. The second screen selects the development platform which is imx6q for the SDB. For this example the Min profile is chosen which is the default. Use the arrow keys to move and the enter key to select. The space bar selects/deselects an entry. Use the right arrow key to move to <Exit> and press the enter key. The save dialog box is presented, save. The next menu is the iMX6x Base Boards which leaving all as default except for the U-boot board selection which is mx6q_sabresd for the SDB. Save and exit. Images When ltib completes, the images are found in <ltib>/rootfs/boot. Bootloader = u-boot.bin Linux Kernel = uImage File system = </ltib>/rootfs
View full article
Downloading and building the V4L2 examples V4L2 examples - v0.1 are available at https://github.com/rogeriorps/v4l2-examples To download, just clone the project: $ git clone https://github.com/rogeriorps/v4l2-examples.git Available demos Example1: Display an image coming from camera using V4L2_BUF_TYPE_VIDEO_OVERLAY Example2: Display an image coming from camera using V4L2_BUF_TYPE_VIDEO_OUTPUT Known issues
View full article
I've been asked to help to upload the doc in MPU support space. The doc describes some ideas about how to support a customer to enable a mipi-csi2 sensor connected with i.MX6DQ/6DL. Hope this may be helpful.
View full article
Downloading and building the IPU examples IPU examples - v0.1 are available at https://github.com/rogeriorps/ipu-examples To download, just clone the project: $ git clone https://github.com/rogeriorps/ipu-examples.git Follow the README.md on the project root folder to build and install it. Available demos Alpha Blending Basic Combining Cropping Color Space Conversion Deinterlacing Resizing Rotation i.MX5 basic_ex1 rot_ex1 i.MX6 alpha_ex1 alpha_ex2 crop_ex1 csc_ex1 dint_ex1 res_ex1 rot_ex1 i.MX5 Basic examples basic_ex1: Prints all information from all framebuffers. It uses only the framebuffer device /dev/fb*. Rotation examples rot_ex1: Rotate an image a show on display. This example uses the ipu library instead using directly the /dev/mxc_ipu. i.MX6 Alpha blending examples alpha_ex1: This example shows how to use global alpha blending. It fills layer 1 with white color, an overlay layer with 4 color strips and varies the global alpha blending, showing on display 2 planes at the same time with different transparency rates. alpha_ex2: This example shows how to use local alpha blending. This example uses 3 buffers: 1 - Input buffer: Used as layer 1 (background). 2 - Overlay buffer: Used as layer 2 (foreground). 3 - Alpha buffer: Used as alpha buffer, where each pixel will correspond to the transparency value between input and overlay buffers. When running it will fill input and overlay buffers with solid colors, alpha buffer with 4 different alpha strips and will turn on and off the local alpha blending. Color space conversion examples csc_ex1: This example shows how to use color space conversion. It reads 4 different formats images (RGB565, RGBA32, NV12 and YUYV422) and show them on background framebuffer on a RGB565 format. Crop example crop_ex1: This example shows how to crop an image using "output crop". It fills the input buffer with a solid color and crop the output buffer. The result will be a solid block on the display. De-interlace example dint_ex1: This example shows how to de-interlace a single interlaced frame. The example loads an 320x240 interlaced NV12 image and show on display turning on and off the de-interlace feature. Resize examples res_ex1: This example resizes the image freescale_1024x768.raw (1024x768 RGB565 format) to an 800x480 RGB24 format image, storing into a local file output_file.raw. Rotation examples rot_ex1: This example rotates the image freescale_1024x768.raw (1024x768 RGB565 format) and displays using all rotation modes: 0 - No rotation 1 - Vertical flip 2 - Horizontal flip 3 - 180 degrees 4 - 90 degrees right 5 - 90 degrees right with vertical flip 6 - 90 degrees right with horizontal flip 7 - 90 degrees left Known issues
View full article
How To Convert RealView CP15 Config To OpenOCD? # arm11 mcr <jtag_target> <coprocessor> <opcode 1> <CRn> <CRm> <opcode 2> <32bit value to write> Setting CP15 Control RealView: setreg @CP15_CONTROL=0x00050078 OpenOCD: arm11 mcr 1 15 0 1 0 0 0x00050078 Setting CP15 Peripheral Memory Remap RealView: setreg @CP15_PERIP_MEM_REMAP=0x40000015 OpenOCD: arm11 mcr 1 15 0 15 2 4 0x40000015
View full article
Overview In latest i.MX6UL/i.MX6ULL EVK boards, Ethernet PHY chip is upgraded with new revsion ID (01) although the same part number KSZ8081RNBIA is used. The detailed change is as follows: Mark on old Ethernet PHY chip (Silicon Revision ID is 0, Mark is A2):             KSZ8081             RNBIA             1439A2T             M147J18M02 Mark on new Ethernet PHY chip (Silicon Revision ID is 1, Mark is A3)               KSZ8081               RNBIA               1602SA3T                M159S28M23                                   Software Patch Linux BSP requires to be updated to support this new Ethernet PHY because PHY setting is designed to be associated with silicon ID. See attached patch for the details (Please note: i.MX6ULL/i.MX6UL EVK shared the same board file.) The formal patch is also included into the releases starting from L4.1.15_2.0.1. See http://git.freescale.com/git/cgit.cgi/imx/meta-fsl-bsp-release.git/tree/imx/meta-bsp/recipes-kernel/linux/files?id=imx_4.1.15_2.0.1 If ethernet doesn't function on your i.MX6UL/i.MX6ULL EVK board in kernel, please check whether Silicon Revion Mark is A3 on the board and then apply for attached file for the test.
View full article
Attached is a chunk of the Filesystem needed to construct the Linux Image https://community.freescale.com/docs/DOC-93887
View full article
Splash Screen on U-boot for i.MX25 PDK Having a bitmap on the LCD a few seconds after boot is a requirement on several embedded systems, u-Boot supports this feature. However, currently, the code provided on Freescale's BSP only implements support for the LCD controller on Linux. This page provides instructions to add support for the LCDC on the u-boot. 1 - Install Freescale i.MX25 BSP, SDK 1.7 It is available on www.freescale.com. If needed follow the getting started section instructions. 2 - Update u-boot source After installing the BSP and running LTIB for the first time, it's time to update u-boot: - Download u-Boot patch and spec file. - Replace the file "u-boot.spec.in" located at <ltib_path>/config/platform/imx by the one downloaded - Copy the "u-boot-2009.08-1273860148.patch" downloaded to /opt/freescale/pkgs 3 - Extract and rebuild u-boot - To extract the source and aply the patch run: <Ltib_path>$ ./ltib -p u-boot -m prep - Now Build:     <Ltib_path>$ ./ltib -p u-boot -m scbuild    After completing this step an u-Boot binary (u-boot.bin) will be saved at <ltib_path>/rpm/BUILD/u-boot-2009.08 4 - Program the SD card Program a SD card with the new u-Boot binary and a bitmap image to be displayed. Insert the SD and run:      $sudo dd if=<ltib_path>/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. $sudo dd if="your_image".bmp of=/dev/mmcblk0 bs=512 seek=608 Argument seek 608, skips the first 608 blocks of the SD (608x512) where the uboot is stored. If you need to relocate the image, update also the environment variable "splashimage_mmc_init_block", see step 6. 5 - Boot Boot the image from the SD. Personality Board settings:   12345678 SW22 -> 00000000 SW21 -> 11000000    Debug Board settings: SW5,6,7,8,9,10 -> OFF      12345678 SW4 -> 10000001 Turn on the board and stop at u-boot prompt: MX25 U-Boot > 6 - u-Boot environment variables Update u-Boot environment variables for the splash screen to work: The address in memory to load the splash screen from: MX25 U-Boot > setenv splashimage 0x80800000 The SD device on the board: MX25 U-Boot > setenv splashimage_mmc_dev 0 The block on the SD where the bitmap is stored, this must match the block on step 4. MX25 U-Boot > setenv splashimage_mmc_init_block 0x260  The amount in blocks to be read from the SD card, this depends on the bitmap size, i.e. for a 308278 bytes bitmap, 0x2B5 blocks are enough on a 512 bytes per block SD, (308278 / 512). MX25 U-Boot > setenv splashimage_mmc_blkcnt 0x2b5 The SD card block size in bytes: MX25 U-Boot > setenv splashimage_mmc_blksize 512 Save the environment variables: MX25 U-Boot > saveenv Now reboot the board and you should see the splash screen on the LCD. 7 - Booting Linux When Linux takes control of the board it initializes the LCD controller and Framebuffer again. To maintain the splash screen on the LCD you can replace the Linux Logo with the figure used for the splash screen, the side effect is a blink when Linux takes over the LCDC. To achieve this, create a new image in Gimp and save it as ".ppm". Copy it to Linux "logo" folder <ltib_path>/rpm/BUILD/linux-2.6.31/drivers/video/logo Run: $ ppmquant -mapfile clut_vga16.ppm "my_image.ppm" | pnmnoraw > logo_linux_vga16.ppm where: logo_linux_vga16.ppm is the current logo being used by Linux. Recompile the kernel and boot it.
View full article
     This documents shows how to secure and encrypt boot loader image for i.MX6 processor. Secure boot is necessary to be sure that CPU is allowed to run genuine and authentic images. Encrypted image secures your intellectual property from theft. Both methods secure/encryption can be extended to cover whole software on board. Boot loader image encryption is easy to do with CST tools and HAB feature build in Freescale processor. Encrypted image preparation is consist of three parts: Encrypt u-boot.imx plain image by CST utility; Wrap DEK to get DEK blob by specific board; Append DEK blob key to the u-boot image. In this document as reference board we used SABRESD iMX6q. But it's easily to adjust it for any other board based on i.MX6 CPU with HAB4.1 feature. Encrypted u-boot image consist of: IVT, DCD, u-boot.bin, CSF, dek_blob.bin. In our example finished u-boot_encrypted.imx image looks like: Address in file Data 0x000000 IVT 0x000020 DCD + pad to address 0xC00 0x000C00 u-boot.bin + pad to address* 0x7BC000 0x07DBB8 CSF bin data + pad to address** 0x07DBB8 + Wrapped DEK (dek_blob.bin)** * (IVT + DCD + u-boot.bin) has to be padded to align 0x1000. ** (CSF bin data + padding + dek_blob.bin) has to have size 0x2000 Step-by-step instruction: Clone u-boot git repository. $ mkdir ~/imx6encryption $ cd ~/imx6encryption $ git clone git://git.denx.de/u-boot.git $ cd u-boot $ git checkout v2016.03 -b tmp To enable secure features in u-boot modify the following files: Add function usec2ticks to the end of file timer.c. $ nano arch/arm/imx-common/timer.c unsigned long usec2ticks(unsigned long usec) {         ulong ticks;         if (usec < 1000)                 ticks = ((usec * (get_tbclk()/1000)) + 500) / 1000;         else                 ticks = ((usec / 10) * (get_tbclk() / 100000));         return ticks; } Press Ctrl+X and Y and Enter to save changes. In file mx6q_4x_mt41j128.cfg add string CSF 0x2000 after string BOOT_FROM sd $ nano board/freescale/mx6sabresd/mx6q_4x_mt41j128.cfg Press Ctrl+X and Y and Enter to save changes. Add defines in file mx6sabresd.h before string #define CONFIG_MACH_TYPE 3980. $ nano include/configs/mx6sabresd.h #define CONFIG_SECURE_BOOT #define CONFIG_SYS_FSL_SEC_COMPAT    4 /* HAB version */ #define CONFIG_FSL_CAAM #define CONFIG_CMD_DEKBLOB #define CONFIG_SYS_FSL_SEC_LE #define CONFIG_FAT_WRITE Press Ctrl+X and Y and Enter to save changes. Delete the following strings: gpimage.0 \ gpimage-common.o \ omapimage.o \ in Makefile. $ nano tools/Makefile Press Ctrl+X and Y and Enter to save changes Download Linaro GCC compiler. $ cd ~/imx6encryption $ wget -c https://releases.linaro.org/components/toolchain/binaries/5.3-2016.02/arm-linux-gnueabihf/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz $ tar xf gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz $ export CC=`pwd`/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- Check compiler version. $ ${CC}gcc --version Output: arm-linux-gnueabihf-gcc (Linaro GCC 5.3-2016.02) 5.3.1 20160113 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Build u-boot image with mx6qsabresd_defconfig. $ cd u-boot $ make ARCH=arm CROSS_COMPILE=${CC} distclean $ make ARCH=arm CROSS_COMPILE=${CC} mx6qsabresd_defconfig $ make ARCH=arm CROSS_COMPILE=${CC} Using mkimage utility build and get information of u-boot.imx image. $ ./tools/mkimage -T imximage -n board/freescale/mx6sabresd/mx6q_4x_mt41j128.cfg.cfgtmp -e 0x17800000 -d u-boot.bin u-boot.imx Output: Image Type:   Freescale IMX Boot Image Image Ver:    2 (i.MX53/6/7 compatible) Data Size:    516096 Bytes = 504.00 kB = 0.49 MB Load Address: 177ff420 Entry Point:  17800000 HAB Blocks:   177ff400 00000000 0007bc00 Register an account on NXP website to have access to download NXP Code Signing Tool for the High Assurance Boot library. Copy downloaded archive into “imx6encryption” folder. $ cd ~/imx6encryption $ tar xf cst-2.3.1.tar.gz $ cd cst-2.3.1 $ chmod u+x linux64/* keys/* Compile back end sources of CST utility $ sudo apt-get install libssl-dev $ cd ~/imx6encryption/cst-2.3.1/code/back_end/src $ gcc -o cst -I ../hdr -L ../../../linux64/lib *.c -lfrontend -lcrypto $ mv cst ../../../linux64 Generate keys and certificates which will be used to sign boot loader image. $ cd ~/imx6encryption/cst-2.3.1/keys Create file serial. $ nano serial Enter 8 random digits, for example: 12345678 Press Ctrl+X and Y and Enter to save changes. Create key_pass.txt $ nano key_pass.txt Enter two lines of identical text: HelloWorld HelloWorld Press Ctrl+X and Y and Enter to save changes. Execute hab4_pki_tree.sh. $ ./hab4_pki_tree.sh Do you want to use an existing CA key (y/n)?: n Enter key length in bits for PKI tree: 2048 Enter PKI tree duration (years): 10 How many Super Root Keys should be generated? 4 Do you want the SRK certificates to have the CA flag set? (y/n)?: y Generate SRK table. $ cd ~/imx6encryption/cst-2.3.1/crts $ ../linux64/srktool -h 4 -t SRK_1_2_3_4_table.bin -e SRK_1_2_3_4_fuse.bin -d sha256 -c ./SRK1_sha256_2048_65537_v3_ca_crt.pem,./SRK2_sha256_2048_65537_v3_ca_crt.pem,./SRK3_sha256_2048_65537_v3_ca_crt.pem,./SRK4_sha256_2048_65537_v3_ca_crt.pem -f 1 CST utility requires CSF script. This file describes certificates, keys and the data ranges used in sign and encryption functions. Create u-boot.csf file. $ cd ~/imx6encryption/cst-2.3.1/linux64 $ nano u-boot.csf And put the following text: [Header] Version = 4.1 Hash Algorithm = SHA256 Engine Configuration = 0 Certificate Format = X509 Signature Format = CMS Engine = CAAM [Install SRK] File = "../crts/SRK_1_2_3_4_table.bin" # Index of the key location in the SRK table to be installed Source index = 0 [Install CSFK] # Key used to authenticate the CSF data File = "../crts/CSF1_1_sha256_2048_65537_v3_usr_crt.pem" [Authenticate CSF] [Unlock] Engine = CAAM Features = RNG [Install Key] # Key slot index used to authenticate the key to be installed Verification Index = 0 # Key to install Target Index = 2 File = "../crts/IMG1_1_sha256_2048_65537_v3_usr_crt.pem" [Authenticate Data] # Key slot index used to authenticate the image data Verification Index = 2 #       Address   Offset        Length      Data File Path Blocks = 0x177ff400 0x00000000 0x00000C10 "./u-boot.imx" #Encrypt the boot image and create a DEK [Install Secret Key] Verification Index = 0 Target Index = 0 Key = "./dek.bin" Key Length = 128 Blob Address = 0x1787CFB8 #Provide DEK blob location to decrypt [Decrypt Data] Verification Index = 0 Mac Bytes = 16 Blocks = 0x17800010 0x00000C10 0x0007AFF0 "./u-boot.imx" Press Ctrl+X and Y and Enter to save changes. Execute CST utility to encrypt image. Note that after execution u-boot.imx file will be encrypted. $ cp ~/imx6encryption/u-boot/u-boot.imx . $ ./cst --o u-boot_csf.bin < u-boot.csf $ objcopy -I binary -O binary --pad-to=0x1FB8 --gap-fill=0x00 u-boot_csf.bin u-boot_csf.bin Prepare SD card partition table. Check SD card name in system ($dmesg | tail), for example used /dev/sdb. $ echo -e "o""\n""n""\n""p""\n""1""\n""2048""\n""+256M""\n""w" | sudo fdisk /dev/sdb $ sudo mkfs.vfat /dev/sdb1 $ cd ~/imx6encryption/u-boot $ sudo dd if=u-boot.imx of=/dev/sdb bs=512 seek=2 $ sync Wrap DEK to get DEK blob from i.MX6 CPU. Mount partition 1 and copy dek.bin file to the 1st FAT partition on SD card. $ cd ~/imx6encryption/cst-2.3.1/linux64 $ mkdir /tmp/partition0 $ sudo mount /dev/sdb1 /tmp/partition0 $ sudo cp dek.bin /tmp/partition0 $ sudo umount /tmp/partition0 Insert SD card into the board. And press any key to enter into u-boot prompt. Firstly load dek.bin to the RAM memory. Use dek_blob command to wrap dek.bin. Write file from RAM memory to SD card. => fatload mmc 1:1 0x10800000 dek.bin => dek_blob 0x10800000 0x10801000 128 => fatwrite mmc 1:1 0x10801000 dek_blob.bin 0x48 Append DEK blob key to the u-boot image. Mount SD card partition 1 and copy dek_blob.bin file to the linux64 folder. $ mkdir -p /tmp/partition0 $ sudo mount /dev/sdb1 /tmp/partition0 $ cd /tmp/partition0 $ cp dek_blob.bin ~/imx6encryption/cst-2.3.1/linux64/ $ cd ~/imx6encryption/cst-2.3.1/linux64/ $ sudo umount /tmp/partition0 $ cat u-boot_csf.bin >> u-boot.imx $ cat dek_blob.bin >> u-boot.imx Install encrypted u-boot.imx into SD card. $ sudo dd if=u-boot.imx of=/dev/sdb bs=512 seek=2 $ sync Insert SD card into the board. Press any key to enter into u-boot prompt. And check if hab_status command executes without HAB Event errors. => hab_status Attention, OTP fuses can be programmed once, double check everything before burning. If everything is fine, burn required fuses SRK_HASH, SEC_CONFIG as described in AN4581. As a result we have encrypted boot image which can be loaded and executed by only current board. Because dek_blob.bin is unique per i.MX6 CPU. Vitaliy Vasinovich April 2016
View full article
Some of SDIO cards need SD clock active for 4-bit mode, in order to generate interrupt. But i.MX6 SD controller enables SD clock gated by default, the attached patch is an example to disable SD clock gated. It's able to check if clock gated is enable or not by the register, "uSDHCx_PRES_STATE:SDOFF", of SD controller.
View full article
Following docs(English or Chinese version) are also can be referred as a hand on guide. Freescale i.MX6 DRAM Port Application Guide-DDR3 飞思卡尔i.MX6平台DRAM接口高阶应用指导-DDR3篇 Please find i.Mx6DQSDL LPDDR2 Script Aid through below link. i.Mx6DQSDL LPDDR2 Script Aid Please find i.Mx6DQSDL DDR3 Script Aid through below link. i.Mx6DQSDL DDR3 Script Aid Please find i.MX6SX DDR3 Script Aid through below link.. i.MX6SX DDR3 Script Aid Any questions are welcome! Change History: 0.02 - Add total 1Gbit density supporting.
View full article
The i.MX Android O8.0.0_1.0.0 GA release is now available from IMX_SW page. Overview -> BSP Updates and Releases -> Android 8.0.0 Oreo (O8.0.0_1.0.0, 4.9 kernel)   Files available: # Name Description 1 android_O8.0.0_1.0.0_docs.tar.gz i.MX Android O8.0.0_1.0.0 BSP Documentation 2 imx-o8.0.0_1.0.0_ga.tar.gz i.MX Android O8.0.0_1.0.0 proprietary surce code for i.MX 6QuadPlus, i.MX 6Quad, i.MX 6DualPlus, i.MX 6Dual, i.MX 6DualLite, i.MX 6Solo  i.MX 6Sololite, i.MX6SX and i.MX7D 3 android_O8.0.0_1.0.0_image_6dqpsabreauto.tar.gz Binary Demo Files of Android O8.0.0_1.0.0 BSP - SABRE for Automotive Infotainment based on i.MX 6QuadPlus, i.MX 6Quad, and i.MX 6DualLite 4 android_O8.0.0_1.0.0_image_6dqpsabresd.tar.gz Binary Demo Files of Android O8.0.0_1.0.0 BSP - SABRE Platform and SABRE Board based on i.MX 6QuadPlus, i.MX 6Quad and i.MX 6DualLite. 5 android_O8.0.0_1.0.0_image_6slevk.tar.gz Binary Demo Files of Android O8.0.0_1.0.0 BSP - i.MX 6Sololite evaluation kit. 6 android_O8.0.0_1.0.0_image_6sxsabresd.tar.gz Binary Demo Files of Android O8.0.0_1.0.0 BSP - SABRE Board based on i.MX 6SoloX 7 android_O8.0.0_1.0.0_image_6sxsabreauto.tar.gz Binary Demo Files of Android O8.0.0_1.0.0 BSP - SABRE for Automotive infotainment based on i.MX 6SoloX 8 android_O8.0.0_1.0.0_image_7dsabresd.tar.gz Binary Demo Files of Android O8.0.0_1.0.0 BSP - SABRE Board based on i.MX 7Dual 9 fsl_aacp_dec_O8.0.0_1.0.0.tar.gz AAC Plus Codec for O8.0.0_1.0.0 10 android_O8.0.0_1.0.0_tools.tar.gz Manufacturing Toolkit and VivanteVTK for O8.0.0_1.0.0   Supported Hardware SoC/Boards: i.MX 6Quad, i.MX 6QuadPlus, and i.MX 6DualLite SABRE-SD board and platform i.MX 6Quad, i.MX 6QuadPlus, and i.MX 6DualLite SABRE-AI board and platform i.MX 6SoloLite EVK platform i.MX 6SoloX SABRE-SD board and platforms i.MX 6SoloX SABRE-AI board and platforms i.MX 7Dual SABRE-SD board and platform   Changes: Compared to the N7.1.2_2.0.0 release, this release has the following major changes: Upgraded the Android code base from android-7.1.2_r9 to android-8.0.0_r25. Removed the device partition and added the vendor partition. Enabled ION-based gralloc and EGL. Feature: For features please consult the release notes.   Known issues For known issues and more details please consult the Release Notes.
View full article
通常的音乐播放是这样一个流程: alsa将一段上层的应用空间和底层的物理空间通过mmap映射起来,然后DMA从被映射的物理空间往I2S的fifo传送数据。 现在有个客户想将FEC网络那边收到的数据中的audio数据分离出来,暂存到一段物理内存中,然后通过DMA传输到我们芯片的I2S fifo,从而节省掉数据在上层、底层之间来回调用的时间。 这就需要我们I2S这边支持通过DMA直接从一段物理内存拿数据。 为了较为方便的实现这一功能,通过对ALSA架构的分析,我保留了我们整个ASoC代码的架构,只是不让DMA从原来的mmap的地址拿数据,而是从我自己分配的DMA内存中拿数据。 258         uint8_t *wbuf; 259         uint8_t *index1; 261         wbuf = dma_alloc_coherent(NULL, 0x10000, &wpaddr, GFP_DMA); 265         for (i=0; i<0x10000; i++) { 269                         *(wbuf + i) = wav_data[i]; 273         } 333                 iprtd->desc = chan->device->device_prep_dma_cyclic( 334                         chan, wpaddr, 335 //                      chan, dma_addr, 336                         iprtd->period_bytes * iprtd->periods, 337                         iprtd->period_bytes, 338                         substream->stream == SNDRV_PCM_STREAM_PLAYBACK     ? 339                         DMA_TO_DEVICE : DMA_FROM_DEVICE); 代码实现上,实际上是比较简单的,可以套用以前做过的dma_m2m的部分代码。 现在我们要拿一些wav里面的audio数据。 linux可以用16进制的方法读wav里面的数据: hexdump -n 65700 -C audio44k16S.wav > wav_data_44100_s16_stereo.h将audio44k16S.wav 里面的audio数据用16进制的形式保存到wav_data_44100_s16_stereo.h这个文件里。 然后我们要编辑这个头文件里的audio数据,原数据是这种格式的: 00000000  52 49 46 46 12 63 0c 00  57 41 56 45 66 6d 74 20  |RIFF.c..WAVEfmt | 00000010  12 00 00 00 01 00 02 00  44 ac 00 00 10 b1 02 00  |........D.......| 00000020  04 00 10 00 00 00 66 61  63 74 04 00 00 00 b5 18  |......fact......| 00000030  03 00 64 61 74 61 d4 62  0c 00 58 01 f0 00 98 01  |..data.b..X.....| 00000040  56 01 3d 01 1e 01 d0 00  ae 00 81 00 35 00 40 00  |V.=.........5.@.| 00000050  dd ff f7 ff 90 ff 9f ff  1d ff 54 ff bb fe 18 ff  |..........T.....| 00000060  61 fe 1e ff e7 fd 5e ff  e4 fd 23 00 39 fe ee 00  |a.....^...#.9...| 我们要把它转换成符合我们要求的这种形式: ,0x63 ,0xf0 ,0x0f ,0xf0 ,0x7f ,0xf1 ,0x21 ,0xf1  ,0x89 ,0xf3 ,0xef ,0xf2 ,0x9d ,0xf5 ,0x8c ,0xf4 ,0x5f ,0xf7 ,0xd3 ,0xf5 ,0x8c ,0xf8 ,0x08 ,0xf7  ,0x4c ,0xf9 ,0x01 ,0xf8 ,0x74 ,0xf9 ,0x2e ,0xf8 ,0x1c ,0xf9 ,0x15 ,0xf8 ,0x09 ,0xf9 ,0x82 ,0xf7  ,0x45 ,0xf9 ,0xd1 ,0xf6 ,0x0b ,0xf9 ,0x1e ,0xf6 ,0xce ,0xf8 ,0xbe ,0xf5 ,0xd7 ,0xf8 ,0x9a ,0xf5  ,0xa8 ,0xf9 ,0xc7 ,0xf5 ,0xe0 ,0xfa ,0x3e ,0xf6 ,0x25 ,0xfc ,0x44 ,0xf7 ,0x44 ,0xfd ,0xa2 ,0xf8  ,0x9a ,0xfe ,0xea ,0xf9 ,0x25 ,0x00 ,0x94 ,0xfb ,0x16 ,0x02 ,0xec ,0xfc ,0xcb ,0x03 ,0xfe ,0xfd  ,0xef ,0x04 ,0xa5 ,0xfe ,0x45 ,0x05 ,0x0b ,0xff ,0x3b ,0x05 ,0x24 ,0xff ,0x34 ,0x05 ,0x94 ,0xff  ,0x06 ,0x05 ,0x13 ,0x00 ,0x6c ,0x04 ,0x82 ,0x00 这里有一个比较好的方法, 可以通过VIM 垂直编辑的方法较为轻松的实现。 vim垂直编辑: ctrl+v 然后上下左右移动选中,D删除选中的。 ctrl+v 选中, shift+i 可以在选中的地方加入想插入的字符。 将编辑过的数据放到uint8_t wav_data[],赋值给wbuf,wbuf对应的物理地址wpaddr中的数据,就是上面wav中的audio数据。 wbuf = dma_alloc_coherent(NULL, 0x10000, &wpaddr, GFP_DMA);中的0x10000=1024*64是我们分配的dma内纯的大小,我们sdma是根据以下大小传输数据的: iprtd->period_bytes = 21844, iprtd->periods = 3 //21844*3=65532= 0xfffc 这样实际上DMA是不停的刷我们分配的内存里的数据,因为我们没有更新DMA内存里的数据,所以听到的是不断重复播放的声音片段。 刚开始时,我听这个片段,发现片段之间有较为明显的pop音,这是由于我截取的是一首音乐开始的部分,包含了wav包头数据,这不是音乐数据,将这个去除就可以了。
View full article
In many cases (test certain modules, first boot-ups, DDR is not available), writing bare-metal (SDK) code with runs on iRAM (OCRAM) is the only possible scenario. The first (attached) patch creates a new linker file with proper sections and the second includes a tiny app (it should be tiny, by definition) using the previous file. These are the steps to have the setup ready: 1. Dowload latest i.MX6 SDK (v1.1.0 is the latest when writing this document). 2. Let GIT take the control (git init; git add .; git commit -m '1st commit') 3. Apply patches (git am < patch1; git am < patch2 ) 4. Compile             # This example is intended for a mx6q sabreSD, revision C             $ ./tools/build_sdk -target=mx6dq \                                 -board=smart_device \                                 -board_rev=c \                                 -app=iram     5. SD Card Flashing & Running: 5.1. ELF file & U-boot:    # Output image is located on:                 #   elf=output/mx6dq/minimal/smart_device_rev_c/minimal.elf                 $ dd if=$elf \                      of=/dev/sdb \                      seek=2048 bs=512; sync                 # Boot your board with your favorite u-boot version, just make                 # sure the bootelf command is presnet                 > mmc dev Y                 > mmc read 0x10800000 0x800 XXX                 > bootelf 0x10800000                where Y is the SD device and XXX are the records seen when dd flashing.             5.2  BIN file:    # Output image is located on:                 #   bin=output/mx6dq/minimal/smart_device_rev_c/minimal.bin                 $ dd if=$bin \                      of=/dev/sdb \                      seek=2 skip=2 bs=512; sync                 # Place the SD into your board and power-on. NOTES: + The first patch was taken from the internal discussion MX6 SDK (PLATLIB): has anyone created a stripped down version that will run from internal RAM?
View full article
i.MX6Q Automotive board has one ADV7180 analog video decoder with 2 video inputs. By default, only input 1 is used (connector J42).     To connect 2 analog video sources and switch the display between them, the following changes are needed:   1 - Create a new IOCTL on V4L2_capture and ADV7180 device drivers to receive the information from user space application on what input will be selected. 2 - In this new IOCTL, use the "Fast Switch Script" for ADV7180 described at Analog Devices site: ADV7180 Fast Switch Script | EngineerZone  3 - Create a user space application to call the IOCTL mentioned on step 1.   See attached:   1 - 0001-ADV7180-Adding-input-switch-IOCTL.patch.zip - Patch to be applied on NXP kernel 4.1.15_1.0.0_ga 2 - example2.c.zip - Source code example of user space application. It changes the video input in each 2 seconds. (See it working on attached video) 3 - example2.zip - User space application executable file  4 - Makefile.zip - Makefile of user space application to be used as example 5 - adv7180_switch.mp4 - Video showing the application   In the application, VIDIOC_S_CHIP_INPUT IOCTL is called to change the input:   int input = 0; if (ioctl(fd_capture_v4l, VIDIOC_S_CHIP_INPUT, &input) < 0) { printf("VIDIOC_S_CHIP_INPUT failed\n"); return TFAIL; }‍‍‍‍‍‍‍‍‍‍‍‍   This IOCTL calls the ADV7180 Fast Switch Script, added on ADV7180 driver (see attached patch).
View full article
Hi, the document "how to create ubuntu hardfloat rootfs for imx6d/q" was shared by Junping Mao. https://community.freescale.com/docs/DOC-95387 Here, i build the OpenCV based on the ubuntu hardfloat rootfs for i.MX6Q sabre board. Details about building instruction pls refer to the attachment. Thanks! 
View full article
Hello,   recently I'm running CTS test on MX6Q SabreSD to fix some of the issues my customer found, and found that "factory reset" is an important step during the test-environment setup but not mentioned in i.MX CTS test report.   "Factory reset" is need on official CTS page: Setting up CTS | Android Open Source Project     Without factory reset, the CTS test result in "android.core.tests.libcore.package.libcore" package looks like: There are total 8 failed items.     If we run "factory reset" before conduct the CTS test in in "android.core.tests.libcore.package.libcore" package, only 2 failed items found as below:   PS: and those 2 failed items can be waived, according to the test-house of CTS tests. PS1: the test reports of are also attached.       Please do run "factory reset" before CTS test, verified working on 4.2.2 and should also work on the version above according to the pages I found on Google when trying to fix this issue. Unfortunately "factory reset" is not documented in the environment setup process in i.MX CTS test report, you will need this if you are following the steps in i.MX CTS test report.   Best regards, Jim.
View full article
The following are a couple of recommendations for setting up a Host machine for building the Android Nougat 7.1.1_1.0.0 BSP. Some of these recommendations are not exclusive of the Nougat release and may help in other scenarios. These also apply to using Virtual Machines as Host. Installing Open JDK 8 on Ubuntu 14.04 As mentioned on the Android guide for Establishing a Build Environment (http://source.android.com/source/initializing.html) there are no available supported OpenJDK 8 packages for Ubuntu 14.04, which is the version recommended and tested on the Nougat Android BSP. An alternative is downloading the Ubuntu 15.04 Open JDK 8 packages and installing them manually, which can be done by following this procedure: Download the .deb packages for 64-bit architecture from archive.ubuntu.com: openjdk-8-jre-headless_8u45-b14-1_amd64.deb with SHA256 0f5aba8db39088283b51e00054813063173a4d8809f70033976f83e214ab56c0 http://archive.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre-headless_8u45-b14-1_amd64.deb  openjdk-8-jre_8u45-b14-1_amd64.deb with SHA256 9ef76c4562d39432b69baf6c18f199707c5c56a5b4566847df908b7d74e15849 http://archive.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre_8u45-b14-1_amd64.deb  openjdk-8-jdk_8u45-b14-1_amd64.deb with SHA256 6e47215cf6205aa829e6a0a64985075bd29d1f428a4006a80c9db371c2fc3c4c http://archive.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jdk_8u45-b14-1_amd64.deb  Once you have downloaded these three packages and checked the checksum for them install the packages (optional) install them by running: $ sudo apt-get update $ sudo dpkg -i openjdk-8-jre-headless_8u45-b14-1_amd64.deb $ sudo dpkg -i openjdk-8-jre_8u45-b14-1_amd64.deb $ sudo dpkg -i openjdk-8-jdk_8u45-b14-1_amd64.deb‍‍‍‍   Increasing SWAP to compensate for the lack of RAM Having insufficient RAM especially on the linking part of the image build may cause a number of issues that are difficult to troubleshoot. In these cases it’s good to take a look at the resource monitor to see if indeed the RAM was depleted. One way to make up for the limited RAM is using a bigger swap. Google recommends at least 16GB of RAM/swap so it’s not uncommon to create a 10GB swap when working in VM, to do this please use the following commands.    $ sudo fallocate -l 10g /mnt/10GB.swap $ sudo chmod 600 /mnt/10GB.swap $ sudo mkswap /mnt/10GB.swap $ sudo swapon /mnt/10GB.swap‍‍‍‍   Increasing heap size to avoid out of memory errors It is possible to encounter an out of memory error with the recommendation “try increasing heap size witj java option ‘-Xmx<size>’. If you encounter this error or would like to proactively avoid it you may run the following commands that will increase heap size to four gigabytes and then reset the Jack Server by killing it and starting it again. With the android environment initialized: $ cd my android $ export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4g" $ jack-admin kill-server && jack-admin start-server‍‍‍‍‍‍  Fixing Jack Servers errors due to multiple users on the Host Android Nougat uses Jack Server as mono-user by default. If this is not the case for your host you would need to choose different port numbers for each user and adjust SERVER_NB_COMPILE accordingly. You can also disable the Jack server by setting SERVER=false in your $HOME/.jack. Alternatively, you may also use the patch available on the following link to myandroid/prebuilts/sdk. It will help to fix the mono-user build restriction. When installing the jack-server, it will detect if Jack server is running in the same build machine and then generate a random ports for my build instead of using the default one. https://groups.google.com/forum/#!topic/android-building/UWhJrXH8Vig
View full article
For most of interlace output camera sensors, they only support up to 30fps sample rate. In this case, we may not get good display quality. In order to improve the permance under this case, we can use IPU VDI function to increase the output frequency to be 60fps and then we can get a better quality. The patch is an example to support YUV422(YUYV) 60fps VDI for Android camera preview. SW Platform: kk4.4.2_1.0.0-ga HW Platform: imx6q-sabresd Features: Support YUV422(YUYV) input format; Support IPU 60fps VDI; Supprot 60fps camera preview, but don't support camera capture. Patch: The linux kernel patch to support additonal IPU function can be found at: https://community.freescale.com/docs/DOC-173003 The Android Camera HAL can be found at here. Note: 1. The g_vdi_double is used to decide whether to support these features. When g_vdi_double is set to be 1, these features will be enabled; Or these features will be disabled and camera feature will be the same with default release. 2. The patch should be used at hardware\imx\mx6\libcamera2. 3. Accoeding to the real user case, the user can set IPU VDI motion mode to be 0 or 1 , but NEVER to be 2. 4. The fps can be up to 60fps, but it is not stable now.
View full article