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:
Instruction On Linux OS, we have two major audio system API to play/record audio pcm, alsa-lib and pulseaudio. Pulseaudio is in Freescale Ubuntu root fs release, while alsa-lib is used by default in LTIB release. This article is to tell how to configure alsa-lib by configuration file. Architecture Alsa-lib has a set of standard API which allows application to develop easily. At the same time, it provides a scalable mechanism to fulfill its features, including resample, channels remix, sound mixing from different applications, and so on. As above figure describes, alsa plugin provide fundamental function, and the whole pipeline makes customization possible. Alsa-lib API pretend to be an alsa device and provide a name for caller to open. What kind of plugin the name represents for is decided by configuration. For example, pcm.card0 {    type hw    card 0 } card0 is the fake alsa device name, with type hw, which represents for the first real alsa device. pcm.plug {     @args [ SLAVE ]     @args.SLAVE {         type string     }     type plug     slave.pcm $SLAVE } plug is the fake alsa device name, with type plug, which represents for audio conversion processor. In addition, it's also receive arguments from application that make it more flexible. When we call snd_pcm_open(.., "plug:card0",..); in the application, we create a pipeline which will first convert the source pcm to sound card 0 capable pcm if necessary in "plug" plugin, then play it to sound card 0 in "card0" plugin.  "slave.pcm" is the key to link different plugins. The number of arguments could be more than one, with definition pcm.xxx {     @args [ arg1 arg2 arg3 ]     @args.arg1 { type string }     @args.arg2 { type string }     @args.arg3 { type string }     ... } The argument could also have default value, please refer to /usr/share/alsa/alsa.conf. To pass the arguments, use snd_pcm_open(.., "xxx:arg1,arg2,arg3",..); From the name, we can always follow the pipeline to the last plugin, which type might be hw(to alsa driver), file(to file), or others (pulse, bluetooth...) to network, protocol stack and so on. The Configuration Files In configuration file, we mainly define the fake alsa device name. The root configuration file is /usr/share/alsa/alsa.conf, which will load additional configuration files which might overwrite previous name definition in the previously loaded file. The load sequence is: 1. /usr/share/alsa/alsa.conf 2. /usr/share/alsa/alsa.conf.d/* 3. /etc/asound.conf for administrator 4. $(HOME)/.asoundrc for certain user In practice, alsa applications (e.g. aplay or speaker-test) are always using "default" as the fake device name, so that the most important thing to customize your own pipeline is to overwirte "default". For example, pcm.dmix_44100{     type dmix     ipc_key 5678293     ipc_key_add_uid yes     slave{         pcm "hw:0,0"         period_time 10000         format S16_LE         rate 44100     } } pcm.!default{     type plug     route_policy "average"     slave.pcm "tee:dmix_44100,/home/wayne/a.pcm" } The "!" in "pcm.!default" means forcing overwrite. The pipeline defined above is as following figure: The next example is the "default" definition on ubuntu root fs. pcm.!default {     type pulse     hint {         show on         description "Playback/recording through the PulseAudio sound server"     } } The only alsa plugin is "pulse", and the pipeline is as following: Additional Resources There are a lot of alsa plugins developed, with various configuration parameters, I won't list them in detail. Please refer to .asoundrc - ALSA wiki for more details.
View full article
This is a detailed programming aid for the registers associated with i.MX 8M (m850D) DDR initialization.  For more details, refer to the main mScale DDR tools page: https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8M-Family-DDR-Tool-Release/ta-p/1104467 Please note that this page is only intended to store the RPA spreadsheets. For questions, please create a new community thread.
View full article
As of this writing, April 2015, the default sdcard image created from a Yocto Project build has all the software images nicely aligned to create a SDCARD. 10/7/2020: Update - SDCARD image names have been updated to images ending with .wic as the default from Yocto Project.  The process is the same for both .sdcard and .wic files.   There are two partitions within the image: A W95 FAT32 (LBA) partition that contains the Linux zImage, and various device tree binary (dtb) files A Linux root file system. Each partition can be mounted from your Linux host computer, then you can read or write the partition contents. Here are the steps based on the core-image-base recipe for the imx6sxsabresd machine using Yocto Project release L3.14.28_1.0.0_GA.   The name of the image: core-image-base-imx6sxsabresd.sdcard Run the fdisk command to view the contents of the image: $ fdisk -l core-image-base-imx6sxsabresd.sdcard Disk core-image-base-imx6sxsabresd.sdcard: 100 MB, 100663296 bytes 4 heads, 32 sectors/track, 1536 cylinders, total 196608 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00074663 Device Boot Start End Blocks Id System core-image-base-imx6sxsabresd.sdcard1 8192 24575 8192 c W95 FAT32 (LBA) core-image-base-imx6sxsabresd.sdcard2 24576 188415 81920 83 Linux   Determine the byte offset into the sdcard image of where each partition starts:  core-image-base-imx6sxsabresd.sdcard1 starts at sector 8192. One sector unit is 512 bytes.                8192 * 512 = 4194304 core-image-base-imx6sxsabresd.sdcard2 starts at sector 24576. 24576 * 512 = 12582912   Mount Partitions First create mount points: $ sudo mkdir /mnt/{mp1,mp2}    sdcard1 partition $ sudo mount -o loop,offset=4194304 core-image-base-imx6sxsabresd.sdcard /mnt/mp1 NOTE: An alternate method for determining the offset, see below: $ sudo mount -o loop,offset=$((512 * 8192)) core-image-base-imx6sxsabresd.sdcard /mnt/mp1 sdcard2 partition $ sudo mount -o loop,offset=12582912 core-image-base-imx6sxsabresd.sdcard /mnt/mp2 View the contents of each mounted partition $ ls /mnt/mp1 imx6sx-sdb.dtb imx6sx-sdb-lcdif1.dtb imx6sx-sdb-reva.dtb imx6sx-sdb-sai.dtb imx6sx-sdb-emmc.dtb imx6sx-sdb-m4.dtb imx6sx-sdb-reva-ldo.dtb zImage $ ls /mnt/mp2 bin boot dev etc home lib lost+found media mnt proc run sbin sys tmp usr var   When done release the mount points and remove them from /mnt $ sudo umount /mnt/{mp1,mp2} $ sudo rm /mnt/{mp1,mp2}  
View full article
Trace the malloc and expose violate access to freed memory Introduction Libc has a malloc debug framework for difference debugger. Each debugger takes as a libraries, and override the default malloc/free/calloc/realloc/, hooked before calling the real functions. NOTE: This tip assume that you are working with an eng or userdebug build of the platform, not on a production device. Trace the low level malloc/free in bionic Bionic has a malloc debugger called leak debugger, which can record all the malloc/free in low level. And developers can use ddms on host to check each block of memory on heap by malloc. And ddms support convert caller function address to name conver. That makes easy for us to check which component, which function allocated for how many memories. You can turn on memory tracking with debug level 1: $ adb shell setprop libc.debug.malloc 1 $ adb shell stop $ adb shell start You need to restart the runtime so that zygote and all processes launched from it are restarted with the property set. Now all Dalvik processes have memory tracking turned on. You can look at these with DDMS, but first you need to turn on its native memory UI: Open ~/.android/ddms.cfg Add a line "native=true" Upon relaunching DDMS and selecting a process, you can switch to the new native allocation tab and populate it with a list of allocations. This is especially useful for debugging memory leaks. NOTE: to solve the module symbols, please export two env on HOST: $ export PATH=$PATH:<android src>/prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin $ export ANDROID_PRODUCT_OUT=<android src>/out/target/product/<platform> Expose the memory access to freed area In this release he Electric Fence 2.2.0 has been ported to Android. it's also a memory debugger tool as above leak debugger. It helps you detect two common programming bugs: software that overruns the boundaries of a malloc() memory allocation, and software that touches a memory allocation that has been released by free(). It will dump the call stack and mmap of the process, if the malloc/free is not called with correct parameters. It will also make a segment fault, when applications want to access the address which is freed. The usage of efence is almost same as above, which we define it's debug level to 15: $ adb shell setprop libc.debug.malloc 15 After setting this property, you can run your applications, and if there's any memory leakage, logcat will show information. Example: Access the memory, which has been freed already: root@android:/data # setprop libc.debug.malloc 15 I/libc    ( 4136): setprop using MALLOC_DEBUG = 1 (leak checker) root@android:/data # ./memtest I/libc    ( 4138): ./memtest using MALLOC_DEBUG = 15 (efence) F/libc    ( 4138): Fatal signal 11 (SIGSEGV) at 0x4015bff4 (code=2) I/DEBUG  ( 3856): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** I/DEBUG  ( 3856): Build fingerprint: 'freescale/sabresd_6dq/sabresd_6dq:4.0.4/R13.5-rc1/eng.b03824.20120711.11133 8:eng/test-keys' I/DEBUG  ( 3856): pid: 4138, tid: 4138  >>> ./memtest <<< I/DEBUG  ( 3856): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 4015bff4 I/DEBUG  ( 3856):  r0 00000000  r1 00000002  r2 40151c6c  r3 00000000 I/DEBUG  ( 3856):  r4 4015bff4  r5 bec75a54  r6 00000001  r7 bec75a5c I/DEBUG  ( 3856):  r8 00000000  r9 00000000  10 00000000  fp 00000000 I/DEBUG  ( 3856):  ip 00000000  sp bec75a20  lr 40133f8f  pc 0000a554  cpsr 60000010 I/DEBUG  ( 3856):  d0  203f810033915fe5  d1  0000000000000000 I/DEBUG  ( 3856):  d2  0000000000000000  d3  0000000000000000 I/DEBUG  ( 3856):  d4  0000000000000000  d5  0000000000000000 I/DEBUG  ( 3856):  d6  0000000000000000  d7  204cb48d00000000 I/DEBUG  ( 3856):  d8  0000000000000000  d9  0000000000000000 I/DEBUG  ( 3856):  d10 0000000000000000  d11 0000000000000000 I/DEBUG  ( 3856):  d12 0000000000000000  d13 0000000000000000 I/DEBUG  ( 3856):  d14 0000000000000000  d15 0000000000000000 I/DEBUG  ( 3856):  d16 41c0265a46a47ae1  d17 3f50624dd2f1a9fc I/DEBUG  ( 3856):  d18 41c9c8aff2800000  d19 0000000000000000 I/DEBUG  ( 3856):  d20 0000000000000000  d21 0000000000000000 I/DEBUG  ( 3856):  d22 0000000000000000  d23 0000000000000000 I/DEBUG  ( 3856):  d24 0000000000000000  d25 0000000000000000 I/DEBUG  ( 3856):  d26 0000000000000000  d27 0000000000000000 I/DEBUG  ( 3856):  d28 0000000000000000  d29 0000000000000000 I/DEBUG  ( 3856):  d30 0000000000000000  d31 0000000000000000 I/DEBUG  ( 3856):  scr 00000010 I/DEBUG  ( 3856): I/DEBUG  ( 3856):          #00  pc 0000a554  /data/memtest I/DEBUG  ( 3856):          #01  pc 00016834  /system/lib/libc.so (__libc_init) I/DEBUG  ( 3856): I/DEBUG  ( 3856): code around pc: I/DEBUG  ( 3856): 0000a534 e3a0000a ebfff8d1 e3a01001 e1a00004  ................ I/DEBUG  ( 3856): 0000a544 e5c4100a ebfff8d9 e3560001 e3a03000  ..........V..0.. I/DEBUG  ( 3856): 0000a554 e5c43000 0a000064 e59f21f0 e2857004  .0..d....!...p.. I/DEBUG  ( 3856): 0000a564 e5954004 e08f1002 e1a00004 ebfff8c0  .@.............. I/DEBUG  ( 3856): 0000a574 e3500000 0a00003f e59fc1d4 e1a00004  ..P.?........... I/DEBUG  ( 3856): I/DEBUG  ( 3856): code around lr: I/DEBUG  ( 3856): 40133f6c 68200701 0001f020 454e1046 2e00d018  .. h ...F.NE.... I/DEBUG  ( 3856): 40133f7c 2102da01 1c81e000 43394338 f7eb4622  ...!....8C9C"F.. I/DEBUG  ( 3856): 40133f8c 4605ed56 d1ec2800 da062e00 0101f008  V..F.(.......... I/DEBUG  ( 3856): 40133f9c f06f4620 f7ea4200 4628e8d4 87f0e8bd  Fo..B....(F.... I/DEBUG  ( 3856): 40133fac eff0f7e9 6003234b 30fff04f bf00e7f6  ....K#.`O..0.... I/DEBUG  ( 3856): I/DEBUG  ( 3856): memory map around addr 4015bff4: I/DEBUG  ( 3856): 40150000-4015a000 I/DEBUG  ( 3856): 4015a000-4015d000 I/DEBUG  ( 3856): 4015d000-4015e000 I/DEBUG  ( 3856): I/DEBUG  ( 3856): stack: I/DEBUG  ( 3856):    bec759e0  00000000 I/DEBUG  ( 3856):    bec759e4  00000000 I/DEBUG  ( 3856):    bec759e8  00000000 I/DEBUG  ( 3856):    bec759ec  4012090f  /system/lib/libefence.so I/DEBUG  ( 3856):    bec759f0  4015a014 I/DEBUG  ( 3856):    bec759f4  00002000 I/DEBUG  ( 3856):    bec759f8  00000004 I/DEBUG  ( 3856):    bec759fc  40120df1  /system/lib/libefence.so I/DEBUG  ( 3856):    bec75a00  4015bff4 I/DEBUG  ( 3856):    bec75a04  bec75a54  [stack] I/DEBUG  ( 3856):    bec75a08  00000001 I/DEBUG  ( 3856):    bec75a0c  bec75a5c  [stack] I/DEBUG  ( 3856):    bec75a10  00000000 I/DEBUG  ( 3856):    bec75a14  400d9167  /system/lib/libc.so I/DEBUG  ( 3856):    bec75a18  df0027ad I/DEBUG  ( 3856):    bec75a1c  00000000 I/DEBUG  ( 3856): #00 bec75a20  00008924  /data/memtest I/DEBUG  ( 3856):    bec75a24  bec75a54  [stack] I/DEBUG  ( 3856):    bec75a28  00000001 I/DEBUG  ( 3856):    bec75a2c  bec75a5c  [stack] I/DEBUG  ( 3856):    bec75a30  00000000 I/DEBUG  ( 3856):    bec75a34  400d9837  /system/lib/libc.so I/DEBUG  ( 3856): #01 bec75a38  00000000 I/DEBUG  ( 3856):    bec75a3c  00000000 I/DEBUG  ( 3856):    bec75a40  00000000 I/DEBUG  ( 3856):    bec75a44  00000000 I/DEBUG  ( 3856):    bec75a48  00000000 I/DEBUG  ( 3856):    bec75a4c  b00046ef  /system/bin/linker I/DEBUG  ( 3856):    bec75a50  00000001 I/DEBUG  ( 3856):    bec75a54  bec75b79  [stack] I/DEBUG  ( 3856):    bec75a58  00000000 I/DEBUG  ( 3856):    bec75a5c  bec75b83  [stack] I/DEBUG  ( 3856):    bec75a60  bec75b8f  [stack] I/DEBUG  ( 3856):    bec75a64  bec75ba2  [stack] I/DEBUG  ( 3856):    bec75a68  bec75bc5  [stack] I/DEBUG  ( 3856):    bec75a6c  bec75bde  [stack] I/DEBUG  ( 3856):    bec75a70  bec75c08  [stack] I/DEBUG  ( 3856):    bec75a74  bec75c20  [stack] I/DEBUG  ( 3856):    bec75a78  bec75c57  [stack] I/DEBUG  ( 3856):    bec75a7c  bec75c61  [stack] I/BootReceiver( 3551): Copying /data/tombstones/tombstone_00 to DropBox (SYSTEM_TOMBSTONE) D/dalvikvm( 3551): GC_CONCURRENT freed 398K, 10% free 8805K/9735K, paused 3ms+5ms [2] + Segmentation fault  ./memtest
View full article
Test digital zoom with ipu for camera preview.   Board :sarbre-sd (imx6dq) BSP   : android 13.4ga In the above flow, one frame buffer is processed in four steps at camera preview. Add the step to change the frame buffer before step 4 , the added step which  zoom one preview frame.   The figure below shows the crop function of ipu lib, we use this function scale the frame.   Test result: preview zoom levle 0:   preview zoom level max:     When taking pictures with 5M pixels and the zoom is over level 1, the picture size is not 2592x1944 but 2016x1512. The underlying reason for it is that ipu crop function only supports the 2048x2048 maximum output .   Thumbnails of test result :  
View full article
Android Jelly Bean(4.2) locks HDMI rotation by default. You can unlock by the instruction of this commit. -- Author: Jeff Brown <jeffbrown@google.com> Date:   Wed Oct 17 18:32:34 2012 -0700     Add special mirroring modes for demonstration purposes.     Assume rotation of HDMI display is portait.     $ adb shell setprop persist.demo.hdmirotation portrait     Don't lock rotation while HDMI is plugged in.     $ adb shell setprop persist.demo.hdmirotationlock false     Hide secondary displays from apps but continue mirroring to them.     $ adb shell setprop persist.demo.singledisplay true     Bug: 7326281     Change-Id: I8f9a3b0bc19821a3a01043b0f516806dac82ce53
View full article
The LTC®3676 is a complete power management solution for i.MX6, ARM Cortex processor systems. The LTC3676 features eight independent resistor-programmable voltage rails, with dynamic control and sequencing, in compact QFN and LQFP packages. These rails supply power to the processor core, SDRAM, system memory, PC cards, always on real-time clock (RTC), and a variety of other functions. Quad I 2 C Adjustable High Efficiency Step-Down DC/DC Converters: 2.5A, 2.5A, 1.5A, 1.5A Triple 300mA LDO Regulators (2 Adjustable) DDR Power Solution with VTT and VTTR Reference Pushbutton On/Off Control with System Reset Independent Enable Pin-Strap and I2C Sequencing Programmable Autonomous Power-Down Control Power Good and Reset Functions Dynamic Voltage Scaling Selectable 2.25MHz or 1.12MHz Switching Frequency Always Alive 25mA LDO Regulator 10μA Standby Current 40-Pin 6mm × 6mm × 0.75mm QFN and 48-Pin 7mm × 7mm LQFP Packages Contact Linear Technology for further details (please note that this is a pre-release product; however, data sheets and ES samples are available from Linear Technology) http://www.linear.com/product/LTC3676 or Gerard Velcelean at gvelcelean@linear.com or Steve Knoth at sknoth@linear.com
View full article
A simple Linux kernel module to react on GPIO-generated interrupts
View full article
Hi,      Here share the hardfloat rootfs making document and related pkgs, please feel free for download best regards Jack
View full article
Default Ethernet feature is removed for Android Auto (both Android_Pie9.0 and Android10) Below are the patched to bring Ethernet feature back to Android Auto. Please try to apply the according patches if you want to enable Ethernet. For Android_Pie9.0_Auto(example with car2 build): --- a/arch/arm64/configs/android_car2_defconfig +++b/arch/arm64/configs/android_car2_defconfig @@ -245,7 +245,7 @@ CONFIG_DM_VERITY_FEC=y CONFIG_NETDEVICES=y CONFIG_MACVTAP=m CONFIG_TUN=y -# CONFIG_ETHERNET is not set +CONFIG_ETHERNET=y CONFIG_MDIO_BUS_MUX_MMIOREG=m CONFIG_AT803X_PHY=m CONFIG_MARVELL_PHY=m @@ -517,7 +517,7 @@ CONFIG_SQUASHFS=y CONFIG_SQUASHFS_DECOMP_MULTI=y CONFIG_SQUASHFS_XATTR=y CONFIG_SQUASHFS_LZ4=y -# CONFIG_NETWORK_FILESYSTEMS is not set +CONFIG_NETWORK_FILESYSTEMS=y   --- a/imx8q/mek_8q/mek_8q.mk +++ b/imx8q/mek_8q/mek_8q.mk @@ -46,6 +46,7 @@ PRODUCT_COPY_FILES += \      $(IMX_DEVICE_PATH)/fstab.freescale.car:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.freescale \      $(IMX_DEVICE_PATH)/early.init_car.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/early.init.cfg \      $(IMX_DEVICE_PATH)/required_hardware_auto.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/required_hardware.xml \ +    frameworks/native/data/etc/android.hardware.ethernet.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.ethernet.xml \      device/fsl/imx8q/init.recovery.freescale.car.rc:root/init.recovery.freescale.rc   For Android10_Auto,(example with car build): --- a/arch/arm64/configs/android_car_defconfig +++ b/arch/arm64/configs/android_car_defconfig @@ -23,6 +23,8 @@ CONFIG_SCHED_AUTOGROUP=y CONFIG_SCHED_TUNE=y CONFIG_RELAY=y CONFIG_BLK_DEV_INITRD=y +CONFIG_FEC=y +CONFIG_AT803X_PHY=y # CONFIG_RD_BZIP2 is not set # CONFIG_RD_LZMA is not set # CONFIG_RD_XZ is not set @@ -246,7 +248,6 @@ CONFIG_DM_VERITY=y CONFIG_DM_VERITY_FEC=y CONFIG_NETDEVICES=y CONFIG_TUN=y -# CONFIG_ETHERNET is not set   --- a/imx8q/mek_8q/mek_8q.mk +++ b/imx8q/mek_8q/mek_8q.mk @@ -46,6 +46,7 @@ PRODUCT_COPY_FILES += \      $(IMX_DEVICE_PATH)/fstab.freescale.car:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.freescale \      $(IMX_DEVICE_PATH)/early.init_car.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/early.init.cfg \      $(IMX_DEVICE_PATH)/required_hardware_auto.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/required_hardware.xml \ +    frameworks/native/data/etc/android.hardware.ethernet.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.ethernet.xml \      device/fsl/imx8q/init.recovery.freescale.car.rc:root/init.recovery.freescale.rc   Note: Please also check for below file, if fec1 is disabled, please also apply below diff. --- a/arch/arm64/boot/dts/freescale/imx8qm-mek-car2.dts +++ b/arch/arm64/boot/dts/freescale/imx8qm-mek-car2.dts @@ -147,10 +147,6 @@ status = "disabled"; }; -&fec1 { - status = "disabled"; -}; - &fec2 { status = "disabled"; };
View full article
       There are 8 UART ports on i.mx6ul and one uniform Linux driver for these UARTs. Form UART1~UART6, there is no special operation or attention to use them. But for UART7/UART8, there is a special rule to enable them.       According to i.mx6ul RM, we can see UART7/8 RTS pins are muxed with ENET TX_CLK pins. When SION bit of ENET_TX_CLK is set, we need switch to other MUX mode as input signal for UARTx_RTS. Otherwise, UARTx_RTS will be interrupted by loopback ENET clock signal. So we should set IOMUXC_UART7_RTS_B_SELECT_INPUT and IOMUXC_UART8_RTS_B_SELECT_INPUT registers to 0x2/03 to avoid ENET clock's conflict no matter whether we enable UART7/8 RTS/CTS function or not. Let's summarize the different scenarios to enable UART7/8 as follows: 1. ENET driver is disabled and UART7/8 is enabled. There is no special operation to do, just use UART7/8 like other UARTs 2. ENET and UART7/8 are both enabled. There are two use models, RTS/CTS enabled or disabled.     2a. If we enable RTS/CTS feature and configure RTS/CTS pins in the device tree, of course, we should avoid the conflict between UART CTS/RTS pins and ENET TX_CLK pins. There is no special operation to do becuase your RTS/CTS device tree would automatically set  IOMUXC_UART7_RTS_B_SELECT_INPUT/ IOMUXC_UART8_RTS_B_SELECT_INPUT register to correct value.     2b. If we don't enable RTS/CTS feature and no RTS/CTS pin configuration in devcie tree, we should manually add code to set  IOMUXC_UART7_RTS_B_SELECT_INPUT/  IOMUXC_UART8_RTS_B_SELECT_INPUT register because the default value is 0x0(ENETx_TX_CLK_ALT1) Here is an example to show how to use UART7 on EVK board in scenario 2b. 1. modify imx6ul-14x14-evk.dts to enable UART7     a. remove all  LCD settings to disable lcdif because we configure UART7 TX/RX pin pad to LCD data line     b. add UART7 related settings                &uart7 {                     pinctrl-names = "default";                     pinctrl-0 = <&pinctrl_uart7>;                    status = "okay";                 };               &iomuxc {                   pinctrl-names = "default";                   pinctrl-0 = <&pinctrl_hog_1>;                   ....                           pinctrl_uart7: uart7grp {                           fsl,pins = <                                       MX6UL_PAD_LCD_DATA16__UART7_DCE_TX 0x1b0b1                                       MX6UL_PAD_LCD_DATA17__UART7_DCE_RX 0x1b0b1                           >;                  }; 2. add code to set IOMUXC_UART7_RTS_B_SELECT_INPUT register in arch/arm/mach-imx/mach-imx6ul.c          static void __init imx6ul_init_machine(void)          {               struct device *parent;               void __iomem *iomux;               struct device_node *np;               ...........               imx6ul_pm_init();               np = of_find_compatible_node(NULL,NULL,"fsl,imx6ul-iomuxc");               iomux = of_iomap(np, 0);               writel_relaxed(0x2,iomux+0x650);            } 3. build zImage and imx6ul-14x14-evk.dtb 4. Test in linux console      root@imx6ulevk: ls /dev/ttymxc*                      //you can see ttymxc6 is in the list     root@imx6ulevk: echo hello > /dev/ttymxc6         root@imx6ulevk:
