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:
1. Follow all instructions from Freescale's github repo except the last bitbake command 2. Run hob under the build folder build$ hob & 3. On the GUI, select machine and image, then build 4. In case you need to flash an SD Card, hob does not produce an .sdcard image, so as a workaround, close hob and on the same console run build$ bitbake <image>     where image must be the same as the one you choose with hob 5. Flash your SD card build$ sudo dd if=tmp/deploy/images/fsl-image-gui-imx6qsabresd.sdcard of=/dev/sdX bs=4M NOTES: In case of building issues, please follow this link In case of booting issues, make sure: 1. board DIP switches are set correctly 2. you have chosen the correct machine before baking If issues persist, report it to the community
View full article
About this document This document describe the setup detail for Robot Operating systems on  ubuntu 14.04 running on MX6QDL based boards. 1. Software & Hardware requirements 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 i.MX 7D Sabre Board Software:  Gcc toolchain, Ubuntu 14.04v installed on your board. 2. Installation For install ROS on iMX boards you need to have Ubuntu 14.04 rootfs installed in your board, for installation steps please follow up: https://community.freescale.com/docs/DOC-330147 Run your rootfs target and Configure your Ubuntu repositories to allow "restricted," "universe," and "multiverse.  $sudo nano /etc/apt/sources.list Your file should then look like this: deb http://ports.ubuntu.com/ubuntu-ports/ trusty main universe multiverse restricted deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty main universe multiverse restricted deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main universe multiverse restricted Make your installation up to date: $ sudo apt-get update $ sudo apt-get upgrade Set your locale: $ sudo update-locale LANG=C LANGUAGE=C LC_ALL=C LC_MESSAGES=POSIX Add ROS ARM repos & Key $ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' $ sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-key 0xB01FA116 $ sudo apt-get update There are many different libraries and tools in ROS - not all compile fully on ARM. In this case we are going to install the ROS Base, however any other packages can be installed individually ROS-Base: (Bare Bones) ROS package, build, and communication libraries. No GUI tools. $ sudo apt-get install python-rosdep python-wstool build-essential cmake xserver-xorg-dev-lts-utopic mesa-common-dev-lts-utopic \ libxatracker-dev-lts-utopic libopenvg1-mesa-dev-lts-utopic libgles2-mesa-dev-lts-utopic libgles1-mesa-dev-lts-utopic\ libgl1-mesa-dev-lts-utopic libgbm-dev-lts-utopic libegl1-mesa-dev-lts-utopic Alternatively, try installing just this to fix dependency issues, and then install ROS base (includes ROS package, build, and communication libraries. No GUI tools.😞 $ sudo apt-get install libgl1-mesa-dev-lts-utopic $ sudo apt-get install ros-indigo-ros-base Before you can use ROS, you will need to initialize rosdep. It enables you to easily install system dependencies for source you want to compile and is required to run some core components in ROS. $ sudo rosdep init $ rosdep update Install rosinstall: $ sudo apt-get install python-rosinstall Verifying OS name. If you installed the Linaro ALIP rootfs, make sure your OS name defined at /etc/lsb-release is as the following. Since ros does not recognize Linaro as an OS, this is necessary. $ lsb_release -a You should get: No LSB modules are available. Distributor ID: Ubuntu Description:    Ubuntu 14.04.4 LTS Release:        14.04 Codename:       trusty In any case you get a different output, the following is for Ubuntu 14.04, trusty. Modify the release number and name as per your target. DISTRIB_ID=Ubuntu DISTRIB_RELEASE=14.04 DISTRIB_CODENAME=trusty DISTRIB_DESCRIPTION="Ubuntu 14.04" 3. Testing The Installation Run ROS $ roscore You should get: ... logging to /root/.ros/log/1c07caa4-1dd3-11b2-b860-00049f0399fe/roslaunch- imx6q-2707.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB. Started roslaunch server http://i.Mx6q:37547/ ros_comm version 1.11.16 SUMMARY ======== PARAMETERS * /rosdistro: indigo * /rosversion: 1.11.16 NODES auto-starting new master process[master]: started with pid [2718] ROS_MASTER_URI=http://imx6q:11311/ setting /run_id to 1c07caa4-1dd3-11b2-b860-00049f0399fe process[rosout-1]: started with pid [2731] started core service [/rosout] Open a new Terminal and Create the user catkin_ws Workspace. The catkin_ws workspace will contain the user packages. $ source /opt/ros/indigo/setup.bash $ mkdir -p ~/catkin_ws/src $ cd ~/catkin_ws/src $ catkin_init_workspace $ cd ~/catkin_ws/ $ catkin_make The  catkin_make command is a convenience tool for working with catkin_workspace. If you look in your current directory you should now have a 'build' and 'devel' folder. Inside the 'devel' folder you can see that there are now several setup.*sh files. Sourcing any of these files will overlay this workspace on top of your environment. To understand more about this see the general catkin documentation: http://wiki.ros.org/catkin Before continuing source your new setup.*sh file: $ source devel/setup.bash To make sure your workspace is properly overlayed by the setup script, make sure ROS_PACKAGE_PATH environment variable includes the directory you're in. $ echo $ROS_PACKAGE_PATH /home/youruser/catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks Next you should go ahead and learn how to use the workspace. If you are following the ROS tutorials series instead of the catkin tutorials, please continue with Creating a ROS Package. For more testing on your installation, you can try the ROS Tutorials (http://wiki.ros.org/ROS/Tutorials)
View full article
Introduction Hardware Connections Device Tree Configuration Rebuilding Image Requirements Kernel Device Tree Application Driver Main Init Driver Write Read Building and Run the SPI Application Driver Conclusion   Introduction   This document describes how to interface and use Xtrinsic FXLS8471Q digital accelerometer with IMX6Q processor. For this purpose, UDOO Quad board is used with NXP Linux image for IMX6QSABRE-SD board with Kernel 3.14.56 (not with Udoobuntu) to simulate working with a custom board, the process to customize and build such image for UDOO Quad board is described here: Building Linux Image with QT5 for UDOO Quad    On the sensor side FRDM-FXS-MULTI(-B) sensor expansion board which features many of the Xtrinsic sensors introduced in 2013 including the FXSL8471Q is used.   Hardware Connections    The SPI signals from FRDM-FXS-MULTI are routed to SPI1 module of UDOO Quad. FXLS8471Q provides an INT pin which is indicated on image below, however on this implementation polling method is used. Please note that Chip Select is not controlled automatically by SPI module, therefore this pin is configured as GPIO. Besides these signals, reset and power source pins were also connected.   The following figure shows the pins used in FRDM-FXS-MULTI which are connected with UDOO Quad board.           The pins used on the UDOO Quad side are shown in the images below. You can find UDOO Quad pinout diagram here Index of /download/files/pinout.                             Device Tree Configuration   As mentioned at the beginning of this document, a NXP Linux image for IMX6Q-SABRESD is used. In order to customize this image to be used with the UDOO Quad board it is necessary to build a .dtb that matches with it. This task was accomplished obtaining dts and dtsi source files listed below from Kernel Linux Repository for UDOO at UDOOboard (UDOOboard) · GitHub.   imx6qdl-udoo.dtsi imx6qdl-udoo-externalpins.dtsi imx6q-udoo-hdmi.dts   These files were copied into the IMX6Q-SABRESD build source folder and a imx6q-udoo.dtb was generated. This process is described on Building Linux Image with QT5 for UDOO Quad    The following snippets show how the nodes involved on the SPI configuration were set for UDOO Quad board. Please note that each device tree should match your custom board.   In imx6qdl-udoo-externalpins.dtsi verify that ecspi1 node matches with the one shown below.   &ecspi1 {     fsl,spi-num-chipselects = <1>;     cs-gpios = <&gpio5 17 0>;     pinctrl-0 = <&pinctrl_ecspi1>;     pinctrl-names = "default";     status = "disabled";     spidev0: spi@0 {         #address-cells = <1>;         #size-cells = <1>;         compatible = "spidev";         reg = <0>;         spi-max-frequency = <2000000>;     }; };     As you can see on snippet above, ecspi1 node uses pinctrl_ecspi1 as the pin configuration node which is defined in the same file and it looks as follows.          pinctrl_ecspi1: ecspi1grp {             fsl,pins = <             MX6QDL_PAD_DISP0_DAT22__ECSPI1_MISO  0x100b1             MX6QDL_PAD_DISP0_DAT20__ECSPI1_SCLK  0x100b1             MX6QDL_PAD_DISP0_DAT21__ECSPI1_MOSI  0x100b1             MX6QDL_PAD_DISP0_DAT23__GPIO5_IO17   0x80000000             >;         };   However, as you may know each pin on i.MX devices has up to 8 potential functions, and on the other side, one function can be available in different pins.   For example, ECSPI1_MISO can be mapped to 4 different pins     and each pin can have different functions. From all the available functions in a pin one is chosen to be the pad (pin) name. In the image below DISP0_DATA22 was chosen to be the pad name.       Now, back to pinctrl_ecspi1 node, the macros used here are defined in imx6q-pinfuc.h, as you can see DISP0_DAT20 - DISP0_DAT23 are the pads used with the ECSPI signals.   It is necessary to check it that there are no other configurations for DISP0_DAT20 - DISP0_DAT23 and if they are it is necessary to comment out them or delete them. In this case there were other configurations for these pins in imx6qdl-udoo-externalpins.dtsi and they were commented out.     &iomuxc {     imx6q-udoo {         // External Pinout GPIOs         external_hog: hoggrp-2 {         fsl,pins = <             MX6QDL_PAD_CSI0_DAT11__GPIO5_IO29    0x80000000  // {{external-gpio-0}}             MX6QDL_PAD_CSI0_DAT10__GPIO5_IO28    0x80000000  // {{external-gpio-1}}             MX6QDL_PAD_SD1_CLK__GPIO1_IO20       0x80000000  // {{external-gpio-2}}             MX6QDL_PAD_SD1_DAT0__GPIO1_IO16      0x80000000  // {{external-gpio-3}}             MX6QDL_PAD_SD1_DAT1__GPIO1_IO17      0x80000000  // {{external-gpio-4}}             MX6QDL_PAD_SD1_CMD__GPIO1_IO18       0x80000000  // {{external-gpio-5}}             MX6QDL_PAD_SD4_DAT1__GPIO2_IO09      0x80000000  // {{external-gpio-6}}             MX6QDL_PAD_SD4_DAT2__GPIO2_IO10      0x80000000  // {{external-gpio-7}}             MX6QDL_PAD_SD1_DAT3__GPIO1_IO21      0x80000000  // {{external-gpio-8}}             MX6QDL_PAD_SD1_DAT2__GPIO1_IO19      0x80000000  // {{external-gpio-9}}             MX6QDL_PAD_GPIO_1__GPIO1_IO01        0x80000000  // {{external-gpio-10}}             MX6QDL_PAD_GPIO_9__GPIO1_IO09        0x80000000  // {{external-gpio-11}}             MX6QDL_PAD_GPIO_3__GPIO1_IO03        0x80000000  // {{external-gpio-12}}             MX6QDL_PAD_SD4_DAT0__GPIO2_IO08      0x80000000  // {{external-gpio-13}}             MX6QDL_PAD_CSI0_DAT4__GPIO5_IO22     0x80000000  // {{external-gpio-14}}             MX6QDL_PAD_CSI0_DAT16__GPIO6_IO02    0x80000000  // {{external-gpio-15}}             MX6QDL_PAD_CSI0_DAT14__GPIO6_IO00    0x80000000  // {{external-gpio-16}}             MX6QDL_PAD_CSI0_DAT15__GPIO6_IO01    0x80000000  // {{external-gpio-17}}             MX6QDL_PAD_CSI0_DAT12__GPIO5_IO30    0x80000000  // {{external-gpio-18}}             MX6QDL_PAD_CSI0_DAT13__GPIO5_IO31    0x80000000  // {{external-gpio-19}}             MX6QDL_PAD_EIM_D28__GPIO3_IO28       0x80000000  // {{external-gpio-20}}             MX6QDL_PAD_EIM_D21__GPIO3_IO21       0x80000000  // {{external-gpio-21}}             MX6QDL_PAD_DISP0_DAT6__GPIO4_IO27    0x80000000  // {{external-gpio-22}}             MX6QDL_PAD_DISP0_DAT7__GPIO4_IO28    0x80000000  // {{external-gpio-23}}             MX6QDL_PAD_DISP0_DAT8__GPIO4_IO29    0x80000000  // {{external-gpio-24}}             MX6QDL_PAD_DISP0_DAT9__GPIO4_IO30    0x80000000  // {{external-gpio-25}}             MX6QDL_PAD_DISP0_DAT10__GPIO4_IO31   0x80000000  // {{external-gpio-26}}             MX6QDL_PAD_DISP0_DAT11__GPIO5_IO05   0x80000000  // {{external-gpio-27}}             MX6QDL_PAD_DISP0_DAT12__GPIO5_IO06   0x80000000  // {{external-gpio-28}}             MX6QDL_PAD_DISP0_DAT13__GPIO5_IO07   0x80000000  // {{external-gpio-29}}             MX6QDL_PAD_DISP0_DAT14__GPIO5_IO08   0x80000000  // {{external-gpio-30}}             MX6QDL_PAD_DISP0_DAT15__GPIO5_IO09   0x80000000  // {{external-gpio-31}}             MX6QDL_PAD_DISP0_DAT16__GPIO5_IO10   0x80000000  // {{external-gpio-32}}             MX6QDL_PAD_DISP0_DAT17__GPIO5_IO11   0x80000000  // {{external-gpio-33}}             MX6QDL_PAD_DISP0_DAT18__GPIO5_IO12   0x80000000  // {{external-gpio-34}}             MX6QDL_PAD_DISP0_DAT19__GPIO5_IO13   0x80000000  // {{external-gpio-35}}             //MX6QDL_PAD_DISP0_DAT20__GPIO5_IO14   0x80000000  // {{external-gpio-36}}             //MX6QDL_PAD_DISP0_DAT21__GPIO5_IO15   0x80000000  // {{external-gpio-37}}             MX6QDL_PAD_EIM_A16__GPIO2_IO22       0x80000000  // {{external-gpio-38}}             MX6QDL_PAD_GPIO_18__GPIO7_IO13       0x80000000  // {{external-gpio-39}} (KEY_VOL_UP)             MX6QDL_PAD_NANDF_D0__GPIO2_IO00      0x80000000  // {{external-gpio-40}} (HOME)             MX6QDL_PAD_NANDF_D3__GPIO2_IO03      0x80000000  // {{external-gpio-41}} (SEARCH)             MX6QDL_PAD_NANDF_D2__GPIO2_IO02      0x80000000  // {{external-gpio-42}} (BACK)             MX6QDL_PAD_NANDF_D1__GPIO2_IO01      0x80000000  // {{external-gpio-43}} (MENU)             MX6QDL_PAD_GPIO_19__GPIO4_IO05       0x80000000  // {{external-gpio-44}} (KEY_VOL_DOWN)            // MX6QDL_PAD_DISP0_DAT22__GPIO5_IO16   0x80000000  // {{external-gpio-45}}             //MX6QDL_PAD_DISP0_DAT23__GPIO5_IO17   0x80000000  // {{external-gpio-46}}             MX6QDL_PAD_EIM_D25__GPIO3_IO25       0x80000000  // {{external-gpio-47}}             MX6QDL_PAD_KEY_ROW1__GPIO4_IO09      0x80000000  // {{external-gpio-48}}             MX6QDL_PAD_KEY_COL1__GPIO4_IO08      0x80000000  // {{external-gpio-49}}             MX6QDL_PAD_EIM_OE__GPIO2_IO25        0x80000000  // {{external-gpio-50}}             MX6QDL_PAD_EIM_CS1__GPIO2_IO24       0x80000000  // {{external-gpio-51}}             MX6QDL_PAD_EIM_CS0__GPIO2_IO23       0x80000000  // {{external-gpio-52}}             MX6QDL_PAD_EIM_D24__GPIO3_IO24       0x80000000  // {{external-gpio-53}}             MX6QDL_PAD_GPIO_8__GPIO1_IO08        0x80000000  // {{external-gpio-54}}             MX6QDL_PAD_GPIO_7__GPIO1_IO07        0x80000000  // {{external-gpio-55}}             >;         };     Finally, in imx6q-udoo-hdmi.dts enable ECSPI by including an ecspi1 node reference and setting the status property to "okay".   dts-v1/; #include "imx6q.dtsi" #include "imx6qdl-udoo.dtsi" #include "imx6qdl-udoo-externalpins.dtsi" / {     model = "UDOO Quad Board";     compatible = "udoo,imx6q-udoo", "fsl,imx6q";        mxcfb1: fb@0 {         compatible = "fsl,mxc_sdc_fb";         disp_dev = "hdmi";         interface_pix_fmt = "RGB24";         mode_str ="1920x1080M@60";         default_bpp = <32>;         int_clk = <0>;         late_init = <0>;         status = "okay";     }; }; &ecspi1 {     status = "okay"; };   Note: This could be done in .dtsi but the side effect is that any configuration including the dtsi will have ECSPI1 enabled by default.   Finally it is necessary to rebuild the device tree and copy it to the FAT partition of the sdcard. This process is explained in next section.   Rebuilding Image   Requirements In order to build an image as well as an application it is necessary to install a tool to cross-compile code, this way we will be able to generate executable files for ARM architecture in our host machine. This tool is called meta-toolchain, the following commands are used to install it.   In the following instructions it is considered that the build directory is ~/fsl-release_bsp/build_imx6qsabresd_qt5/   $ cd ~/fsl-release_bsp $ source setup-environment build_imx6qsabresd_qt5 $ bitbake meta-toolchain $ sh tmp/deploy/sdk/fsl-imx-x11-glibc-x86_64-meta-toolchain-cortexa9hf-vfp-neon-toolchain-<kernel>.sh Kernel   In order to enable the kernel SPI driver it is necessary to set it in the menuconfig and rebuild zImage.   Go to kernel directory within the Yocto build directory that we created. $ cd <build_directory>/tmp/work-shared/imx6qsabresd/kernel-source$   Launch menuconfig for imx $ source /opt/fsl-imx-x11/<kernel version>/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi $ make imx_v7_defconfig $ make menuconfig   Enable SPI Driver by going to Device Drivers --> SPI Support and seting '*' to SPI device Driver, save changes and then exit.     And build zImage $ make zImage   The generated file is located in <build_directory>/tmp/work-shared/imx6qsabresd/kernel-source/arch/arm/boot$ and it must be copied to the FAT partition of the SD card.   Device Tree   To build the device tree go to kernel directory within the Yocto build directory that we created. $ cd <build_directory>/tmp/work-shared/imx6qsabresd/kernel-source$   Build dtb file $ source /opt/fsl-imx-x11/<kernel version>/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi $ make imx_v7_defconfig $ make imx6q-udoo-hdmi.dtb   The generated file is located in <build_directory>/tmp/work-shared/imx6qsabresd/kernel-source/arch/arm/boot/dts$ and it must be renamed as imx6q-udoo.dtb and copied to the FAT partition of the SD card.   Application Driver   The SPI kernel driver uses a structure named spi_ioc_transfer which describes a single SPI transfer. It holds pointers to userspace buffers with transmit and receive data, length of buffers, speed, bits per word among other configurations. For further details you can refer to /include/uapi/linux/spi/spidev.h on your kernel source. In the next section the application driver is explained.   The source files of the application driver as well as the device tree sources can be found in the attached.zip file.   Main   The following code shows function main where the SPI driver is initialized driver using "/dev/spidev0.0" which is listed under /dev (in the target root file system) after SPIdev driver is enabled in menuconfig and kernel is rebuilt as indicated in previous section. Then it reads who am i register just for sanity check purpose and initializes and calibrates the sensor and enters in an endless loop where it reads the sensor whenever there is new data ready. Raw data is returned in 6 bytes, so it is managed to get X, Y and Z values and finally these values are converted to G's values and it waits until a key is pressed to continue to read the following value.     /****************************************************************************** * Main ******************************************************************************/ int main(){      //enableGPIO(); //In case of using interrupt instead of polling      file = spi_init("/dev/spidev0.0"); //dev      who();      FXLS8471Q_Init();      FXLS8471Q_Calibration();      while(1)      {          checkData();          if (DataReady) // Is a new set of data ready?          {              buffer = (unsigned char *)spi_read(OUT_X_MSB_REG, 6, file); // Read data output registers 0x01-0x06              printf("AccData[0] = 0x%X \n AccData[1] = 0x%X \n AccData[2] = 0x%X \n AccData[3] = 0x%X \n AccData[4] = 0x%X \n AccData[5] = 0x%X \n", AccData[0], AccData[1], AccData[2], AccData[3], AccData[4], AccData[5]);              Xout_14_bit = ((short) (AccData[0] << 8 | AccData[1])) >> 2; // Compute 14-bit X-axis output value              Yout_14_bit = ((short) (AccData[2] << 8 | AccData[3])) >> 2; // Compute 14-bit Y-axis output value              Zout_14_bit = ((short) (AccData[4] << 8 | AccData[5])) >> 2; // Compute 14-bit Z-axis output value              Xout_g = ((float) Xout_14_bit) / SENSITIVITY_2G; // Compute X-axis output value in g's              Yout_g = ((float) Yout_14_bit) / SENSITIVITY_2G; // Compute Y-axis output value in g's              Zout_g = ((float) Zout_14_bit) / SENSITIVITY_2G; // Compute Z-axis output value in g's              //printf(" X = %d Y = %d Z = %d \n\n", AccData[0], AccData[2], AccData[4]);              //printf("Xval = %d Yval = %d Zval = %d \n", Xout_14_bit, Yout_14_bit, Zout_14_bit);              printf(" XG = %f YG = %f ZG = %f \n\n", Xout_g, Yout_g, Zout_g);              getchar();         }      }      close(file); } Init Driver   The spi_init function opens a file for the driver "/dev/spidev0.0" which is passed as a parameter from main(), then the SPI configuration parameters are read just for informative purpose. Finally struct xfer which is of type spi_ioc_transfer is initialized.   /********************************* SPIdev Init **********************************************/ int spi_init(char filename[40]) { int file; unsigned char mode, lsb, bits; unsigned int baudrate = 524250, speed; printf("SPI Init \n"); if ((file = open(filename,O_RDWR)) < 0) { printf("Failed to open the bus."); /* ERROR HANDLING; you can check errno to see what went wrong */ com_serial=0; exit(1); } if (ioctl(file, SPI_IOC_RD_MODE, &mode) < 0) { perror("SPI rd_mode"); return -1; } if (ioctl(file, SPI_IOC_RD_LSB_FIRST, &lsb) < 0) { perror("SPI rd_lsb_fist"); return -1; } if (ioctl(file, SPI_IOC_RD_BITS_PER_WORD, &bits) < 0) { perror("SPI bits_per_word"); return -1; } if (ioctl(file, SPI_IOC_RD_MAX_SPEED_HZ, &speed) < 0) { perror("SPI max_speed_hz"); return -1; } printf("%s: spi mode %d, %d bits %s per word, %d Hz max\n",filename, mode, bits, lsb ? "LSB first" : "MSB first", baudrate); xfer[0].len = 3; /* Length of command to write*/ xfer[0].cs_change = 0; /* Keep CS activated */ xfer[0].delay_usecs = 0; //delay in us xfer[0].speed_hz = 524250; //speed xfer[0].bits_per_word = 8; // bites per word 8 xfer[1].len = 4; /* Length of Data to read */ xfer[1].cs_change = 0; /* Keep CS activated */ xfer[1].delay_usecs = 0; xfer[1].speed_hz = 524250; xfer[1].bits_per_word = 8; printf("SPI Init Finished \n"); return file; }     Write   The SPI communication is started with the  falling edge on chip select pin. A write operation is initiated by transmitting a 1 for the R/W bit. Then the 8-bit register address, ADDR[7:0] is encoded in the first and second serialized bytes. Data to be written starts in the third serialized byte. The order of the bits is as follows:   Byte 0: R/W, ADDR[6], ADDR[5], ADDR[4], ADDR[3], ADDR[2], ADDR[1], ADDR[0] Byte 1: ADDR[7], X, X, X, X, X, X, X Byte 2: DATA[7], DATA[6], DATA[5], DATA[4], DATA[3], DATA[2], DATA[1], DATA[0]   The SPI communication is finished with the  falling edge on chip select pin.   A you can see below array buf keeps the destination address and the data to be transferred, then xfer structure is configured to point to buf as the transfer buffer and the length of the data es set to 2 + data size (the first 2 bytes are for the destination address which is splitted in 2 bytes). Finally the transfer is started by the ioctl command.   /******************** Write a byte to the FXLS8471Q *************************** * Byte 0: 1,ADDR[6],ADDR[5],ADDR[4],ADDR[3],ADDR[2],ADDR[1],ADDR[0] * Byte 1: ADDR[7],0,0,0,0,0,0,0 * Byte 2: DATA[7],DATA[6],DATA[5],DATA[4],DATA[3],DATA[2],DATA[1],DATA[0] ******************************************************************************/ void spi_write(int registerAddress, int nbytes, char data, int file) { unsigned char buf[32]; int status; memset(buf, 0, sizeof buf); buf[0] = 0x80 | registerAddress; buf[1] = 0x80 & registerAddress; buf[2] = data; xfer[0].tx_buf = (unsigned long)buf; xfer[0].len = nbytes + 2; /* Length of command to write*/ status = ioctl(file, SPI_IOC_MESSAGE(1), xfer); if (status < 0) { perror("SPI_IOC_MESSAGE"); return; } com_serial=1; failcount=0; }     Below is the write operation which writes the value 0x3D to the CTRL_REG1 (0x2A).     Read   Similarly a read operation is initiated by transmitting a 0 for the R/W bit. Then the 8-bit register address, ADDR[7:0] is encoded in the first and second serialized bytes. The data is read from the MISO pin (MSB first).   In this case the array buf keeps the address that is going to be read and the third byte is just a dummy byte to be transferred. Structure xfer keeps transfer buffer pointer which in this case is buf and receive buffer which is AccData, the lenght of the command to write and the length of data to read is also specified and finally the read command is executed with ioctl call.     /********************** Read a byte from the FXLS8471Q *********************** * Byte 0: 0,ADDR[6],ADDR[5],ADDR[4],ADDR[3],ADDR[2],ADDR[1],ADDR[0] * Byte 1: ADDR[7],0,0,0,0,0,0,0 * Byte 2: 0,0,0,0,0,0,0,0 ******************************************************************************/ char * spi_read(int registerAddress, int nbytes, int file) { int status; memset(buf, 0, sizeof buf); memset(AccData, 0, sizeof AccData); buf[0] = 0x7F & registerAddress; buf[1] = 0x80 & registerAddress; buf[2] = 0x00; xfer[0].tx_buf = (unsigned long)buf; xfer[0].len = 2; /* Length of command to write*/ xfer[1].rx_buf = (unsigned long) AccData; xfer[1].len = nbytes; /* Length of Data to read */ xfer[1].speed_hz = 524250; status = ioctl(file, SPI_IOC_MESSAGE(2), xfer); if (status < 0) { perror("SPI_IOC_MESSAGE"); return 0; } com_serial=1; failcount=0; return AccData; }     The screenshot below shows the read operation which reads the correct value 0x6A from the WHO_AM_I register (0x0D).     Building and Run the SPI Application Driver   In order to build the application please save the source files and the Makefile (attached) on any place on your host machine and go to that directory where you saved them. Then build the application with the Meta-toolchain using the Make file with the following commands.   Build application driver $ cd <folder wher spi device driver source is saved> $ source /opt/fsl-imx-x11/<kernel version>/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi $ make   A spi_test file will be created in the same folder, copy this file into the sdcard on the Root File System partition in /home/root. Finally when booting the target execute the application. You must see the following output.       Conclusion   This document summarizes the steps to create a SPI application driver. As you saw it is necessary to rebuild the device tree and the kernel, and to do this it is necessary to install metatoolchain. The application driver uses the SPI kernel driver and its main functions are next: Init SPI Driver Read Write Init sensor Callibrate Sensor Polling data ready function   I would say that the core of the application driver are the read and write functions which configure the SPI kernel driver and pass data to it in the format required by the sensor.   For specific details on the driver please see the attached .zip file which contains the application driver code, the Makefile with the one it is build and the device tree sources.   I hope you find this document useful.     Carlos
View full article
Two IPUs are supported in i.MX6Q SoC, each IPU supports 1920x1080 resolution, and 4 kinds of interfaces on i.MX6Q PADs can be used to connect display devices: HDMI, Digital RGB24, LVDS1+LVDS2, MIPI DSI. In the documents, we will discuss how to expand VGA port with digital RGB and realize dual-display via HDMI & VGA, The solution has been validated on Android4.2.2 and Android4.4.2 BSP released by NXP. 1.  Expanding VGA port based on digital RGB24 interface with ADV7125 Schematic is in attachments. 2. Configurations of envionment variables in u-boot The following settings are for booting via NFS, users can adjust them to boot via Flash on board. setenv ipaddr 192.168.1.103 setenv serverip 192.168.1.102 setenv gateway 192.168.1.1 setenv ethaddr 00:04:9f:00:ea:d3 setenv bootargs_base 'setenv bootargs console=ttymxc0,115200' setenv bootargs_android 'setenv bootargs ${bootargs} init=/init androidboot.console=ttymxc0 androidboot.hardware=freescale' setenv bootargs_nfs 'setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gateway}:${netmask}::eth0 off root=/dev/nfs nfsroot=${serverip}:${nfsroot}' setenv bootargs_disp 'setenv bootargs ${bootargs} video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32 video=mxcfb1:dev=lcd,1920x1080M@60,if=RGB24,bpp=32 video=mxcfb2:off fbmem=32M vmalloc=400M' setenv bootcmd_net 'run bootargs_base bootargs_android bootargs_nfs bootargs_disp;tftpboot ${loadaddr} uImage;bootm' 3. Configurations in BSP file (1)IOMUX of DISP0 port (in header file)     MX6Q_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK,     MX6Q_PAD_DI0_PIN15__IPU1_DI0_PIN15,        /* DE */     MX6Q_PAD_DI0_PIN2__IPU1_DI0_PIN2,        /* HSync */     MX6Q_PAD_DI0_PIN3__IPU1_DI0_PIN3,        /* VSync */     MX6Q_PAD_DISP0_DAT0__IPU1_DISP0_DAT_0,     MX6Q_PAD_DISP0_DAT1__IPU1_DISP0_DAT_1,     MX6Q_PAD_DISP0_DAT2__IPU1_DISP0_DAT_2,     MX6Q_PAD_DISP0_DAT3__IPU1_DISP0_DAT_3,     MX6Q_PAD_DISP0_DAT4__IPU1_DISP0_DAT_4,     MX6Q_PAD_DISP0_DAT5__IPU1_DISP0_DAT_5,     MX6Q_PAD_DISP0_DAT6__IPU1_DISP0_DAT_6,     MX6Q_PAD_DISP0_DAT7__IPU1_DISP0_DAT_7,     MX6Q_PAD_DISP0_DAT8__IPU1_DISP0_DAT_8,     MX6Q_PAD_DISP0_DAT9__IPU1_DISP0_DAT_9,     MX6Q_PAD_DISP0_DAT10__IPU1_DISP0_DAT_10,     MX6Q_PAD_DISP0_DAT11__IPU1_DISP0_DAT_11,     MX6Q_PAD_DISP0_DAT12__IPU1_DISP0_DAT_12,     MX6Q_PAD_DISP0_DAT13__IPU1_DISP0_DAT_13,     MX6Q_PAD_DISP0_DAT14__IPU1_DISP0_DAT_14,     MX6Q_PAD_DISP0_DAT15__IPU1_DISP0_DAT_15,     MX6Q_PAD_DISP0_DAT16__IPU1_DISP0_DAT_16,     MX6Q_PAD_DISP0_DAT17__IPU1_DISP0_DAT_17,     MX6Q_PAD_DISP0_DAT18__IPU1_DISP0_DAT_18,     MX6Q_PAD_DISP0_DAT19__IPU1_DISP0_DAT_19,     MX6Q_PAD_DISP0_DAT20__IPU1_DISP0_DAT_20,     MX6Q_PAD_DISP0_DAT21__IPU1_DISP0_DAT_21,     MX6Q_PAD_DISP0_DAT22__IPU1_DISP0_DAT_22,     MX6Q_PAD_DISP0_DAT23__IPU1_DISP0_DAT_23,     MX6Q_PAD_NANDF_D4__GPIO_2_4,        /* ADV7125 Power on / off (2) Frame buffer static struct ipuv3_fb_platform_data qcorein_fb_data[] = { /*    {     .disp_dev = "ldb",     .interface_pix_fmt = IPU_PIX_FMT_RGB666,     .mode_str = "LDB-WXGA",     .default_bpp = 16,     .int_clk = false,     .late_init = false,     }, */     {     .disp_dev = "hdmi",     .interface_pix_fmt = IPU_PIX_FMT_RGB24,     .mode_str = "1920x1080M@60",     .default_bpp = 32,     .int_clk = false,     .late_init = false,     },     {     .disp_dev = "lcd",     .interface_pix_fmt = IPU_PIX_FMT_RGB24,     .mode_str = "1920x1080",     .default_bpp = 32,     .int_clk = false,     }, }; (3) Settings about IPUs /* HDMI -- IPU1_DI0 */ static struct fsl_mxc_hdmi_core_platform_data hdmi_core_data = {     .ipu_id = 1,     .disp_id = 1, }; /* RGB24 DISP0 LCD(Here is RGB24-->VGA via ADV7125 -- IPU0_DI0 */ static struct fsl_mxc_lcd_platform_data lcdif_data = {     .ipu_id = 0,     .disp_id = 0,     .default_ifmt = IPU_PIX_FMT_RGB24, }; (4) Adding LCD data in board_init() funtion static void __init mx6_qcorein_board_init(void) { .... imx6q_add_lcdif(&lcdif_data); ... } (5) Adding mxc_lcd.c driver to linux kernel When using make menuconfig to configure kernel, don't forget to add LCD driver to kernel.  Note: If users are using other version of android BSP, she can do porting according to above thinking. Weidong Sun NXP TIC team
View full article
To disable the Android dm-verity in the new devices you should have the below. A Window/Linux computer The Android SDK platform-packages tools. Download the Android Packages tool. To use the Android kernel or give root access to your Android device, it is needed to have some tools from the Android SDK like ADB or fastboot. To download those tools just go to below web-page: https://developer.android.com/studio#downloads Go to the “command line tools only” part and download the sdk-tools-windows-4333796.zip package. Note: Is recommended to store the content of the zip file in path that you could find without any problem since the Android SDK tools can only be run by the terminal console.   Unlock your Android device. On the Android GUI go to Settings -> systems -> About Phone At the bottom, you should see the build number of your Android device. Tap it multiple times until appears on the screen that you are a developer now. Go to the developer options and search for the OEM unlock option. You need to activate that option. Open the power-shell terminal and go to the path where you stored the zip file.   Example for Windows: cd C:\users\diego\Documents\platform-tools‍ Then you will use the ADB tool (Adroid Debug Bridge). To use it you need to run adb.exe in your power-shell terminal. To run an executable in the Windows terminal is just with ".\". Connect the serial download cable to the host computer (the Type C for the i.MX8M and i.MX8MM. The OTG for the i.M6 SabreSD boards). Open the adb server. .\adb.exe start-server‍ See your connected devices. .\adb.exe devices‍ You should see your device and the serial number that is assigned to the device. Then, enter into Bootloader mode. .\adb.exe reboot bootloader‍       Note to see if your board successfully entered to Bootloader mode. In your serial terminal, you should see that you are in Bootloader mode. Once inside the Bootloader mode, using fastboot you can unlock your phone. First, see if your computer recognizes your board once inside the Bootloader mode. .\fastboot.exe devices‍ If you do not see any device, go to Appendix A of the document. Finally, Unlock and reboot the board. .\fastboot.exe oem-unlock .\fastboot.exe reboot‍‍         Unlock the dm-verity option. After the board rebooted. Start again the adb server .\adb.exe start-server .\adb.exe devices‍‍ Then root the board .\adb.exe root ‍ After rooting the board, disable the dm-verity option .\adb.exe disable-verity‍ After disabling the verity option, it will request you to reboot your board. Just reboot your board. .\adb.exe reboot ‍ With that, you should have successfully disabled the verity option on your board.   Appendix A Update the USB driver (For Windows only) If your computer does not recognize once you are inside the bootloader mode. What you need to do is update the USB driver. To update the driver, follow the below steps. First, open your device manager and locate the Universal Serial Bus devices -> USB download gadget. Then press the right-click and select the Update driver option. Select the “Browse my computer for driver software” option. Select the “Let me pick from a list of available drivers on my computer” option.     Select the ADB Device Model.   And accept to install the driver. After that, your computer should recognize the board being into Bootloader mode.   Appendix B connects your Android device to a Linux computer through ADB.   You could face some adb problems if you want to connect your Android device to a Linux computer. If you want to use adb, the Android image does not allow you due to a permission problem. To make it work, you need to create a new rule for a plug device. To make the new rule, create a document inside the /etc/udev/rules.d named 51-android.rules. Inside the document write the following:   SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="d002", MODE="0660",  GROUP="plugdev", SYMLINK+="android%n"‍‍   Where the ATTR{idVendor} and ATTR{idProduct} is the USB id for the board. To know that information. Write lsusb and your Android device is the one named Google Inc. Then reboot your computer. With this new rule, ADB should work as usual. Hope this document could be useful to someone. Best regards, Diego.
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 the Robotic Operating System (ROS). If you are not using ROS you can also install the proper drivers and compile, in your Ubuntu system as explained on document:  https://community.freescale.com/docs/DOC-330278 1. Software & Hardware requirements 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. Software:   Gcc, Ubuntu 14.04v, OpenCV, Openni, Python, ROS. 2. Installation on ROS For installation steps of ROS on iMX6 boards in your board, please follow up: https://community.freescale.com/docs/DOC-3301478 Before you can use ROS, you will need to initialize rosdep. It enables you to easily install system dependencies for source you want to compile and is required to run some core components in ROS. $ sudo rosdep init $ rosdep update There are many different libraries and tools in ROS - not all compile fully on ARM. In this case we already have installed the ROS Base, however any other packages need to be installed individually. First install the following dependencies, which will take some time and space (~1.4 GB): $ sudo apt-get install --no-install-recommends freeglut3-dev libfreenect-dev libusb-1.0-0-dev libudev-dev ros-indigo-camera-info-manager ros-indigo-dynamic-reconfigure ros-indigo-image-transport ros-indigo-image-proc ros-indigo-depth-image-proc ros-indigo-tf ros-indigo-openni-launch ros-indigo-freenect-* ros-indigo-depthimage-to-laserscan ros-indigo-image-view ros-indigo-camera-info-manager ros-indigo-dynamic-reconfigure libudev-dev doxygen graphviz openjdk-6-jdk ros-indigo-openni2-camera ros-indigo-openni2-launch ros-indigo-rqt-common-plugins ros-indigo-rqt-graph There is no any additional installation to run kinect with ROS, If you are using kinect you can pass to part 4. However the packages used to run the PrimeSense / Asus Xtion on the i.Mx6 are not available over apt yet, so they need to be compiled from source. To use OpenNI2 with ROS, we only need the shared OpenNI2 libraries and the Drivers. Clone OpenNI2 $ git clone https://github.com/OpenNI/OpenNI2 $ cd OpenNI2 Edit ThirdParty/PSCommon/BuildSystem/Platform.Arm $ nano ThirdParty/PSCommon/BuildSystem/Platform.Arm and replace CFLAGS += -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp #-mcpu=cortex-a8 with CFLAGS += -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard Add support for pthread library: $ nano ThirdParty/PSCommon/BuildSystem/CommonCppMakefile Search the line 95 and add the code between the two lines: OUTPUT_NAME = $(EXE_NAME)                                                   # We want the executables to look for the .so's locally first:     LDFLAGS += -Wl,-rpath ./ +   ifneq ("$(OSTYPE)","Darwin") +       LDFLAGS += -lpthread +   endif     OUTPUT_COMMAND = $(CXX) -o $(OUTPUT_FILE) $(OBJ_FILES) $(LDFLAGS) endif Save the file and exit Then run make to compile the OpenNI2 drivers and libraries $ PLATFORM=Arm make ALLOW_WARNINGS=1 Once the compilation is done, run the linux install script $ cd Packaging/Linux $ sudo ./install.sh Copy libraries and includes to the system paths $ cd ../../ $ sudo cp -r Include /usr/include/openni2 $ sudo cp -r Bin/Arm-Release/OpenNI2 /usr/lib/ $ sudo cp Bin/Arm-Release/libOpenNI2.* /usr/lib/ Create a package config file $ sudo nano /usr/lib/pkgconfig/libopenni2.pc and fill it with this: prefix=/usr exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include/openni2 Name: OpenNI2 Description: A general purpose driver for all OpenNI cameras. Version: 2.2.0.0 Cflags: -I${includedir} Libs: -L${libdir} -lOpenNI2 -L${libdir}/OpenNI2/Drivers -lDummyDevice -lOniFile -lPS1080.so This will enable ubuntu to find the location of the drivers, libraries and include files. To make sure it is correctly found, run $ pkg-config --modversion libopenni2 Which should give the same version as defined in the file above (2.2.0.0). Now the Xtion is ready to be used. Plug it in (if it is already, unplug it first), then run the sample program $ ./Bin/Arm-Release/SimpleRead Then create a catkin workspace as described here, and check out the following packages in the src folder of the catkin workspace: $ cd ~/catkin_ws/src $ git clone https://github.com/ros-drivers/openni2_camera $ git clone https://github.com/ros-drivers/openni2_launch $ git clone https://github.com/ros-drivers/rgbd_launch Now the ros packages checked out above to the catkin workspace can be compiled with catkin_make $ cd ~/catkin_ws $ catkin_make Once the packages are compiled, the Xtion is ready for use with ROS with 3. Testing The Installation Kinect. Open at least 3 bash terminals: Terminal 1: Run ROS $ roscore Terminal 2:  launch the Freenect $ roslaunch freenect_launch freenect.launch Terminal 3: run the image capture $ rosrun image_view image_view image:=camera/rgb/image_color or: $ rosrun image_view image_view image:=camera/rgb/image_rect_mono or: $ rosrun image_view disparity_view image:=camera/depth/disparity It will open a new terminal with the rgb points, mono  and depth images  from the Kinect. Xtion.  Terminal 1: Run ROS $ roscore Terminal 2:  launch Openni2 $ roslaun openi2_launch openni2.launch Terminal 3: you can use rqt or Rviz session to visualize the sensor e.g: $ rqt or $ rosrun rqt_graph rqt_graph In the “rqt” window select “Plugins” -> “Visualization” -> “Image View“                                                             (optional) Install PySide, in any case you get an error with python rqt graph: $ pip install PySide $ cd ~/ Note: rqt and Rviz demand a lot of i.MX GPU work, so general graphic functionality will be affected. For this case is suggested to run rviz in a remote Network ROS session. References: -       www.ros.org -     https://dobots.nl/2014/05/05/asus-xtion-using-openni2-and-ros-on-udoo/
View full article
Question: If the i.mx6’s internal real time clock is not used,  instead an external I2C device is used,  does this create a problem with using any of the i.mx6’s security features? Answer: iMX6 Secure features uses and internal real time counter (SRTC) which if enabled and reaches the maximum value it generates an interrupt informing a security violation. External RTC can't be used in security iMX6 context. I2C external RTC for applications is needed, but for security features SNVS uses the internal SRTC. Question: If I'm interpreting your comments correctly - The customers external RTC can't be used in the context of iMX6 security but can still used be used for their applications needs.  To utilize the security features of the SNVS Module (RM Chp. 60), it must use the internal SRTC.  Disabling or otherwise not implementing the requirements the SNVS module has a cascading effect on many other security features such as High-Assurance Boot (HAB) and CAAM operation.  So it seems that if the customer must have an external RTC, they should still implement the requirements of the internal SNVS/SRTC. Answer: That's the case if secure features are needed they will end up using the internal SRTC, actually I don't think is possible to be used in other scenario as is part of SNVS. Question: To better understand the implications of not having battery backup for the SNVS supply as it pertains to security, if it is normally powered all the time via either a local AC supply or POE+ and is never powered down except for service, and reboots are done with a pushbutton. Given this, can you list what types of security features cannot be implemented or will be problematic? Answer: ???
View full article
►Playbin2 provides a stand-alone everything-in-one abstraction for an audio and/or video player. •Audio sink and video sink can be specified by application •Supports subtitle for video files •Adjustable A/V offset •Selects audio/video/subtitle streams by input selector •Audio post-processing by audio convert, audio resample and volume • ►The pipeline is created by playbin2 dynamically: •Typefind checks the source type •Demuxer parses the source data and create pads for all the streams, respectively •Playbin2 searches for and creates decoders in element factory who have capability to decode specific format of audio/video •Playbin2 creates and connects audio sink chain and video sink chain Playbin2: interaction with application ►Set/get properties of playbin2 •“audio-sink”, “video-sink” •“current-audio”, “current-video”, “current-text” •“n-audio”, “n-video”, “n-text” (read only) •“uri”, “suburi”, “av-offset”, “volume”, “mute” ►Events •Bidirectional: flush start, flush end •Downstream: eos, new segment, tag •Upstream: qos, seek ►Queries •Position, duration, latency, rate, seeking, segment ►Messages •Eos, error, warning, info, tag, buffering, state changed, duration, latency, ►Signals •“video-changed”, “audio-changed”, “text-changed” •“video-tags-changed”, “audio-tags-changed”, “text-tags-changed” Playback: track selection                                               ►Pipeline for audio/video/subtitle multi-track file •Demuxer creates src pads for all the tracks, respectively •Each track has its own decoder and sink pad of input selector •One sink pad in input selector is activated to play corresponding track •Audio, video and subtitle have separated input selectors. •Take audio for example:                                                                                                                                                         ►Input selector •Only push the data from active sink pad to its src pad •The data from all the sink pads shall be synchronized, so that timestamps can be consecutive when switch to another track. Otherwise, there will be no sound or video for a long time after switching track. •If demuxer gets samples in file mode (need a large queue before decoder):              A lock is set for each inactive tracks to synchronize tracks. Otherwise, the inactive tracks would be decoded in full speed (usually much more faster than active track).              The lock compares the received timestamp with the last timestamp of active track. If larger, waits until the next timestamp (buffer) of acitived track arrives; if smaller, drop this buffer and get the next buffer. •If demuxer gets samples in track mode and the queue is small:             All tracks is synchronized by demuxer
View full article
1) nfs I burn the uboot to board by mfgtool, then starting the kernel by nfs, when the board boot up, I set a) ipaddr and b)serverip, then I set the c)"setenv nfsroot /home/usuario/fsl-release-bsp/buildimx6q/tmp/work/imx6qsabresd-poky-linux-gnueabi/fsl-image-gui/1.0-r0/rootfs", this is sample, you need choose correct folder for yours, this is for imx6q, d) set the mdt file,then run the netboot. 2) program uboot to the qspi, then boot from SD card 3) change the mfgtool to program uboot, kernel to the qspi attched the ucl2.xml setenv bootcmd 'run bootargsset; sf probe; sf read ${loadaddr} 0xA00000 0x600000; sf read ${fdt_addr} 0x800000 0x10000; bootz ${loadaddr} - ${fdt_addr}'
View full article
i.MX evaluation board can be a simple solution to program i.MX boards in a factory for instance. i.MX evaluation board are not for industrial usage, but you can find plenty of cheap i.MX insdustrial boards on the web. Here I am using an i.MX8QXP rev B0 MEK board and I will program an i.MX6Q SABRE SD board. The first step is to generate your image. Follow the documentation steps to generate the "validation" image. You will have to customize a little bit the local.conf file (in conf/local.conf) to have git, cmake, gcc and other missing package. edit local.conf and add the following lines at the end of the file: IMAGE_INSTALL_append = " git cmake htop packagegroup-core-buildessential xz p7zip rsync"‍‍‍‍‍ I have added rsync package in local, it can replace cp (copy) but with the --progress option you can see the copy progression. P7zip replace unzip for our images archives avaialable on nxp.com as unzip as issues with big files. then rebake your image: bitbake -k fsl-image-validation-imx‍‍‍‍‍ When it is done, go in tmp/deploy/image/<your image generated> and use uuu to program your board (I use a sd card; thus I can increase the partition esily): sudo ./uuu -b sd_all imx-boot-imx8qxpmek-sd.bin-flash fsl-image-validation-imx-imx8qxpmek.sdcard.bz2/*‍‍‍‍‍ As the rootfs can be too small, use gparted under Linux for instance to increase the size of the partition. Put the SD card and start your board. Here here the dirty part... You may know archlinux|ARM websitesite (Arch Linux ARM ), you have a lots of precompiled packages. Thus on the board you can download it, and copy the file in /usr folder (you can use it to have the latest openSSL for  instance!). Plug an ethernet cable on the board and check if it is up: ifconfig -a ifconfig eth0 up‍‍‍‍‍‍‍‍‍‍ Now you should have access to the internet. On uuu webpage you can find all the packages you need (here I am using a 4.14.98_2.0.0 Linux): mkdir missinglibs cd missinglibs wget http://mirror.archlinuxarm.org/aarch64/core/bzip2-1.0.8-2-aarch64.pkg.tar.xz wget http://mirror.archlinuxarm.org/aarch64/core/nettle-3.5.1-1-aarch64.pkg.tar.xz wget http://mirror.archlinuxarm.org/aarch64/core/libusb-1.0.22-1-aarch64.pkg.tar.xz wget http://mirror.archlinuxarm.org/aarch64/extra/libzip-1.5.2-2-aarch64.pkg.tar.xz wget http://mirror.archlinuxarm.org/aarch64/core/zlib-1:1.2.11-3-aarch64.pkg.tar.xz wget http://mirror.archlinuxarm.org/aarch64/extra/p7zip-16.02-5-aarch64.pkg.tar.xz cd ..‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ Wait all the archives are downloaded (otherwise you'll decompress before the archive is downloaded) as wget is running in background! Now untar the archives and copy it in the rootfs (dirty): tar -xJf libzip-1.5.2-2-aarch64.pkg.tar.xz tar -xJf libusb-1.0.22-1-aarch64.pkg.tar.xz tar -xJf nettle-3.5.1-1-aarch64.pkg.tar.xz tar -xJf bzip2-1.0.8-2-aarch64.pkg.tar.xz cp zlib-1:1.2.11-3-aarch64.pkg.tar.xz zlib tar -xJf zlib tar -xJf p7zip-16.02-5-aarch64.pkg.tar.xz cd usr sudo cp -R . /usr cd ../../ ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ Download and compile uuu: git clone git://github.com/NXPmicro/mfgtools.git cd mfgtools/ cmake . make‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ Download an image on nxp.com for instance. I have downloaded on the i.MX6 4.14.98_2.0.0 image and put it on a usb key. then unzip it in the uuu folder: 7z e L4.14.98_2.0.0_ga_images_MX6QPDLSOLOX.zip‍‍‍‍ As mentionned before unzip cannot hadle big files... so use 7z as me plug the i.MX6Q SABRE SD to the i.MX8X and program your i.MX6 board: ./uuu uuu.auto-imx6qsabresd‍ uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.3.74-0-g64eeca1 Success 1 Failure 0 ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
View full article
In January 2013, Adeneo Embedded launched 2 dedicated blogs. These blogs are both run by Adeneo Embedded Windows and Linux experts, multiple time MVP awarded. The goal is to provide the windows and linux communities with specific up-to-date information as well as the latest announcements concerning these two companies. Click here to visit our Windows dedicated blog Click here to visit our Linux dedicated blog Follow, comment and subscribe ! Ce document a été généré à partir de la discussion suivante : Adeneo Embedded experts launch 2 dedicated blogs !
View full article
In FSL i.MX53 reference design, it is configured as: static struct mxc_audio_platform_data sgtl5000_data = { .ssi_num = 1, .src_port = 2, .ext_port = 5, .hp_irq = gpio_to_irq(HEADPHONE_DEC_B), .hp_status = headphone_det_status, .init = mxc_sgtl5000_init, .ext_ram_rx = 1, }; by default. If change the configuration to be : static struct mxc_audio_platform_data sgtl5000_data = { .ssi_num = 0, .src_port = 1, .ext_port = 5, .hp_irq = gpio_to_irq(HEADPHONE_DEC_B), .hp_status = headphone_det_status, .init = mxc_sgtl5000_init, .ext_ram_rx = 1, }; There will prompt "imx_ssi_irq mxc_ssi SISR 8003a3 SIER 180100 fifo_errs=XXXX"  constantly, and audio is greatly distorted. The root cause of this issue is that SSI1/3 use SDMA, and also use IPMUX, but there is not the clock dependency between SDMA and IPMUX, so sometimes IPMUX clock is closed automatically. The attached patch may fix this issue. NOTE: If use SSI2 .ssi_num = 1,             .src_port = 2, If use SSI1 .ssi_num = 0,             .src_port = 1,
View full article
JTAG Hardware and Software There are many opened and proprietary JTAG solutions. Here are some of them: Proprietary IAR Systems In-Circuit Debugging Probes Macraigor usb2Demon Segger - Jlink Free and Open Source Software GDB OpenOCD Open Hardware Turtelizer
View full article
We have validated Toshiba Smart NAND in our i.MX6SX platform, and boot successfully. The results are as below: 1. chip part number: THGBR2G5D1JTA00,  page_size: 16k+64  pages_per_block: 256 2. test platform: i.MX6SX Some information to take care of: 1. The pin assignment of smart nand is different from common raw nand, that is, Nand pin1 must connect to Vcc, pin2 connects to Vss, pin23 connects to VssQ, pin24 connects to VccQ, pin38 connects to VccQ 2. The ECC layout of FCB page itself must be set according to the i.MX6SX RM, otherwise FCB can't be read correctly. 3. EccBlock0EccType and EccBlockNEccType in FCB must be set as 0, and raw data can be put in DBBT and firmware without any ECC check codes.
View full article
Q: What is latency figures for the VPU to decode Device: i.MX6Q OS: Linux Resolution:                         1920x1080(HD) Frame rate:                        30 FPS Function:                             Overlay messages. Input/Output:                   8 bit / YUV 4:2:0 / NAL stream Profile level:                      4.1. Constrained Baseline. I and P frames support. A: It depend on the syntax in H.264, includes num_reorder_frames,max_dec_frame_buffering,num_ref_frames,MaxDpbSize,etc. for start latency: it cover vpu driver loading, allocate buffers, init, decoding the first frame less than 100ms on iMX6/Linux. This document was generated from the following discussion: VPU Latency i.MX6
View full article
When I am planing to develop some features in Uboot, I found it has lots limitation without interrupt. For example, to have camera preview in Uboot. Polling in Uboot results non sync when camera preview and hard to keep code simple and clean. I decided to take some time survey interrupt and it is time to share it.   This patch (shown as attachment) is to enable the interrupt. It also has the sample code to set GPIO interrupt as well. The test below showed Uboot can get the interrupt when pressing Volume up key. Special thanks for Anson Huang for patient discussing with me on this.   irqinfo is the command to enable Volume up interrupt. The log do_irq is print when Uboot got the interrupt.   Original Attachment has been moved to: 0001-Enable-interrupt-on-i.MX6Q-SabreSD.patch.zip
View full article
Q: Looking at the datasheet, why a 14.7KOhm pulldown and a 4.7KOhm pullup must be used? When useing 4.7KOhm resistors in series from an MCU to control the boot pins, pull up is ok, but pull down is not. The EIM boot pins only see 4.7KOhm and not 14.7KOhm as recommended in the design guide. How did we determine those resistor values? at boot there is a pull-up of 100KOhm in the pad if I understand well, 4.7KOhm would do the job as well as 14.7K. right? A: 4.7k will work fine for pull-up or pull-down. 10k pull-downs is to limit current drain while allowing use of simple SPST switches to configure boot-up. There are on-chip 100k pull resistors, so this limits max resistor size. This document was generated from the following discussion: EIM boot resistor value
View full article
In order to improve the speed of compilation, VMWare Player 14.0 is installed on local hard disk, and Ubuntu 18.04 LTS is installed on a SSD with at least 500GB size and USB3.1 specification. When installing ubuntu 18.04 LTS to SSD, it should be allocated at least 350GB of disk space, because compiling this version of android requires a larger disk space. The following are detailed compilation steps: Part l Configuring Ubuntu 18.04 LTS 1. Installing Ubuntu 18.04 on VMplayer 14.0 After installation is done, root user should be set at first. # sudo passwd root Then follow these steps to configuration ubuntu 18.04 for environment of compiliation --Changing sources of ubuntu 18.04 mirror If you are Chinese users, you can do the step, which can improve your system performance. # sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak # sudo geit /etc/apt/source.list Comment I.MX customers outside China do not need to modify Ubuntu source list, or can modify it to local mirror site of Ubuntu 18.04, which can improve the speed of software upgrade.    Delet all sources and copy following lines here, Then save it and exit Changing ubuntu source deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse    Then running these 2 commands to update sources and packages    # sudo apt-get update    # sudo apt-get upgrade 2. Installing packages for compiliation Packages for compiliation # sudo apt-get install flex bison gperf build-essential zlib1g-dev lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev tofrodos python-markdown libxml2-utils xsltproc # sudo apt-get install uuid-dev:i386 liblzo2-dev:i386 gcc-multilib g++-multilib subversion openssh-server openssh-client uuid uuid-dev zlib1g-dev liblz-dev lzop liblzo2-2 liblzo2-dev git-core curl # sudo apt-get install u-boot-tools mtd-utils android-tools-fsutils openjdk-8-jdk device-tree-compiler aptitude libcurl4-openssl-dev nss-updatedb # sudo apt-get install chrpath texinfo gawk cpio diffstat gdisk m4 libz-dev libssl-dev Part 2 Compiling Android Q10.0.0_2.1.0 BSP 1. Downloading NXP source code for Android Q10.0.0_2.1.0    File name is imx-android-10.0.0_2.1.0.tar.gz.    Copy the file to ~/, and decompress it.    # cd ~/    # tar zxvf ./imx-android-10.0.0_2.1.0.tar.gz    Then “imx-android-10.0.0_2.1.0” directory is created at ~/, now run the command to download android source code. # source ./imx-android-10.0.0_2.1.0/imx_android_setup.sh Comment imx_android_setup.sh is a script file, which includes all steps needed by the environment of android Q10.0.0_2.1.0 BSP. If network environment is enough good, several hours later, it will be done. 2. Compiling Android Q10.0.0_2.1.0 Referring to steps in Android_User's_Guide.pdf, We summaries steps for compilation here: (1) Preparing cross-compile tool chain    In Android_User's_Guide.pdf, 2 kinds of tool chain are recommended for users. --- gcc-arm-8.3-2019.03-x86_64-aarch64-elf.tar.xz --- gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz    Users can select one of them, and then decompress it to /opt/ directory. On how to download them or more details, see Android_User's_Guide.pdf, page 3. Here we will use gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz as tool chain. (2) Beginning to Compile Android Q10.0.0_2.1.0 BSP    Since this version of Android BSP requires high memory capacity when compiling, if the memory configuration of the virtual machine is incorrect, it is very likely to cause the compilation to fail. The following is a list of variable tests for user reference: # cd android_build # export AARCH64_GCC_CROSS_COMPILE=/opt/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/aarch64-linux-gnu- # source build/envsetup.sh # lunch evk_8mp-userdebug # ./imx-make.sh -j2 2>&1 | tee build-log.txt Part 3 Errors During Compilation 1. Allocating 8GB Memory For VMware Player # ./imx-make.sh -j1 2>&1 | tee build-log.txt 2. Allocating 12GB Memory For VMware Player # ./imx-make.sh -j4 2>&1 | tee build-log.txt # ./imx-make.sh -j4 2>&1 | tee build-log.txt (Run it again) # ./imx-make.sh -j4 2>&1 | tee build-log.txt (Run it again)       So if we use 4 thread to compile BSP, command for compilation will have to be run for 3 times. NXP TIC Team Weidong Sun 2020/4/30
View full article
imx7 supports TRULY-WVGA-TFT3P5581E display, the connector is J30, which is a connector on the imx7d board, normally, one can find the part number from BOM file, but imx7 Sabre-SDB board  BOM file missed this information. got connector information from expert team as below: The connector manufacture’s part number is: DF40C-24DS-0.4V(51)   For more detailed information about sabre board information information is available from nxp.com in the Design files for i.MX7Dual   For data sheet of this, which is under NDA, if you need it, pls create a salesforce case to get this, I couldn’t post this on public community.
View full article
Q: In mfgtool release 1.0.0 I, "Support only Cortex-A5 as primary boot core (Cortex-M4 boot is not supported on this release)." When will a version supporting M4 boot first be available? A: Mfg tool is based on it's counterpart, the ROM code. Rom code is for the A5 and not for the M4 as a matter of fact if you boot with the M4 and the device doesn't enumerate on the USB port at all then you know why and the MfgTool won't be able to do anything about it. Currently there no plans to provide a MfgTool version that supports boot from M4 core. Customers can modify the exisiting code to make it work with M4 as primary core. Booting from USB with the M4 core should work. The image that is booted must be for execution on M4 (thumb mode). MfgTool uses u-boot and a micro linux kernel to download images and program memories. This Linux can only run on the A5 core. To make it work with the M4 core as primary, it should be sufficient to add some code to the exisiting A5 images. Code will execute on M4 and start the A5 at the proper address as if it is booted from the A5.
View full article