i.MX Processors Knowledge Base

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

i.MX Processors Knowledge Base

Discussions

Sort by:
This patch release is target for LPDDR2 ( dual channels in interleave mode ) support on i.MX6DL platform. Two patches are prepared to modify u-boot and kernel in order to have correct DRAM init sequence, 400MHz & 24MHz frequency switching and suspend/resume support. The patches are not fully verified. It is provided as reference for customer to enable their i.MX6DL board with LPDDR2. Customization and Testing is needed by customer. We need to remind some points here: MMDC_MDCFG3LP in 24MHz need to increase the margin ( 0x40222 -> 0x80555 ) in order to pass the OS frequency switch stress test. We are identifying the reason but this workaround is working fine and included to the patch. Code changes in kernel is prepared so that it is compatible to DDR3. In other words, the DDR type will be detected and a correct handling will be done for LPDDR2 and DDR3. In LPDDR2 system, we can't put SDQ pin into LPM during suspend. Otherwise, the system cannot resume. Dual channels in fix mapping mode is not recommended to use.
View full article
Q: What is i.Mx6 ECSPI max frequency? https://community.freescale.com/message/338305 But in the RM we clearly state 60 MHz is the default config while Boot from SPI. I cannot measure it because I have no board where I can boot from SPI Nor. Also if I look at clocking, PLL  is 480MHz divided by 8 is fixed thus we get 60 MHz. Next divider can be either 1, thus ECSPI_CLK_ROOT  = 60MHz or 2, thus ECSPI_CLK_ROOT = 30 MHz. A: From i.MX6 Datasheet (IMX6DQCEC, Rev. 2.3, 07/2013), Table 52 (ECSPI Master Mode Timing Parameters) : ECSPIx_SCLK Cycle Time–Read • Slow group                                        55 ns • Fast group                                        40 ns         ECSPIx_SCLK Cycle Time–Write          15 ns So, only for writing we can get ~60 MHz.
View full article
Many times I came across one issue while using Redlib in MXUXpresso IDE project. I like to provide some guidance here to match the proper solution that can help others. Problem Statement : printf or sprintf doesn't print anything or printing random characters while using Redlib library. Reason : When you are creating your project you may ask to choose the c/c++ library setting to select either of the c libray provided by IDE in Advanced project setting wizard. If you have not checked the option "Redlib: Use floating point version of printf" (which will use the floating-point variant of printf) have tried to print the floating point value, You will end up with the problem mentioned above. Solution : You need to enable the floating support by modifying some preprocessor directives in "Defined symbols (-D)" wizard of your project. Path :  Your Project > properties > C/C++ Build > Setiings > Tool Settings > MCU C Compiler > Preprocessor. These are: PRINTF_FLOAT_ENABLE - keep the directive value to "1" SCANF_FLOAT_ENABLE - keep the directive value to "1" CR_INTEGER_PRINTF - Undefine/Remove this directive Click on Apply and close. That is it. Now you will have your expected prints for floating point values in your debugger console.
View full article
In this doc will show how to use i.MX8QXP DPU do image warp.   SW: i.MX Linux BSP L5.4.24_2.1.0 bsp release and patch in this doc HW: i.MX8QXP MEK board, ov5640 camera, HDMI display   Introduction Image Warping is the process of digitally manipulating image data such that the image’s projection precisely matches a specific projection surface or shape.   i.MX8QXP DPU controller could do image warp work by its blit engine and display engine. I choose to enable blit engine’s fetchwarp9 unit to do warp work. Check i.MX8QXP RM, Blit Engine support Image Warp as: “Performs a re-sampling of the source image with any pattern. The sample point positions are read from a compressed coordinate buffer.” So you need prepare two input buffers, one buffer store original image data, the other buffer store resample point coordinate, DPU blit engine will read that two buffer by fetchwarp9 unit, then output result image buffer which contain warped image data. Note i.MX8QXP DPU blit engine fetchwarp9 unit, for the input original image buffer, support RGB and YUV 4:4:4 format. The resample point coordinate buffer contents is depend on what kind warp transformation in your use case; and for each resample point coordinate format check i.MX8QXP RM fecthwarp unit description as below. In this doc, using the 2xs12.4 format, each point x coordinate use (12+4) bit, same as y coordinate.   For DPU fetchwarp9 unit, to enable it work for image warp, check i.MX8QXP RM:   2.Patch notes and test code imx8-dpu-warp-kernel.diff contain the kernel side change for drm ioctl api permission and add vmap function of ion dma_buf_ops. libg2d.so contain the binary for adding warp feature. g2d.h is header file which add define for G2D_WARP and G2D_YUV4. imx8-ov5640-dpu-warp-render.c is a sample code which show how to call g2d lib to image warp, need open the G2D_WARP flag. And this code contain some example calculate the coordinate buffer of rotate, swirl, barrel distortion, affine transformation, perspective transformation, wave transformation. And this code will show read camera input frame then add warp process , then render warp image frame to display.   The test cmd usage as below, read 1080P frame from ov5640 camera, do warp then render warp image to drm plane. Note as dpu fetchwarp9 unit support YUV 4:4:4 input image frame, so below cmd need set parameter YUV4, which will ask ISI driver output YUV 4:4:4 image frame. imx8-ov5640-dpu-warp-render  -i /dev/video0 -f YUV4  -S 1920,1080  -M imx-drm -p 91:38 -F XB24  -b 6  -e g2d  -t 5         -i <video-node> set video node (default: /dev/video0)         -f <fourcc>     set input format using 4cc         -S <width,height>       set input resolution         -s <width,height>@<left,top>    set crop area         -M <drm-module> set DRM module         -o <connector_id>:<crtc_id>:<mode>      set a mode         -p <connector_id>:<crtc_id>     output to a plane         -F <fourcc>     set output format using 4cc         -t <warptype>   set 0 neutual 1 rotate 2 swirl 3 divisionmodel 4 affine 5 perpsptive 6 wave         -b buffer_count set number of buffers        3.Example original image:                     Reference: https://www.nxp.com/webapp/Download?colCode=IMX8DQXPRM https://www.nxp.com/webapp/Download?colCode=L5.4.24_2.1.0_MX8QXPC0&appType=license https://en.wikipedia.org/wiki/Image_geometry_correction https://lists.freedesktop.org/archives/dri-devel/2012-March/019778.html https://store.kde.org/p/1246558 https://github.com/ImageMagick/ImageMagick        
View full article
Summary: The i.MX 8M-Mini can boot from QSPI flash using a dedicated boot image. The boot config settings are not correctly documented in the EVK Board Hardware User's Guide Rev 0 from 02/2019. In the document i.MX_Linux_User's_Guide.pdf  in the BSP documentation 4.14.98 the settings are correctly given in Table 38 Details: To generate a bootable file for the QSPI with Yocto, you need to include the following setting into local.conf: UBOOT_CONFIG = "fspi" If you don't want/need to make a complete build, just rebuild u-boot: bitbake -c deploy u-boot-imx Alternatively the file imx-boot-imx8mmevk-fspi.bin-flash_evk_flexspi included already in the BSP demo packages will work as well Program the image into QSPI: With UUU:   uuu -b qspi imx-boot-imx8mmevk-fspi.bin-flash_evk_flexspi With u-boot: u-boot=> fatls mmc 0:1 14557696   Image    …   1446848   imx-boot-imx8mmevk-fspi.bin-flash_evk_flexspi 11 file(s), 0 dir(s) u-boot=> sf probe SF: Detected n25q256a with page size 256 Bytes, erase size 4 KiB, total 32 MiB u-boot=> fatload mmc 0:1 0x40480000 imx-boot-imx8mmevk-fspi.bin-flash_evk_flexspi 1446848 bytes read in 79 ms (17.5 MiB/s) u-boot=> sf erase 0x0 0x200000 SF: 2097152 bytes @ 0x0 Erased: OK u-boot=> sf write 0x40480000 0x0 0x200000 device 0 offset 0x0, size 0x200000 SF: 2097152 bytes @ 0x0 Written: OK u-boot=> sf read 0x50000000 0x0 0x200000 device 0 offset 0x0, size 0x200000 SF: 2097152 bytes @ 0x0 Read: OK u-boot=> cmp.b 0x40480000 0x50000000 0x200000 Total of 2097152 byte(s) were the same u-boot=> Set boot config jumpers correctly and power on the board (no SD-card in the slot) 8M-Mini Rev A and Rev B boards:  01xxxxx0 0000x001 8M-Mini Rev C boards: 0110xxxxxx 00100x0010
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
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
  JEIDA-24 is adopted in most use-cases, and also the default format in Linux BSP(6.x)  Actually, JEIDA-18 is also supported in Linux BSP by not mentioned explicitly.   JEIDA-18 can be supported in two configuration: 1. Keep JEIDA-24 setting to display controllers, skip 4th data-lane in hardware connection: according JEIDA-24 output waveform, it has 4 data-lane enabled on LVDS bus: since the data-bits on TxOUT3 are the LSBs of the pixels, to change from JEIDA-24(RGB888, 4 data-lane) to JEIDA-18(RGB666, 3 data-lane), it can be achieved by skipping the TxOUT3 output(4th data-lane) in hardware connection, to make the JEIDA-18 format as the picture below(JEIDA-18 LCD panels only require 3 data-lanes)   2. Change the display controller settings to JEIDA-18: one reference by Variscite, one of the SoM vendor: https://variwiki.com/index.php?title=DART-MX8M-PLUS_Display&release=mx8mp-yocto-mickledore-6.1.36_2.1.0-v1.3 related setting quoted from the link above: Supported "data-mapping" values are "jeida-18", "jeida-24" and "vesa-24". Supported "fsl,data-mapping" values are "jeida", and "spwg". Supported "fsl,data-width" values are <18>, and <24>.    "data-mapping"= "jeida-18", "jeida-24" and "vesa-24" are handled in DRM driver, as the link below: https://github.com/nxp-imx/linux-imx/blob/d23d64eea5111e1607efcce1d601834fceec92cb/drivers/gpu/drm/drm_of.c#L451 if (!strcmp(mapping, "jeida-18")) return MEDIA_BUS_FMT_RGB666_1X7X3_SPWG; if (!strcmp(mapping, "jeida-24")) return MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA; if (!strcmp(mapping, "vesa-24")) return MEDIA_BUS_FMT_RGB888_1X7X4_SPWG;    Here the variable “MEDIA_BUS_FMT_RGB666_1X7X3_SPWG" is handled in ldb driver(MX8MP) as the link below: https://github.com/nxp-imx/linux-imx/blob/d23d64eea5111e1607efcce1d601834fceec92cb/drivers/gpu/drm/bridge/fsl-ldb.c#L144 switch (bridge_state->output_bus_cfg.format) { case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG: lvds_format_24bpp = false; lvds_format_jeida = true; break; case MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA: lvds_format_24bpp = true;  the bus_format would be "MEDIA_BUS_FMT_RGB666_1X18" in this configuration:  https://github.com/nxp-imx/linux-imx/blob/d23d64eea5111e1607efcce1d601834fceec92cb/drivers/gpu/drm/imx/imx8mp-ldb.c#L178 switch (ldb_ch->bus_format) { case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG: imx_crtc_state->bus_format = MEDIA_BUS_FMT_RGB666_1X18; break;    “MEDIA_BUS_FMT_RGB666_1X18” is not handled in LCDIF driver:  https://github.com/nxp-imx/linux-imx/blob/d23d64eea5111e1607efcce1d601834fceec92cb/drivers/gpu/imx/lcdifv3/lcdifv3-common.c#L310 switch (bus_format) { case MEDIA_BUS_FMT_RGB565_1X16: disp_para |= DISP_PARA_LINE_PATTERN(LP_RGB565); break; case MEDIA_BUS_FMT_RGB888_1X24: disp_para |= DISP_PARA_LINE_PATTERN(LP_RGB888_OR_YUV444); break; default: dev_err(lcdifv3->dev, "unknown bus format: %#x\n", bus_format); return;    hence there would be error message below in this configuration, which can be ignored: imx-lcdifv3 32e80000.lcd-controller: unknown bus format: 0x1009  