View full article
The latest i.MX28 BSP provided by Freescale (10.12) is based on a 2.6.35 kernel. If you want to use the latest and greatest kernel version from kernel.org, follow the steps below. 1. Get the mainline kernel: git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git(this is only done once) git checkout -b yourlocalbranch origin/master 2. Export the toolchain PATH=/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/:$PATH export PATH export CROSS_COMPILE=arm-none-linux-gnueabi- export ARCH=arm 3. Build the kernel make mxs_defconfig make uImage sudo cp arch/arm/boot/uImage /tftpboot (In this example /tftpboot is the directory used to send files via TFTP) 4. Kernel command line: On U-boot change the following parameter of the kernel command line: console=ttyAM0,115200 to console=ttyAMA0,115200 5. On LTIB You can still use LTIB to provide the root file system. ./ltib -c Target System Configuration Options ----> Unselect [] boot up with tty and login If this option is selected the serial port will fail to open as it still uses ttyAM0 instead of ttyAMA0. 6. Boot the kernel via TFTP and mount the rootfs via NFS.
View full article
i.MX6Q Automotive board has one ADV7180 analog video decoder with 2 video inputs. By default, only input 1 is used (connector J42).     To connect 2 analog video sources and switch the display between them, the following changes are needed:   1 - Create a new IOCTL on V4L2_capture and ADV7180 device drivers to receive the information from user space application on what input will be selected. 2 - In this new IOCTL, use the "Fast Switch Script" for ADV7180 described at Analog Devices site: ADV7180 Fast Switch Script | EngineerZone  3 - Create a user space application to call the IOCTL mentioned on step 1.   See attached:   1 - 0001-ADV7180-Adding-input-switch-IOCTL.patch.zip - Patch to be applied on NXP kernel 4.1.15_1.0.0_ga 2 - example2.c.zip - Source code example of user space application. It changes the video input in each 2 seconds. (See it working on attached video) 3 - example2.zip - User space application executable file  4 - Makefile.zip - Makefile of user space application to be used as example 5 - adv7180_switch.mp4 - Video showing the application   In the application, VIDIOC_S_CHIP_INPUT IOCTL is called to change the input:   int input = 0; if (ioctl(fd_capture_v4l, VIDIOC_S_CHIP_INPUT, &input) < 0) { printf("VIDIOC_S_CHIP_INPUT failed\n"); return TFAIL; }‍‍‍‍‍‍‍‍‍‍‍‍   This IOCTL calls the ADV7180 Fast Switch Script, added on ADV7180 driver (see attached patch).
View full article
1. When reusing the build directory, sometimes compilation errors are seen; to overcome these, a fast solution is to clean the Share State Cache of the particular recipe/package $ bitbake <name of the recipe> -c cleansstate 2. Re-run the recipe $ bitbake <name of the recipe> 3. Re-run the bitbake command you were running, before getting into trouble. For example: $ bitbake fsl-image-gui In case the problem persists, please send the log into the mailing list or check if this issue has been reported previously.
View full article
iMX8QXP/iMX8QM have hardware JPEG decoder: The JPEG-D-X core. This is the example code to use this hw decoder in M4 SDK to decode JPEG files. M4_JPEG_DECODER_SDK_2.5.1.7z The attached "rear_view_camera_jpegdec.tar.bz2" is the updated source code for "SDK\boards\mekmimx8qx\demo_apps\rear_view_camera". It is based on SDK 2.5.1 for iMX8QXP MEK. The "rear_view_camera_jpegdec.patch" is the modified code, it hasn't included the added "fsl_jpeg_dec.c" and "fsl_jpeg_dec.h".   The testing used two 256*256 JPEG files, they are RGB color space. We used followed commands to build them into flash.bin: ./mkimage_imx8 -soc QX -rev B0 -append ahab-container.img -c -scfw scfw_tcm.bin -m4 m4_rear_view_camera.bin 0 0x34FE0000 --data demo_rgb.jpg 0x84000000 --data demo_rgb2.jpg 0x84008000 -out flash.bin   If customer need change the JPEG resoluion, they can change them in file "fsl_jpeg_dec.h", APP_JPEG_SIZE_OF_KB is the JPEG file length in memory, aligned in KB.   #define APP_JPEG_WIDTH (256) #define APP_JPEG_HEIGHT (256) #define APP_JPEG_SIZE_OF_KB (32) #define APP_JPEG_FORMAT JPEG_RGB #define APP_JPEG_BUFFER (0x84000000)   To created RGB format JPEG file from RGB data, the customer can use linux unit test application "/unit_tests/JPEG/encoder_test.out". M4_JPEG_DECODER_WINDOW_MODE_SDK_2.5.1.7z Based on JEPG decoder, added DPU CSC support and render JEPG decoded video in overlay window. The architecture is followed: NXP logo is put in FetchLayer0 with RGB565 format, after LayerBlend0, it will be the prim layer for LayberBlend1 (FetchLayer0 can't be used as prim layer for LayerBlend), the JPEG decoder output is put to FetchDecoder0. RGB888 format, and it will be resize to 640*480, and put to x=100, y=100 of the display. (Only the sec layer of LayerBlend can be window mode). Some limitation for layer selection in LayerBlend:
View full article
Yes. The Yocto Project site hosts some of the MX machines here. NOTES: If the machine's folder is present but it is empty, a building error may have occurred. Check the build's status for the machine on the archives or send an email to the list. Due to limited resources, not all (Freescale) machines are (nightly) built, in case you need one of these, you need to bake it yourself. You can start building following these instructions.
View full article
This guide walks you through setting up and building the Yocto SDK, customizing a device tree (DTS), and compiling the kernel for NXP i.MX platforms. It is designed to simplify the process, from downloading tools to creating functional images for embedded devices. Prerequisites Required Software: A Linux-based operating system (Ubuntu/Debian recommended). Git installed (sudo apt install git). Yocto dependencies: $ sudo apt install gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 python3-subunit zstd liblz4-tool file locales libacl1 ​ Hardware: An NXP i.MX-based development board (i.MX6, i.MX7, i.MX8, or i.MX9). Sufficient storage space   1. Downloading the Repository Start by downloading the necessary tools and repository. If the ~/bin folder does not already exist, create it: $ mkdir ~/bin (this step may not be needed if the bin folder already exists) $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo $ chmod a+x ~/bin/repo $ export PATH=~/bin:$PATH   2. Compile the Yocto SDK: Create and navigate to a release directory: $: mkdir <release> $: cd <release>   Initialize and sync the repo: $: repo init -u https://github.com/nxp-imx/imx-manifest -b <branch name> [ -m <release manifest>] $: repo sync   Set up the environment and build the SDK: $: [MACHINE=<machine>] [DISTRO=fsl-imx-<backend>] source ./imx-setup-release.sh -b bld-<backend> $: bitbake <image recipe> -c populate_sdk   Example: $: mkdir Yocto_SDK $: cd Yocto_SDK $: repo init -u https://github.com/nxp-imx/imx-manifest -b imx-linux-scarthgap -m imx-6.6.52-2.2.0.xml $: repo sync $: MACHINE=imx93evk DISTRO=fsl-imx-xwayland source ./imx-setup-release.sh -b bld-xwayland $: bitbake imx-image-full -c populate_sdk   Recommendation: Use the full image (imx-image-full) to include all available packages and libraries.   Run the generated .sh file to install the SDK: sudo ./fsl-imx-xwayland-glibc-x86_64-imx-image-full-armv8a-imx93evk-toolchain-6.6-scarthgap.sh   The final .sh file is located in: bld-xwayland/tmp/deploy/sdk/   3. Cloning the Kernel Repository (linux-imx repository)   Clone the kernel source matching the version of the Yocto SDK you built earlier:   $: git clone https://github.com/nxp-imx/linux-imx.git -b <Kernel-version>   EXAMPLE: $: git clone https://github.com/nxp-imx/linux-imx.git -b lf-6.6.52-2.2.0   4. Customizing the Device Tree Device trees can be modified or created based on your hardware setup.   Device Tree Locations:   iMX6 and iMX7: arch/arm/boot/dts/nxp/imx/   iMX8 and iMX9: arch/arm64/boot/dts/freescale/   If you create a new device tree, add it to the respective Makefile:   iMX8 and iMX9: arch/arm64/boot/dts/freescale/Makefile   iMX6 and iMX7: arch/arm/boot/dts/nxp/imx/Makefile     5. Setting Up the Cross-Compilation Environment To prepare for kernel compilation, source the environment setup script. Assuming the Yocto SDK is installed in /opt, run:   EXAMPLE: $ source /opt/fsl-imx-xwayland/6.6-scarthgap/environment-setup-armv8a-poky-linux   6. Configuring the Kernel Make configuration adjustments as needed:   iMX8 and iMX9: arch/arm64/configs/imx_v8_defconfig   iMX6 and iMX7: arch/arm/configs/imx_v7_defconfig   Use the appropriate configuration command:   iMX8 and iMX9: $: make imx_v8_defconfig   iMX6 and iMX7: $: make imx_v7_defconfig   7. Compiling Device Trees Only   To compile only the device tree files, run: $: make dtbs   8. Compiling the Kernel Finally, compile the kernel image using: $ make -j $(nproc)   The resulting kernel image will be located in: iMX8 and iMX9: arch/arm64/boot/   iMX6 and iMX7: arch/arm/boot/   References: IMX YOCTO PROJECT USERS GUIDE IMX LINUX USERS GUIDE  IMX REFERENCE MANUAL   
View full article
This work is the result of my daughter's idea, she finished it with my guidance. Cradle-1 Palmsize mini-HPC World's first full function heterogeneous mini-HPC, this is what it looks like: 1 Architecture         Overall:  CPU+GPU heterogeneous, 4 nodes, connected by a 100M Ethernet switcher;         Nodes: FreeScale I.MX6 Quad core mini-pc, with 4 ARM Cortex-A9 cores and 1 Vivante GC2000 GPU 2  Software         OS:   Ubuntu 11.10 linaro         OpenCL driver: Vivante GC2000 OpenCL driver         Compiler:  C/C++: gcc 4.6.1, Fortan90/95:  gfortran 4.6.1,         MPI Parallel Computing: MPICH2 1.4-1         NFS network file system: nfs-kernel-server 1.2.4         SSH security:   openssh   1:5.8 3 Hardware         The hardware of all nodes are the same, only the software configurations are slightly different. One of them was assigned as the master node, the others are slave nodes. They were TV sticks originally, with android 4.0 installed. The node's hardware specification is:         CPU: 4 1.2G Cortex-A9 cores         GPU: 1 Vivante GC2000 GPU         RAM: 1G DDR         ROM: 8G SD         NIC:   usb2.0 100M Ethernet Adapter (this NIC is not the TV stick's component, we added it)         WIFI: 150M         Display Interface:  HDMI         Network Switcher: 5 port 100M Ethernet Switcher 4  Network         Each node has one USB2.0 NIC and one WIFI interface, the WIFI is used as the backup connection for NIC connection. Network configurations are:         IP Address assignment:  (baby1 - baby4 are the four computing nodes)         baby1: 100M NIC 192.168.10.1 WIFI 192.168.0.111         baby2: 100M NIC 192.168.10.2 WIFI 192.168.0.112         baby3: 100M NIC 192.168.10.3 WIFI 192.168.0.113         baby4: 100M NIC 192.168.10.4 WIFI 192.168.0.114 5  Performance         Cradle-1 has 16 1.2G ARM Cortex-A9 cores and 4 Vivante GC2000 GPU cores, the total computing power of these 20 computing devices is more than 100GFLOPS,   more powerful than an ordinary desktop. The whole machine is only a little bigger than a palm, and the total power consumption is less than 15 watts.          The overall architecture of Cradle-1 is almost the same as Chinese Tianhe-1A or the Titan in the oak ridge lab. they used the same set of software, LINUX+OPENCL+OPENMPI. Cradle-1 supports C/C++, Fortran90/95. And almost all kinds of parallel computing algorithms can run on it, the only difference is the scale.         We coded a MPI parallel computing program for large matrix multiplication with 4 processes, each process had 5 threads, four threads for the four CPU cores, and one thread for GPU computing. 6 Appearance Front Back Top Left Right One node, it has three interfaces, the right is HDMI interface, upper-left is the wireless adapter for keyboard and mouse, down-left is the power connection. One node is running Ubuntu 11.10. Coded a simple OpenCL program to display OpenCL driver information On a notebook, using remote desktop access function to obtan the node baby1's desktop. This is the sign in desktop of baby1 node. Baby 1 has X11VNC server installed. sign in baby1, open a terminal Ran a MPI testing program, ensuring that all babies (baby1 - baby4) were working     Any comments? please mail to audrey.tao@hotmail.com
View full article
Recently I published this i.MX Dev Blog post about the Gateworks plugin gst-variable-rtsp-server support for i.MX 6. Now, you can check how to use it on i.MX 8 SoCs as well. 1. Preparing the image In order to use gst-variable-rtsp-server plugin, prepare your machine and distro: Add the following line to conf/local.conf: IMAGE_INSTALL_append += "gstreamer1.0-rtsp-server gst-variable-rtsp-server" Download the attached patch and apply it by doing: $ cd <yocto_path>/sources/meta-fsl-bsp-release/ $ git am ~/Download/0001-Add-RTSP-support-for-i.MX-8-L4.14.78_ga1.0.0-or-olde.patch Note: This patch is not necessary for L4.14.98_ga2.0.0 BSP! Then, build the image with bitbake and deploy it to the SD card. 2. Video Test Source Example Server $ gst-variable-rtsp-server -p 9001 -u "videotestsrc ! v4l2h264enc ! rtph264pay name=pay0 pt=96" Client 2. Camera Example Server $ gst-variable-rtsp-server -p 9001 -u "v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480 ! v4l2h264enc ! rtph264pay name=pay0 pt=96" Client In order to use VLC or other application as the client, just enter the URL as shown in the image below:
View full article