View full article
Hi all,      I have a problem about usb mass storage driver, that's it can't enumerate my mass storage device.      but it can enumerate my mouse, keyboard...etc hid device.      anyone have idea about it ?      I always get below messages when my mass storage device plugs in.      and below is my dmesg information      My hardware -->      Type A receptacle on otg controller ~
View full article
This documents describes how to add the NFC support to i.MX8M mini evk running Yocto. Hardware setup: The i.MX8M mini evk (see i.MX 8M Mini Evaluation Kit | NXP) featuring Raspberry Pi compliant connector, the OM5578/RPI PN7150 demo kit can be used to perform this porting (see NFC Development Kits for Arduino and more|NXP). However a small modification must be done because some of the signals required by PN7150 are not mapped to i.MX8M mini expansion connector pins. OM5578 IRQ signal must be mapped to Raspberry Pi connector pin #19 and OM5578 IRQ signal must be mapped to Raspberry Pi connector pin #21. See below a picture of the modification: Then, the two boards can fit together as shown in the picture below: Quick start using demo image: The demo image including support for PN7150, is based on i.MX Linux 4.14.78_1.0.0 BSP software release (see i.MX Software | NXP). Related documentation can be downloaded from here: https://www.nxp.com/webapp/Download?colCode=L4.14.78_1.0.0_LINUX_DOCS. Just flash the demo image (downloaded from here: https://www.nxp.com/lgfiles/updates/NFC/LINUX_L4-14-78_IMAGE_MX8MMEVK.zip) following guidelines from i.MX_Linux_User's_Guide document (part of L4.14.78_1.0.0_LINUX Documentation package mentioned above). Then in a terminal you can run the demo application included in the image executing the command:    # nfcDemoApp poll Approaching the NFC tag, provided as reference in the OM5578 demo kit, to the NFC Antenna will trigger such display: Adding PN7150 support to imx-linux-sumo release: Pre-condition is to have L4.14.78_1.0.0 release installed and already built as described in i.MX Yocto Project User's Guide (part of L4.14.78_1.0.0_LINUX Documentation package mentioned above) :     $ repo init -u https://source.codeaurora.org/external/imx/imx-manifest  -b imx-linux-sumo -m imx-4.14.78-1.0.0_ga.xml     $ repo sync     $ MACHINE=imx8mmevk DISTRO=fsl-imx-xwayland source fsl-setup-release.sh -b build_dir     $ bitbake fsl-image-validation-imx Then to add PN7150 support to your imx-linux-sumo environment, follow below step by step guidelines: In the sources directory, download the meta-nxp-nfc layer from https://github.com/NXPNFCLinux/meta-nxp-nfc     $ git clone https://github.com/NXPNFCLinux/meta-nxp-nfc.git  Define hardware connection between CPU and PN7150 in device-tree adding the following lines to file build_dir/tmp/work-shared/imx8mmevk/kernel-source/arch/arm64/boot/dts/freescale/fsl-imx8mm-evk.dts: @@ -227,6 +227,8 @@                         fsl,pins = <                                 MX8MM_IOMUXC_I2C3_SCL_I2C3_SCL                  0x400001c3                                 MX8MM_IOMUXC_I2C3_SDA_I2C3_SDA                  0x400001c3 +                               MX8MM_IOMUXC_ECSPI2_MOSI_GPIO5_IO11             0x41 +                               MX8MM_IOMUXC_ECSPI2_MISO_GPIO5_IO12             0x41                         >;                 };   @@ -747,6 +749,13 @@         pinctrl-0 = <&pinctrl_i2c3>;         status = "okay";   +       pn54x: pn54x@28 { +               compatible ="nxp,pn547"; +               reg = <0x28>; +               interrupt-gpios = <&gpio5 11 0>; +               enable-gpios = <&gpio5 12 0>; +       }; +         pca6416: gpio@20 {                 compatible = "ti,tca6416";                 reg = <0x20>; Add the meta-nxp-nfc layer to the build definition updating file build_dir/conf/bblayers.conf with: BBLAYERS += " ${BSPDIR}/sources/meta-nxp-nfc" Add the meta-nxp-nfc layer components to the image definition updating file build_dir/conf/local.conf with: IMAGE_INSTALL_append = " kernel-module-nxp-pn5xx nxp-nfc-bin " Re-build the linux kernel:     $ bitbake -f -c compile linux-imx && bitbake -f -c deploy linux-imx Build meta-nxp-nfc layer:     $ bitbake nxp-nfc Re-build the complete image to include the modifications:     $ bitbake fsl-image-validation-imx Then you can flash the updated image to your i.MX8M mini evk and run the demo application as described in above "Quick start using demo image" chapter. Reference: This porting have been done (demo image and instructions) following guidelines provided in AN11679_PN71xx_Linux_Software_Stack_Integration_Guidelines document.
View full article
This document describes the steps for flashing eMMC from SD Card on i.MX6Q SabreSD board. Download the prebuilt images (Linux 4.1.15) of i.MX6Q SabreSD board from this link. Flash the sdcard image on SD Card. sudo dd if=<sdcard_image> of=/dev/sdX bs=1M && sync Select Boot Mode to SD Card and boot the board from SD Card. Stop the console at u-boot and execute below command. ums 0 mmc 1                 // this will mount SD card as USB Mass Storage to your system Copy bootloader image from system to USB Mass Storage cp <u-boot_image> /media/username/<rootfs>/home/root/ Eject the USB Mass Storage and terminate the ums process by pressing ctrl+c in u-boot. Power Off and Power On the board and login to the kernel console. Flash the bootloader image to eMMC dd if=/home/root/<u-boot_image> of=/dev/mmcblk3 bs=512 seek=2 conv=fsync Mount the partition 1 of SD Card to copy the kernel image and DTB file to /home/root folder. mount /dev/mmcblk2p1 /mnt/ cp -r /mnt/zImage /mnt/imx6q-sabresd.dtb /home/root umount /dev/mmcblk2p1 Make partitions on eMMC manually as per section 4.3.3 in this document using fdisk /dev/mmcblk3 command. Format the partition 1 on eMMC as VFAT and partition 2 as ext4 with below commands mkfs.vfat /dev/mmcblk3p1 mkfs.ext4 /dev/mmcblk3p2 Mount the partion 1 of eMMC and copy kernel image & DTB file. mount /dev/mmcblk3p1 /mnt/ cp -r /home/root/zImage /home/root/imx6q-sabresd.dtb /mnt/ umount /dev/mmcblk3p1 Mount the partion 2 of eMMC & SD Card and copy the file system. mount /dev/mmcblk3p2 /mnt/                                                         // mount partition 2 of SD Card mkdir /home/root/rootfs && mount /dev/mmcblk3p2 rootfs     // mount partition 2 of eMMC cp -ar /mnt/* /home/root/rootfs/ sync umount /dev/mmcblk2p2 umount /dev/mmcblk3p2 Change the Boot Mode to eMMC Power Up the Board. (this will boot the images from eMMC) NOTE: Above steps does not require any other images for eMMC. All the images for eMMC and SD Card are same. Regards, Shivani
View full article
Attachched is the reference patch to enable the PMIC external watchdog in SCFW, it is based on SCFW porting kit v1.1.2 from NXP website: https://www.nxp.com/webapp/Download?colCode=L4.14.78_1.0.0_SCFWKIT&appType=license&location=null Please apply the patches to "imx-scfw-porting-kit-1.1.2/src/scfw_export_mx8qx_b0" On iMX8QXP MEK board, the patches will enable the PF8100 watchdog by macro "#define ENABLE_PMIC_EXTERNAL_WDOG", and it will refresh the watchdog timer by I2C interface. The default timeout value is 0xD for 8192ms (#define PMIC_EXTERNAL_WDOG_TIMEOUT  0xD), and SCFW will refresh it with 1000ms period (board_pmic_wdog_refresh_period_ms = 1000U). When the iMX8 system goto low power mode, it will pull SCU_PMIC_STANDBY to notify the PMIC, then PMIC will switch to suspend mode too, during PMIC suspend mode, this watchdog timer is off too. It will restart after PMIC resume to normal mode. Without PMIC OTP burning for WDOG, the current setting of patch will trigger hard reset after PMIC WDOG is timeout. 0001-scfw-add-board-board-tick.patch This patch is used to added polling ticket in board.c, after SCFW running, it will call board_tick() with 10ms period. In future SCFW release, this patch is not needed to apply, it is in default code, only when SCFW porting kit version is 1.1.2 and early version, you need apply this patch. 0002-scfw-enable-pmic-external-wdog.patch This is the reference patch to enable the PF8100 watchdog timer and refresh code. iMX8QXP MEK is used as the example. Note: In default SCFW, it had already used internel watchdog to make sure SCFW is always running, if SCFW is built as no debug version (M=0 D=0), all SCFW halt will cause SOC reset. And if hardware had connected the SCU_WDOG_OUT pin from iMX8QXP to PMIC's WDI pin, then during SOC reset, the PMIC will also do hard reset to make a POR reboot for the whole system.
View full article
Minicom       It's a simple terminal program, easy to configure and use. Can be downloaded and installed from your Linux package distribution (Synaptic, apt-get, yum) or through this link.       Minicom is a terminal emulation that can access a remote serial console enabling the configuration of Bootloader or the flash file system of the board.   Configuring       Run Minicom calling it from Terminal:     $ minicom       Reach the cofiguration by typing CTRL-A Z Press key Z after releasing CTRL and A. Configure Minicom to work with i.MX, follow the procedure below.   Set the Serial Port       At the screen configuration, type O, choosing Configure Minicom In menu, choose Serial Port Setup Below, the configuration option:       +-----------------------------------------------------------------------+ | A - Serial Device  : /dev/ttyS0                            | | B - Lockfile Location  : /var/lock                          | | C - Callin Program  :                                          | | D - Callout Program  :                                        | | E - Bps/Par/Bits  : 115200 8N1                          | | F - Hardware Flow Control : No                          | | G - Software Flow Control : No                            | |                                                                        | | Change which setting?                                      | +-----------------------------------------------------------------------+       Type the letter of option to enable the modification. Remember to choose the right Serial Device. Screen       Another useful program to use with serial ports is screen. It is a screen manager with VT100/ANSI terminal emulation usually available in Linux distributions. To open serial device /dev/ttyS0, for example, using 115200 baudrate, simply use:     $ screen /dev/ttyS0 115200       To kill the screen manager, use Ctrl + a, k. For a list of useful parameters and commands, try:     $ man screen
View full article
The getevent function shows kernel events like press button events, touchscreen events, sensor events (like accelerometers or magnetometers). bash-3.2# getevent -h Usage: getevent [-t] [-n] [-s switchmask] [-S] [-v [mask]] [-p] [-q] [-c count] [-r] [device]       -t: show time stamps       -n: don't print newlines       -s: print switch states for given bits       -S: print all switch states       -v: verbosity mask (errs=1, dev=2, name=4, info=8, vers=16, pos. events=32)       -p: show possible events (errs, dev, name, pos. events)       -q: quiet (clear verbosity mask)       -c: print given number of events then exit       -r: print rate events are received Bellow an example of all events on some board bash-3.2# getevent -p add device 1: /dev/input/event2   name:    "mxc_ts"   events:       SYN (0000): 0000  0001  0003       KEY (0001): 014a       ABS (0003): 0000  value 0, min 0, max 0, fuzz 0 flat 0                         0001  value 0, min 0, max 0, fuzz 0 flat 0                         0018  value 0, min 0, max 0, fuzz 0 flat 0 could not get driver version for /dev/input/mouse0, Not a typewriter add device 2: /dev/input/event1   name:    "mxc_power_key"   events:     SYN (0000): 0000  0001     KEY (0001): 003e add device 3: /dev/input/event0   name:    "mxckpd"   events:     SYN (0000): 0000  0001     KEY (0001): 0002  0003  0004  0005  003b  003c  003d  003e                       0066  0067  0069  006a  006c  008b  009e  0161 could not get driver version for /dev/input/mice, Not a typewriter For example, some touchscreen event. Any touchscreen press-up or press-down will return a vector of values related with the event (please, see include/linux/input.h for detail) bash-3.2# getevent /dev/input/event2 0003 0000 0000020e 0003 0001 0000014a 0003 0018 00000037 0001 014a 00000001 0000 0000 00000000 0003 0000 00000209 0003 0001 00000147
View full article
In the era of digitization, concepts like smart homes and the Internet of Things (IoT) are continuously evolving. To realize these visions, a robust and efficient network infrastructure becomes crucial. OpenWRT, with its open-source nature, high customizability, and excellent stability, has become a key player in leading the future development of networks. NXP, as a global leader in semiconductor technology innovation, leverages its expertise in embedded systems and communication to introduce an intelligent network solution based on OpenWRT, empowering the flourishing smart home and IoT ecosystems. This article will explore the current status and ways to access NXP's chip support for the wireless router solution, enabling readers to build a solid foundation for the next generation of networks. 1. Unique Features of OpenWRT 1.1. Noble Value of Open Source Freedom OpenWRT stands out with its open-source nature, granting users unlimited freedom to access, modify, and share the source code, unlocking significant innovation potential. This openness not only drives continuous technological advancements but also allows users to take active control of the network direction, saving costs. 1.2. Stable and Reliable Network Foundation Built on a mature Linux kernel, OpenWRT undergoes extensive evolution and fine-tuning, ensuring outstanding system stability. This results in fewer network failures, longer device lifespans, and solid support for various network needs. OpenWRT becomes an ideal choice for building reliable home networks, alleviating concerns about network instability or crashes. 1.3. Powerful Software Package Management OpenWRT's proud software package management system provides users with great flexibility. Users can freely install, update, and uninstall various applications and services based on their needs, achieving a highly personalized network environment for a smarter networking experience. OpenWRT allows users to install various network services and applications such as VPNs and proxy servers to meet specific network requirements, providing greater freedom to create a network environment that suits individual or family needs. 1.4. Strong Community Support The vast OpenWRT community is the source of its powerful driving force. Users can exchange experiences, solve problems, and even participate in project development within the community. This collaborative spirit propels continuous innovation and progress in OpenWRT. 2. Applications of NXP wireless router Solution 2.1. Construction of Smart Home Ecosystem The seamless integration of NXP's wireless router solution with the NXP Matter solution provides an ideal platform for users to build smart home ecosystems. With its powerful customization capabilities, users can easily connect, manage, and control various smart devices, creating a highly intelligent home environment. The solution integrates NXP's Bluetooth and Wi-Fi chip drivers, such as IW612, 88W9098, 88W8997, allowing users to effortlessly build an OpenThread Border Router (OTBR) or Zigbee Bridge based on OpenWRT. 2.2. Customized Network Services The NXP wireless router solution supports the customized installation of various network services and applications. Users can create personalized network services, such as VPNs, proxy servers, home routers, or gateways, based on their individual needs, achieving a more flexible networking experience. 2.3. Transmission of High-Definition Video Streams The transmission of high-definition video streams in smart homes imposes higher demands on network performance. NXP's wireless router solution, with its excellent network performance, combined with NXP's industrial-grade IP Camera solution, ensures users can smoothly enjoy high-definition video streams, providing a superior home entertainment experience. 2.4. Construction of Smart Security Systems Security systems are an essential part of smart homes. NXP's wireless router solution, with its advanced network security features, builds a more reliable and intelligent security system for users, enhancing home security. 3. NXP's Support for OpenWRT Given the numerous advantages and wide-ranging application scenarios of wireless router, NXP early on adapted to support OpenWRT. Full support has been provided for the entire Layerscape series processors, and mainstream IMX processors are also supported. The specific supported IMX platforms and details are as follows: Processor and Board Support         ARMv8                                             ARMv7       I.MX93EVK                                •      I.MX6ULL       I.MX8MPlus       I.MX8MMini       I.MX8MNano       I.MX8MQuad OpenWrt Version  Based on OpenWrt v23.05 from mainline (tag: v23.05.0-rc1) Toolchain: ARMV8: gcc-11.3, binutils-2.37 ARMV7: gcc-12.3, binutils-2.40 U-Boot Boot Loader IMX LF release, tag: lf-5.15.71-2.2.1 v2022.04 Linux Kernel       OpenWrt kernel 5.15.114 based on IMX SDK release kernel v5.15.71_2.2.1 Firmware       firmware-imx-8.18       firmware-sentinel-0.5.1 Main Features       Squashfs rootfs support on SD card.       Supported CLI and web configuation. - U-Boot: lf-5.15.71-2.2.1. - Arm Trusted firmware (TF-A) integration. - Boot from SDHC       Linux Kernel Core - Linux kernel 5.15.114 - Cortex-A53 (AARCH64), little endian for imx8m platform - Cortex-A55 (AARCH64), little endian for imx93 platform - Cortex-A7, little endian for imx6ull platform - 64-bit effective kernel addressing [Cortex-A53/A55]       Linux Kernel Drivers - SDIO 3.0 / eMMC5.1 - USB 3.0/2.0 Dual-Role with PHY type C - 32-bit LPDDR4 - 2x Gigabit Ethernet with AVB, IEEE 1588, EEE   and 1x w/ TSN - PCIe Gen 3 + WIFI - CAN FD - Dual-ch. QuadSPI (XIP) or 1x OctalSPI(XIP) - RTC Licensing The majority of the software included in the OpenWrt release is licensed under a form of open source license (e.g. GPL, BSD). Some software is licensed under the NXP EULA license. 4. How to Start Deploying and Using wireless router? To experience the powerful features of the Layerscape series chips with wireless router, download the source code from the official OpenWRT repository: https://git.openwrt.org/openwrt/openwrt.git. The OpenWRT support code for Layerscape is already integrated into the official OpenWRT codebase. Taking IMX8MMini-EVK as an example, here are the deployment steps for wireless router on the IMX platform using Ubuntu 22.04: 4.1. Get the source code from GitHub: https://github.com/nxp-imx/imx_openwrt (Tag: imx_v23.05_v5.15.114) 4.2. Compile, Install, and Configure wireless router: $ ./scripts/feeds update -a; ./scripts/feeds install -a; cp config.default .config; make -j $ sudo dd if=/mnt/tftpboot/imx8/matter_20230908/openwrt-imx-imx8-imx8mmini-squashfs-sdcard.img of=/dev/sdX bs=1M && sync This way, an wireless router bootable disk for SD card has been generated. You can directly use an SD card to boot and experience wireless router. For more compilation assistance, please refer to the README file in the source code: target/linux/imx/README. 4.3. Configuration and Personalization Users can access the wireless router device through the web interface or SSH to begin configuring and personalizing the network environment. This includes setting network rules, installing software packages, and ensuring that the device operates according to individual needs. The following image shows the interface for installing and removing software. Isn't it simple and convenient! 4.4. What to Do If You Encounter Issues? Firstly, you can seek support in the vibrant OpenWRT community. You can not only get assistance but also share your development or usage experiences and even participate in project development. This open community provides users with more opportunities for learning and growth, collectively driving continuous progress in OpenWRT. You can also participate in the official NXP community at https://community.nxp.com/t5/i-MX-Processors/bd-p/imx-processors to ask questions and share technical insights. Professional engineers are available to help you troubleshoot and overcome challenges. NXP OpenWRT looks forward to your participation!   Disclaimer This wireless router release is an NXP's Systems Engineering Initiative and is not part of NXP's Linux base enablement strategy for its MPU platforms. NXP does not vouch for the quality of this release and any follow up releases including adding support to new platforms is at the sole discretion of the Systems Engineering team. For specific requirements or needs please reach out to NXP's systems engineering team on the following email address "[email protected]."
View full article
This is the procedure and patch to set up Ubuntu 12.04 64bit Linux Host PC and building i.MX6x L3.0.35_4.1.0.  It has been tested to build GNOME profile and with FSL Standard MM Codec for i.MX6Q SDB board. A) Basic Requirement: Set up the Linux Host PC using ubuntu-12.04.3-desktop-amd64.iso Make sure the previous LTIB installation and the /opt/freescale have been removed B) Installed the needed packages to the Linux Host PC $ sudo apt-get update $ sudo apt-get install gettext libgtk2.0-dev rpm bison m4 libfreetype6-dev $ sudo apt-get install libdbus-glib-1-dev liborbit2-dev intltool $ sudo apt-get install ccache ncurses-dev zlib1g zlib1g-dev gcc g++ libtool $ sudo apt-get install uuid-dev liblzo2-dev $ sudo apt-get install tcl dpkg $ sudo apt-get install asciidoc texlive-latex-base dblatex xutils-dev $ sudo apt-get install texlive texinfo $ sudo apt-get install ia32-libs libc6-dev-i386 lib32z1 $ sudo apt-get install uboot-mkimage $ sudo apt-get install scrollkeeper $ sudo apt-get install gparted $ sudo apt-get install nfs-common nfs-kernel-server $ sudo apt-get install git-core git-doc git-email git-gui gitk $ sudo apt-get install meld atftpd C) Unpack and install the LTIB source package and assume done on the home directory: $ cd ~ $ tar -zxvf L3.0.35_4.1.0_130816_source.tar.gz $ ./L3.0.35_4.1.0_130816_source/install After that, you will find ~/ltib directory created D) Apply the patch to make L3.0.35_4.1.0 could be installed and compiled on Ubuntu 12.04 64bit OS $ cd ~/ltib $ git apply 0001_make_L3.0.35_4.1.0_compile_on_Ubuntu_12.04_64bit_OS.patch The patch modifies the following files: dist/lfs-5.1/base_libs/base_libs.spec dist/lfs-5.1/ncurses/ncurses.spec E) Then, it is ready to proceed the rest of the LTIB env setup process: $ cd ~/ltib $ ./ltib -m config $ ./ltib Reference: L3.0.35_4.1.0_130816_docs/doc/mx6/Setting_Up_LTIB_host.pdf https://community.freescale.com/message/332385#332385 https://community.freescale.com/thread/271675 https://community.freescale.com/message/360556#360556 scrollkeeper is for the gnome-desktop compilation NOTE: When compiling gstreamer, this warning was pop up.  Just ignore it seems okay.
View full article
These questions and answers are about interrupt generation at a dedicated (configurable) video output port. The i.MX6D manual (Rev. 0) Image Processing Unit (IPU) chapter mentions: Every DI has 10 timing generator counters. The IPU Interrupt Generator has 10 DI0 counters (1...10) and just 2 DI1 counters (3 & 😎 as interrupt sources. The Interrupt Control Register lists 11 DI0 counters (0...10) Q1. Are the DI timing-generator counters linked to the counters in the interrupt controller, or are they different counters? A1. Yes, the DI timing generator counters are linked to the counters in the interrupt controller. Q2. Why are there 11 counters listed in the interrupt controller, but just 10 counters in the timing generator? A2. There is disp_clk_en_pre in the interrupt controller. Thus the 11 counters: 10 timing generator counters and 1 disp clock generator counter. Q3. Is configurable timing feasible for DI0 by using the timing generator counters? A3. Yes, using the 10 internal timing counters you can generate various timing relationships. In addition, you can detect any of the interrupt counters. For example, if you use counter 8, then you can detect the interrupt associated with counter 8. Q4. Explain the impact of the DI1 counter access of only channels 3 and 8. A4. DI1 also has 10 timing generator counters and 1 disp clock generator counter, which you can use to generate desired waveforms. This is similar to DI0. The difference is only 2 of the 10 counters (plus another disp_clk) are connected to the interrupt controller for DI1. Therefore, there is a restriction for detection. If you use counter 7, read out the counter 7 interrupt of DI1 is not possible. However, 2 channels should be sufficient. These interrupts are usually used to indicate a frame start or a frame end. We usually use counter 3 to represent Vsync. So normally we only use counter 3 interrupt. DI1 has only 3 accesses because this covers the anticipated use case and the desire was to restrict register size. The extra counters facilitate flexible DI1 timing generation.
View full article
Introduction There are four boot logos in kk4.4.3_2.0.0-beta  system at first: uboot logo\linux logo\android init logo\android animation. We plan to use uboot logo to cover linux logo and android init logo so that we  can combine first three logoes into one logo.This guide provides a step by step explanation of how to transfer uboot UI to  linux kernel and android init smoothly on board sasbresd_6dq sabresd_6dl. The core ideas of the patch: need to  keep display clock from uboot to kernel. When kernel boot up , we do not break the frambuffer for that it stores uboot logo data. need to disable show android init logo. what do the patch do in uboot 1、 can not shut down video after uboot is over.The patch delete releted code in function  arch_preboot_os() 2、 keep hsp clock (ipu clock) the same with linux 3.10 the below is the setting in sabrasd DQ board: osc(24MHz) -> pll2(528MHz) -> mmdc_ch0(528MHz) -> ipu1_hsp_clk(264MHz) the below is the setting in sabrasd DL board: osc(24MHz) -> pll3(480MHz) -> pll3_pdf1(540MHz) -> ipu1_hsp_clk(270MHz) 3、 keep pixel clock the same with linux 3.10 the below is the setting in sabrasd DQ board: osc(24MHz) -> pll2(528MHz) -> pll2_pfd0(452.57MHz) -> ldb_di1(64.65MHz) -> ipu1_di1(64.65MHz) -> ipu1_pixel(64.65MHz) the below is the setting in sabrasd DL board: osc(24MHz) -> pll2(528MHz) -> pll2_pfd0(452.57MHz) -> ldb_di1(64.65MHz) -> ipu1_di1(64.65MHz) -> ipu1_pixel(64.65MHz) 4、 keep pwm clock In kernel,there is a 100% duty pwm to drive lvds panel.So the patch set the pad SD1_DATA3 to a 100% duty pwm pin. 5、 add fbbase and fbmem to bootargs the fbbase is the uboot logo’s phy addr. So the patch pass the parament to kernel through cmdline.we should allocate address aligned 1M for linux 3.10 reserve address aligned by 1 M. what do the patch do in linux 3.10 1、 reserve the address which come from fbbase 2、 keep  ipu related clock when system init the clock in clk-imx6q.c The patch  enable ldb_di1_clk、ipu1_di1_clk、ipu1_clk、pwm1_clk.  Do not disable pll2 and pll3 related clock for the clock may be the source of  ipu clock. Although we enable ldb_di1_clk、ipu1_di1_clk and so on in register, we need to use the function clk_prepare_enable(). Because  the system may close some clocks for their user count is 0(if we use clk_prepare_enable(),it and it’s parent  user count will add 1 ) 3、 disable cabc which will light the panel according the content. Change cabc_enable in dts file. 4、 Move global alpha and color key setting in probe  after framebuffer is registered. Delay       register IPU interrupts used by framebuffer  until IPU hsp clock is enabled.Because global alpha and color key setting and register IPU interrupts may disable hsp clock. disable show android init logo android init logo is the text"android_". we need disable to show it so that the former three logos looks the same logo.The patch 92-system_core solve this problem. The environment of the patch: Hardware: SABRASD DQ&DL Soft ware: kk4.4.3_2.0.0-beta on linux 3.10 How to use the patch: $ cd my_android/kernel_imx/ $ patch -p1 < ./92-kernel_v2 $ cd my_android/bootable/bootloader/uboot-imx/ $ patch -p1 < ./92-uboot_v2     $ cd my_android/system/core $ patch -p1 < 92-system_core Note:      1、 If you want to have this feature on sabraSD dq&dl board,this patch is OK .After you use this patch, you want to change to  other board such as sx, you may meet this problem that the kernel logo penguin don’t appear. You may change this file: arch/arm/configs/imx_v7_android_defconfig                 CONFIG_LOGO=y                 CONFIG_FRAMEBUFFER_CONSOLE=y                 CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y                 #CONFIG_MX6_CLK_FOR_BOOTUI_TRANS=y                 #CONFIG_MX6_CLK_FOR_BOOTUI_TRANS_LVDS_IPU1_DI1=y
View full article
Hello all. This document shows how to play the puzzle game “2048” on the RIoTboard running Ubuntu. The RIoTboard is an open source platform featuring the powerful i.MX 6Solo, a multimedia application processor with ARM Cortex-A9 core at 1 GHz.For complete information regarding RIoTboard characteristics and its user manual, you could refer to the following links: RIoTboard wepage: http://riotboard.org/ User Manual: http://www.element14.com/community/servlet/JiveServlet/previewBody/65502-102-2-288206/RIOT_Board_User_Manual_v1.1.pdf Flashing the Ubuntu image to RioTboard. First, we need to get the Ubuntu image and Mfg Tool from the following page: http://www.element14.com/community/docs/DOC-68442/l/riotboard-bsp-images-and-tools-download--android-and-linux Once getting the software, it is required to configure the Boot Configuration Select switches (SW1) for Serial Downloader Mode as shown below: After completing the download of the software, it is requiered to configure the switches for booting from eMMC, as shown below: For additional details regarding Boot modes, you could refer to chapter 4 of the RioTboard User Manual. How to connect EVBUSB2SER to RIoT board for debug terminal. By default, the Debug serial port of the RioTboard is routed to the J18 header (labeled as “Debug”), so, if you have a EVBUSB2SER board, you could use it to access to this serial port by USB. In order to avoid damages between boards, please ensure of the following (on the EVBUSB2SER board): Switch SW1 is in the 3.3V position. Jumper J3 (which enables the level-shifter IC) is removed, as it won’t be requiered. Finally, the connections between EVBUSB2SER and RioTboard should be as follows: Pin Number on EVBUSB2SER header P1 Pin Number on RIoTboard header J18 7 (RXD) <-----> 1 (UART2_TXD) 8 (TXD) <-----> 2 (UART2_RXD) 9 (GND) <-----> 3 (GND) The following image shows both board connected as mentioned: How to change the HDMI display resolution using bootargs. With the serial console connected, you could see the boot log, and stop the boot process for enter to U-Boot for changing the HDMI display resolution (enviroment variable “bootargs”). If you want to know the default vales, you could call the following command:    printenv bootargs So, for changing the resolution to 1920x1080 and then booting, you should do the following: setenv bootargs console=ttymxc1,115200 nosmp video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32 video=mxcfb1:off saveenv boot Getting the source code of 2048 game and compiling it. On the following webpage you could find the source code of a working 2048 game on a single C file: https://github.com/mevdschee/2048.c On the same page are included the instructions for downloading and compiling it, which are the shown below (using either Serial Debug console or a Terminal window). The Ubuntu image should already include the gcc compiler: wget https://raw.githubusercontent.com/mevdschee/2048.c/master/2048.c gcc -o 2048 2048.c If you want to visualize the source code you could try: cat 2048.c Play! Either using Serial Debug console or a Terminal window (or both) you could now launch the 2048 game my simply launching the compiled executable:    ./2048 Below you can find screen captures of the game running on both scenarios: Hope this will be useful and funny for you. Best regards! /Carlos
View full article