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:
Share my test procedure in the attachment.
View full article
In defaut Linux BSP, NXP implemented LVDS to HDMI(it6263) and MIPI-DSI to HDMI(adv7535) bridge chip drivers. And these drivers need read the EDID from display, then apply the timing parameters to DRM driver. But for the use case that bridge chip -> Serializer -> Deserializer -> LCD Panel use case, there is no EDID. The attached are reference patches for such use case, it combined the bridge chip to panel directly, and no EDID is needed. The patches are tested on iMX8QXP MEK with bridge chip + panel mode, both of them can see the fb0 device under /sys/class/graphics/ folder, also can see card under  /sys/class/drm/. Display works fine with DTS selected 720P panel mode. [2020-06-24]: Add patches for L4.14.98 kernel: Android_Auto_P9.0.0_GA2.1.0_Kernel_No_EDID_IT6263.patch L4.14.98-iMX8QXP-MEK-ADV7535-MIPI-DSI-to-HDMI-bridge-chip-com.patch
View full article
Added two functions in DDR_Stress_Tester V1.0.2, find the attachment for the details. 1. Check the actual boot mode settings in H/W target board 2. Add test option for bit flip and bit spread walking test
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 imx_bootlets package in LTIB contains the code that will be the first code loaded and executed by ROM when booting a build of the Linux BSP. It is responsible for initializing some of the low level peripherals such as the integrated power supply and the DRAM controller as well as a few other initialization tasks. The default configuration of the bootlet code for the latest i.MX233 and i.MX28x release (SDK 10.05 and SDK 10.12 respectively) support a hardware configuration that has both a LiIon battery configuration (as shown in the reference schematics for these platforms as shown on freescale.com). For other configurations though such as a VDD5V connection only or a DCDC_BATT/Battery connection only, some additional changes are recommended.
View full article
Hello there. Here is a good way to use U-boot in an efficient way with custom scripts. The bootscript is an script that is automatically executed when the boot loader starts, and before the OS auto boot process. The bootscript allows the user to execute a set of predefined U-Boot commands automatically before proceeding with normal OS boot. This is especially useful for production environments and targets which don’t have an available serial port for showing the U-Boot monitor. This information can be find in U-Boot Reference Manual.   I will take the example load a binary file in CORTEX M4 of IMX8MM-EVK. In my case, I have the binary file in MMC 2:1 called gpio.bin and I will skip those steps because that is not the goal.   First, you need the u-boot-tools installed in your Linux machine: sudo apt install u-boot-tools   That package provide to us the tool mkimage to convert a text file (.src, .txt) file to a bootscript file for U-Boot.   Now, create your custom script, in this case a simple script for load binary file in Cortex M4: nano mycustomscript.scr  and write your U-Boot commands: fatload mmc 2:1 0x80000000 gpio.bin cp.b 0x80000000 0x7e0000 0x10000 bootaux 0x7e0000   Now we can convert the text file to bootscript with mkimage. Syntax: mkimage -T script -n "Bootscript" -C none -d <input_file> <output_file> mkimage -T script -n "Bootscript" -C none -d mycustomscript.scr LCM4-bootscript   This will create a file called LCM4-bootscript (Or as your called it).   A way to load this bootscript file to U-Boot is using the UUU tool, in U-Boot set the device in fastboot with command: u-boot=> fastboot 0 Then in linux with the board connected through USB to PC run the command: sudo uuu -b fat_write LCM4-bootscript mmc 2:1 LCM4-bootscript   Now we have our bootscript in U-Boot in MMC 2:1.   Finally, we can run the bootscript in U-Boot: u-boot=> load mmc 2:1 ${loadaddr} LCM4-bootscript 158 bytes read in 2 ms (77.1 KiB/s) u-boot=> source ${loadaddr} ## Executing script at 40400000 6656 bytes read in 5 ms (1.3 MiB/s) ## No elf image at address 0x007e0000 ## Starting auxiliary core stack = 0x20020000, pc = 0x1FFE02CD...   And the Cortex M4 booted successfully:    I hope this can helps to you.   Best regards.   Salas.  
View full article
  Platform & BSP : i.MX8MPlus EVK , L6.12.3, uboot lf_v2024.04   The attachments enable the i.MX8MPlus pci function in uboot. lspci in Linux root@imx8mpevk:~# lspci -nn 00:00.0 PCI bridge [0604]: Synopsys, Inc. DWC_usb3 / PCIe bridge [16c3:abcd] (rev 01) 01:00.0 Ethernet controller [0200]: Marvell Technology Group Ltd. Device [1b4b:2b42] (rev 11) pci test results in uboot:  u-boot=> pci BusDevFun VendorId DeviceId Device Class Sub-Class _____________________________________________________________ 00.00.00 0x16c3 0xabcd Bridge device 0x04 01.00.00 0x1b4b 0x2b42 Network controller 0x00 u-boot=> pci bar 00.00.00 ID Base Size Width Type ---------------------------------------------------------- 0 0x0000000018000000 0x0000000000100000 32 MEM u-boot=> pci regions 00 Buses 00-01 # Bus start Phys start Size Flags 0 0x0000000000000000 0x000000001ff80000 0x0000000000010000 io 1 0x0000000018000000 0x0000000018000000 0x0000000007f00000 mem 2 0x0000000040000000 0x0000000040000000 0x0000000016000000 mem sysmem 3 0x0000000058000000 0x0000000058000000 0x00000000a8000000 mem sysmem 4 0x0000000100000000 0x0000000100000000 0x00000000c0000000 mem sysmem u-boot=> pci header 00.00.00 vendor ID = 0x16c3 device ID = 0xabcd command register ID = 0x0007 status register = 0x0010 revision ID = 0x01 class code = 0x06 (Bridge device) sub class code = 0x04 programming interface = 0x00 cache line = 0x08 latency time = 0x00 header type = 0x01 BIST = 0x00 base address 0 = 0x18000000 base address 1 = 0x00000000 primary bus number = 0x00 secondary bus number = 0x01 subordinate bus number = 0x01 secondary latency timer = 0x00 IO base = 0x10 IO limit = 0x00 secondary status = 0x0000 memory base = 0x1820 memory limit = 0x1810 prefetch memory base = 0xfff0 prefetch memory limit = 0x0000 prefetch memory base upper = 0x00000000 prefetch memory limit upper = 0x00000000 IO base upper 16 bits = 0x0000 IO limit upper 16 bits = 0x0000 expansion ROM base address = 0x18100000 interrupt line = 0xff interrupt pin = 0x01 bridge control = 0x0000 u-boot=> pci header 01.00.00 vendor ID = 0x1b4b device ID = 0x2b42 command register ID = 0x0006 status register = 0x0010 revision ID = 0x11 class code = 0x02 (Network controller) sub class code = 0x00 programming interface = 0x00 cache line = 0x08 latency time = 0x00 header type = 0x00 BIST = 0x00 base address 0 = 0x1810000c base address 1 = 0x00000000 base address 2 = 0x1820000c base address 3 = 0x00000000 base address 4 = 0x00000000 base address 5 = 0x00000000 cardBus CIS pointer = 0x00000000 sub system vendor ID = 0x0000 sub system ID = 0x0000 expansion ROM base address = 0x00000000 interrupt line = 0xff interrupt pin = 0x01 min Grant = 0x00 max Latency = 0x00
View full article
i.MX8/i.MX8X/i.MX8DXL has ddr stress test tool. It is a window UI program. In some cases, i.MX devices is security closed. Need signed image to run. Such as unit fail field return analyze, switch new ddr part on existing board.  
View full article
Android Power Debug and Optimization Introduction Android Power Management on i.MX Overview How to do power optimization for Android on i.MX How to check high power consumption on i.MX How to debug suspend/resume problems on i.MX Introduction This document describes i.MX Android power issues debug and power consumption optimization. Android Power Management on i.MX Overview What Power Manager introduced by Android • Early Suspend    It is allow drivers like LCD, keypad backlight, touch-screen, gsensor, to be notified when user-space writes to /sys/power/request_state to indicate that the user visible sleep state should change. These drivers will act as like Linux stand suspend() to let these devices entry in suspend for better battery life. •Late Resume    Late resume is matching with early suspend. It will resume the devices suspended during early suspend after the Stand Linux resume finished •Wake Locks     Wake locks are used by applications, services, kernel drivers to request CPU resources. A locked wakelock, depending on its type, prevents the system from entering suspend or other low-power states. It as a core member in android power management architecture from framework to kernel What introduced by i.MX to enhance the power framework BusFreq Support High bus, Low power audio bus and Low bus totally 3 system bus working points. Switching between these 3 bus mode according clock flags automatically. DDR running frequency will change according bus mode changing (highest 528/400MHz and lowest at 24MHz for MX6DQ/DL). CPUFreq The CPU frequency scaling device driver allows the clock speed of the CPUs to be changed on the fly. Once the CPU frequency is changed, the GP voltage will be changed to the voltage value. Enhance the default interactive governor for better performance on SDHC/GPU etc. System Power Profile Service and App (just for MX6DQ/DL) Support 3 profiles currently: Normal mode, Power Saving Mode and Performance Mode to get much better balance between performance and power consumption. Profiles can be customized according customers’ HW /MD design, including: CPU running max freq, trigger temperature, CPU running minimal freq, running cpu LDO bypass mode           i.MX6X has built-in LDO module, but also allows you to use external LDO suppliers. SW will provide the configuration using external LDO or internal LDO. How to do power optimization for Android on i.MX Suspend Mode All devices enter in suspend or low power Config GPIO PADs as High Z or input mode (depending on HW design,FSL provide Ref code) Cut off LDOs which no modules need (depending on HW design, FSL provide Ref code) DDR enter in self-refresh mode (FSL done) Config DDR IO Float pin to reduce the DDR IO consumption (FSL done) ARM core entry stop mode (WFI) (FSL done) All PLLs will cut off, just 32KHZ sleep clock living (FSL done) Notify the PMIC entry in standby to save some power (FSL done) User Idle Mode Optimization on device driver for WiFi, 3G, BT, screen brightness modules, etc., to save some power Let some device/GPIOs entry in suspend mode/low power mode Active power saving profile to reduce some system power loading. GPU 2D/3D auto entry in Stop/Standby mode if no activity needs update. (FSL done) Enable CPUFreq reduce ARM CORE power consumption (FSL done) Busfreq scanning to let system work at lower Freq to save power (FSL done) Audio/Video Playback Mode Optimization on device driver for WiFi, 3G, BT, screen brightness modules, etc., to save some power Let some device/GPIOs entry in suspend mode/low power mode Disable HW 3D acceleration for some Apps such as System UI, Music Player, etc., to save some power when System in IDLE or music playing mode. Enable CPUFreq and SOC WAIT mode, decrease CPU Freq/Voltage to save power for ARM CORE when no there is no task need cpu to handle(FSL done) Busfreq scanning will set bus work at low power audio bus mode to save some power (FSL done for audio case) DDR enter in self-refresh mode (FSL done for audio case) Reduce the screen brightness will save some power (for video case) VPU clock auto-gating to save power on SOC domain (for video case, FSL done) GPU 2D/3D auto-gating to save some power on SOC domain (FSL done) Try VDOA+IPU to bypass GPU in video playback(not comment for Android platform, pure Linux environment using this method, for it has some limitation such as the input/output size limit), this can save some power on DDR domain. How to check high power consumption on i.MX Idle Audio/Video Playback high power consumption Check the CPUFreq and  Bus_freq is enabled           cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor           cat /sys/devices/platform/imx_busfreq.0/enable Check whether the system bus working poing   For MX6Q:           cat /sys/kernel/debug/clock/osc_clk/pll2_528_bus_main_clk/periph_clk/mmdc_ch0_axi_clk/rate   For MX6DL/SL:           cat /sys/kernel/debug/clock/osc_clk/pll2_528_bus_main_clk/pll2_pfd_400M/periph_clk/mmdc_ch0_axi_clk/rate Check CPU Loading and Interrupt(cat /proc/interrupts) Check clock tree carefully to see which clocks arenot gated off  but no any modules need them.            powerdebug –d  -c SUSPEND MODE high power consumption Make sure all device entries are in suspend mode Make sure the system entry in DSM(measure the voltage &current of VDDARM_CAP, VDDSOC_CAP,DDR_1V5, VDD_HIGH…)      Some tips help to locate the problems Add debug message in device drivers which may lead high power consumption Enable PM debug in kernel Catch the waveform from these modules which may impact the high power consumption Remove devices from the board or do H/W rework to exclude some H/W problems How to debug suspend/resume problems on i.MX System could not entry in suspend mode Check below settings has been disabled: GPS has been disabled Don't connect USB cable to the board (adb will hold a wake lock) RIL will hold a wake lock if RIL failed to initialize (logcat -b radio) Setting->Application->Developer options->stay awake (stay awake not set) Check all wake locks which holed by kernel have been released          echo 15 > /sys/module/wakelock/parameters/debug_mask Check all user wake locks have been releaed          echo 15 > /sys/module/userwakelock/parameters/debug_mask System hang when resume or suspend Enable PM debug system to get more info about PM in kernel     make menuconfig  enable the PM debug sys [*] Power Management support                                                           [*]   Power Management Debug Support                                                           [*]     Verbose Power Management debugging Add no_console_suspend to the boot option for kernel         This makes the system print more useful info before entry in suspend Check the PMIC_STBY_REQ signal. Measure the VDDARM_IN Using Trace32 or ICE to locate the problem. Using RAMCONSOLE to dump the kernel log after reboot. Kernel resume back from suspend  but Android not    This is usually because of the wrong key layout file Use tool to get power key scan code        getevent  Correct the Keylayout         system/usr/keylayout/****.kl Correct the scandcode with your power key report value to Match the POWE key
View full article
Author:Fourier Email:[email protected] AMP:(Asymmetric Multiple Processing) Scenario:cpu core 0 run Linux, cpu core 1 run uC/OS-II RTOS. HDMI display panel link to Linux, LCD display panel link to uC/OS-II RTOS. Platform: Mars Board(freesclae i.mx6 dual Coretex-A9 core, 1GB 64bit DDR3) Panda Board(TIOMAP4460 dual Cortex-A9 core, 1GB 32bit DDR3) Altera SoC EVMBoard(dual Cortex-A9 core, (512MB+256MB ECC) DDR3 on HPS, 512MB on FPGA) Video Demo On Mars Board: Youtube: http://youtu.be/yb6KC6Cf8i4 http://youtu.be/1uzrX-YZBnQ Youku: http://v.youku.com/v_show/id_XNTMyNTAzNjky.html AMP Port: Linux SMP boot procedure is not mention here, For detail about the Linux SMP boot procedure please refer to the document here,http://www.linux-arm.org/LinuxBootLoader/SMPBoot.I just move the boot secondary procedure from Linux to U-boot as figure 1 in the AMP implementation, and figure2 describe the GIC relationship between two core and physical memory layout between Linux and uC/OS-II. Figure 1 Figure 2 Display Subsystem Block on Mars Board and Panda Board: Figure 3 imx6 display subsystem(Mars Board) Figure 4 omap4460 display subsystem on panda board
View full article
ATK (Advanced Toolkit) ATK (Advanced Toolkit) is a Windows software for programming the flash memory of i.MX boards. It can be downloaded here. Using ATK This section will describe the procedure to erase the flash memory and program the bootloader. 1 - Connect a serial cable between PC and i.MX board. 2 - Some hardware configurations (switches) must be done to flash the board. Set red and cream switches as below: Switch SW5 -> 000000 Switch SW4 -> 1000000 {{Note|On SW5 and SW4, "1" means the keys selected towards the edge of the board.} 3 - Run ATK (1.6 or above) going to Start -> Programs -> AdvancedToolKit -> AdvancedToolKit Set the options: i.MX CPU -> i.MX35_TO2 Device memory -> DDR2; Custom Initial File -> (keep it unmarked) Communication Channel -> Serial Port (Usually COM1) If you are using TO1, Device Memory -> MDDR 4 - Click on Flash Tools to erase, program or dump the the flash memory and click GO NAND Flash Erasing 1- Configure the Dip Switch of Personality Board: Switch 1 2 3 4 5 6 7 8 SW1 OFF OFF OFF OFF N/A N/A N/A N/A SW2 ON OFF OFF ON ON OFF OFF OFF 2- Choose NAND model K9LAG08U8M 3- Continue the steps Remember to select the checkbutton BBT (Back Block Table)
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
LTIB does not support X11 acceleration, since the packages are too old. Ubuntu 11.10 prebuilt image part of i.MX6 BSP has Xorg version 1.10.4. Yocto 1.4 has Xorg version 1.11.4. This document is based on Yocto 1.4.1 yocto and Freescale BSP 3.5.7 Alpha release. Few simple steps to enable 1.14.0. 1. Let us consider your Yocto directory is  $(rootfs_builder) 2. Edit vi sources/meta-fsl-arm/conf/machine/include/imx-base.inc      PREFERRED_VERSION_xserver-xorg_mx6 = "2:1.14.0" 3.Edit vi sources/meta-fsl-bsp-release/imx/meta-fsl-arm/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_3.5.7-1.0.0.bb      SRC_URI = "${FSL_MIRROR}/xserver-xorg-video-imx-viv-${PV}.tar.gz \            file://Makefile-fix-cross-compile.patch \                    file://0001-add-compat.h.patch" 4. Copy the attached Makefile-fix-cross-compile.patch into sources/meta-fsl-bsp-release/imx/meta-fsl-arm/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante/. 5. In the build directory, delete the tmp directory. Otherwise there will be build errors (I did not found easy way) 6. bitbake fsl-image-x11 7. Now the image is ready to flash. 8. Boot the board with the newly built image. 9. Check the Xorg version log in /var/log/Xorg.0.log. It will be 1.14.0. 10. Before executing any of the X11-EGL application, export VIV_DESKTOP=0 to the terminal. You can see the application running. There are some known issues related to performance in 3.5.7 Alpha release.
View full article
In FSL i.MX53 reference design, it is configured as: static struct mxc_audio_platform_data sgtl5000_data = { .ssi_num = 1, .src_port = 2, .ext_port = 5, .hp_irq = gpio_to_irq(HEADPHONE_DEC_B), .hp_status = headphone_det_status, .init = mxc_sgtl5000_init, .ext_ram_rx = 1, }; by default. If change the configuration to be : static struct mxc_audio_platform_data sgtl5000_data = { .ssi_num = 0, .src_port = 1, .ext_port = 5, .hp_irq = gpio_to_irq(HEADPHONE_DEC_B), .hp_status = headphone_det_status, .init = mxc_sgtl5000_init, .ext_ram_rx = 1, }; There will prompt "imx_ssi_irq mxc_ssi SISR 8003a3 SIER 180100 fifo_errs=XXXX"  constantly, and audio is greatly distorted. The root cause of this issue is that SSI1/3 use SDMA, and also use IPMUX, but there is not the clock dependency between SDMA and IPMUX, so sometimes IPMUX clock is closed automatically. The attached patch may fix this issue. NOTE: If use SSI2 .ssi_num = 1,             .src_port = 2, If use SSI1 .ssi_num = 0,             .src_port = 1,
View full article
MX6UL_Development_database_2017.4.21_V7.doc
View full article
Application Note covering how to get the Silex SX-SDCAN working with the Sabre-SD i.MX6 Evaluation kit.
View full article
Downloading and building the IPU examples IPU examples - v0.1 are available at https://github.com/rogeriorps/ipu-examples To download, just clone the project: $ git clone https://github.com/rogeriorps/ipu-examples.git Follow the README.md on the project root folder to build and install it. Available demos Alpha Blending Basic Combining Cropping Color Space Conversion Deinterlacing Resizing Rotation i.MX5 basic_ex1 rot_ex1 i.MX6 alpha_ex1 alpha_ex2 crop_ex1 csc_ex1 dint_ex1 res_ex1 rot_ex1 i.MX5 Basic examples basic_ex1: Prints all information from all framebuffers. It uses only the framebuffer device /dev/fb*. Rotation examples rot_ex1: Rotate an image a show on display. This example uses the ipu library instead using directly the /dev/mxc_ipu. i.MX6 Alpha blending examples alpha_ex1: This example shows how to use global alpha blending. It fills layer 1 with white color, an overlay layer with 4 color strips and varies the global alpha blending, showing on display 2 planes at the same time with different transparency rates. alpha_ex2: This example shows how to use local alpha blending. This example uses 3 buffers: 1 - Input buffer: Used as layer 1 (background). 2 - Overlay buffer: Used as layer 2 (foreground). 3 - Alpha buffer: Used as alpha buffer, where each pixel will correspond to the transparency value between input and overlay buffers. When running it will fill input and overlay buffers with solid colors, alpha buffer with 4 different alpha strips and will turn on and off the local alpha blending. Color space conversion examples csc_ex1: This example shows how to use color space conversion. It reads 4 different formats images (RGB565, RGBA32, NV12 and YUYV422) and show them on background framebuffer on a RGB565 format. Crop example crop_ex1: This example shows how to crop an image using "output crop". It fills the input buffer with a solid color and crop the output buffer. The result will be a solid block on the display. De-interlace example dint_ex1: This example shows how to de-interlace a single interlaced frame. The example loads an 320x240 interlaced NV12 image and show on display turning on and off the de-interlace feature. Resize examples res_ex1: This example resizes the image freescale_1024x768.raw (1024x768 RGB565 format) to an 800x480 RGB24 format image, storing into a local file output_file.raw. Rotation examples rot_ex1: This example rotates the image freescale_1024x768.raw (1024x768 RGB565 format) and displays using all rotation modes: 0 - No rotation 1 - Vertical flip 2 - Horizontal flip 3 - 180 degrees 4 - 90 degrees right 5 - 90 degrees right with vertical flip 6 - 90 degrees right with horizontal flip 7 - 90 degrees left Known issues
View full article
Introduction This is a sharing of my experience about porting the audio codec WM8960 in Linux BSP. I know this driver is not the perfect one.  If you find any place is not good in the driver, please let me know. This driver is modified base on the wm8960.c in L3.0.35 Linux BSP. This document is talking about how to modify the codec driver. The Audio Codec driver is located in linux/sound/soc/codec/wm8960.c. ALSA The Audio Codec driver is based on ALSA to setup up all the things. For details, please see : AlsaProject Advanced Linux Sound Architecture - Wikipedia, the free encyclopedia. kcontrols are defined in linux/include/sound/soc.h and soc-dapm.h. Audio controls and path in WM8960 Left and Right Input signal path Output signal path Base on the input and output signal diagrams, we can setup all the controls that we want in the driver. Such as switches, volume controls, PGA controls and so on. All the controls below can be used in the alsamixer. static const struct snd_kcontrol_new wm8960_snd_controls[] = { SOC_DOUBLE_R_TLV("PCM DAC Playback Volume", WM8960_LDAC, WM8960_RDAC, 0, 255, 0, dac_tlv), //LDACVOL , RDACVOL SOC_DOUBLE_R_TLV("PCM ADC Capture Volume", WM8960_LADC, WM8960_RADC, 0, 255, 0, adc_tlv), //LADCVOL, RADCVOL SOC_DOUBLE_R_TLV("Headphone Volume", WM8960_LOUT1, WM8960_ROUT1, 0, 127, 0, out_tlv), SOC_DOUBLE_R("Headphone ZC Switch", WM8960_LOUT1, WM8960_ROUT1,    7, 1, 0), SOC_DOUBLE_R_TLV("Speaker Volume", WM8960_LOUT2, WM8960_ROUT2, 0, 127, 0, out_tlv), SOC_DOUBLE_R("Speaker ZC Switch", WM8960_LOUT2, WM8960_ROUT2, 7, 1, 0), SOC_DOUBLE_R("Capture Volume ZC Switch", WM8960_LINVOL, WM8960_RINVOL, 6, 1, 0), SOC_SINGLE_TLV("Input Volume of LINPUT1", WM8960_LINVOL, 0, 63, 0, in_tlv),  //LINVOL SOC_SINGLE_TLV("Input Volume of RINPUT1", WM8960_RINVOL, 0, 63, 0, in_tlv),  //RINVOL SOC_SINGLE_TLV("Input Boost Volume LINPUT3", WM8960_INBMIX1, 4, 7, 0, boost_tlv),    //RIN3BOOST SOC_SINGLE_TLV("Input Boost Volume LINPUT2", WM8960_INBMIX1, 1, 7, 0, boost_tlv),    //RIN2BOOST SOC_SINGLE_TLV("Input Boost Volume RINPUT3", WM8960_INBMIX2, 4, 7, 0, boost_tlv),    //LIN3BOOST SOC_SINGLE_TLV("Input Boost Volume RINPUT2", WM8960_INBMIX2, 1, 7, 0, boost_tlv),    //LIN2BOOST SOC_SINGLE_TLV("PGA LB2LOVOL-Bypass from Left Boost", WM8960_BYPASS1, 4, 7, 1, bypass_tlv),    //LB2LOVOL SOC_SINGLE_TLV("PGA LI2LOVOL-Bypass from LINPUT3", WM8960_LOUTMIX, 4, 7, 1, bypass_tlv),    //LI2LOVOL SOC_SINGLE_TLV("PGA RB2ROVOL-Bypass from Right Boost", WM8960_BYPASS2, 4, 7, 1, bypass_tlv),    //RB2ROVOL SOC_SINGLE_TLV("PGA RI2ROVOL-Bypass from RINPUT3", WM8960_ROUTMIX, 4, 7, 1, bypass_tlv),    //RI2ROVOL SOC_SINGLE("Capture Mute (Left)", WM8960_LINVOL, 7, 1, 0), // LINMUTE SOC_SINGLE("Capture Mute (Right)", WM8960_RINVOL, 7, 1, 0), // RINMUTE SOC_SINGLE("PCM Playback -6dB Switch", WM8960_DACCTL1, 7, 1, 0), SOC_SINGLE("Speaker DC gain", WM8960_CLASSD3, 3, 5, 0), SOC_SINGLE("Speaker AC gain", WM8960_CLASSD3, 0, 5, 0), SOC_ENUM("ADC Polarity", wm8960_enum[0]), SOC_SINGLE("ADC High Pass Filter Switch", WM8960_DACCTL1, 0, 1, 0), SOC_ENUM("DAC Polarity", wm8960_enum[2]), SOC_SINGLE_BOOL_EXT("DAC Deemphasis Switch", 0, wm8960_get_deemph, wm8960_put_deemph), SOC_ENUM("3D Filter Upper Cut-Off", wm8960_enum[2]), SOC_ENUM("3D Filter Lower Cut-Off", wm8960_enum[3]), SOC_SINGLE("3D Depth", WM8960_3D, 1, 15, 0), SOC_SINGLE("3D", WM8960_3D, 0, 1, 0), SOC_ENUM("ALC Function", wm8960_enum[4]), SOC_SINGLE("ALC Max Gain", WM8960_ALC1, 4, 7, 0), SOC_SINGLE("ALC Target", WM8960_ALC1, 0, 15, 1), SOC_SINGLE("ALC Min Gain", WM8960_ALC2, 4, 7, 0), SOC_SINGLE("ALC Hold Time", WM8960_ALC2, 0, 15, 0), SOC_ENUM("ALC Mode", wm8960_enum[5]), SOC_SINGLE("ALC Decay", WM8960_ALC3, 4, 15, 0), SOC_SINGLE("ALC Attack", WM8960_ALC3, 0, 15, 0), SOC_SINGLE("Noise Gate Threshold", WM8960_NOISEG, 3, 31, 0), SOC_SINGLE("Noise Gate Switch", WM8960_NOISEG, 0, 1, 0), SOC_ENUM("Capture Left Boost", wm8960_enum[6]), //LMICBOOST SOC_ENUM("Capture Right Boost", wm8960_enum[7]), //RMICBOOT }; 1. SOC_SINGLE(xname, reg, shift, max, invert) To setup a simple switch, we can use SOC_SINGLE. e.g SOC_SINGLE("PCM Playback -6dB Switch", WM8960_DACCTL1, 7, 1, 0), - The name of this control is “PCM Playback -6dB Switch”. - The register in WM8960 is WM8960_DACCTL1 . (the register address is 0x5, defined in wm8960.h) - ‘7’ : The 7th bit in DACCTL1 register is used to enable/disable the DAC 6dB Attenuate. - ‘1’ : Only one enable or disable option. - ‘0’ : the value you set is not inverted. 2. SOC_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) To setup a switch with levels, we can use SOC_SINGLE_TLV. e.g. In this example, the left input volume control is from 000000(-17.25dB) to 111111(+30dB). Each step is 0.75dB. Total is 63 steps. SOC_SINGLE_TLV("Input Volume of LINPUT1", WM8960_LINVOL, 0, 63, 0, in_tlv), The scale of in_tlv declare like this: static const DECLARE_TLV_DB_SCALE(in_tlv, -1725, 75, 0); in_tlv : the name of the scale. -1725 : start from -17.25dB 75: each step is 0.75dB 0: the step is start from 0. For some volume control case the first step is "mute", then the step is start from 1 so change this number to 1. for example: The 0000 0000 of the DAC volume control is digital mute. static const DECLARE_TLV_DB_SCALE(dac_tlv, -12700, 50, 1); 3. SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) SOC_DOUBLE_R is a stereo version of SOC_SINGLE. You can control the left and right channel at the same time. e.g. SOC_DOUBLE_R("Headphone ZC Switch", WM8960_LOUT1, WM8960_ROUT1, 7, 1, 0), 4. SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) SOC_DOUBLE_R_TLV is the stereo version of SOC_SINGLE_TLV. e.g. SOC_DOUBLE_R_TLV("PCM DAC Playback Volume", WM8960_LDAC, WM8960_RDAC, 0, 255, 0, dac_tlv), 5. SOC_ENUM_SINGLE(xreg, xshift, xmax, xtexts) When the control option are some texts, we can use SOC_ENUM to enum the options. e.g. MIC boost 5.1. setup the array for the texts. static const char *wm8960_micboost[] = {"0dB","+13dB","+20dB","+29dB"}; 5.2. use the SOC_ENUM_SINGLE. static const struct soc_enum wm8960_enum[] = {      SOC_ENUM_SINGLE(WM8960_DACCTL1, 5, 4, wm8960_polarity),      SOC_ENUM_SINGLE(WM8960_DACCTL2, 5, 4, wm8960_polarity),      SOC_ENUM_SINGLE(WM8960_3D, 6, 2, wm8960_3d_upper_cutoff),      SOC_ENUM_SINGLE(WM8960_3D, 5, 2, wm8960_3d_lower_cutoff),      SOC_ENUM_SINGLE(WM8960_ALC1, 7, 4, wm8960_alcfunc),      SOC_ENUM_SINGLE(WM8960_ALC3, 8, 2, wm8960_alcmode),      SOC_ENUM_SINGLE(WM8960_LINPATH, 4, 4, wm8960_micboost),      SOC_ENUM_SINGLE(WM8960_RINPATH, 4, 4, wm8960_micboost), }; 5.3.  use SOC_ENUM to add the controls for MIC boost. SOC_ENUM("Capture Left Boost", wm8960_enum[6]), SOC_ENUM("Capture Right Boost", wm8960_enum[7]), After created all the controls, we can start to create the switches. The following switches created base on the input and output diagrams. I used the same name from datasheet of each switch. It will more easy to find out the proper switch in alsamixer. static const struct snd_kcontrol_new wm8960_lin[] = { SOC_DAPM_SINGLE("<- LMP2", WM8960_LINPATH, 6, 1, 0), //LMP2 SOC_DAPM_SINGLE("<- LMP3", WM8960_LINPATH, 7, 1, 0), //LMP3 SOC_DAPM_SINGLE("<- LMN1", WM8960_LINPATH, 8, 1, 0), //LMN1 }; static const struct snd_kcontrol_new wm8960_lin_boost[] = { SOC_DAPM_SINGLE("<- LMIC2B", WM8960_LINPATH, 3, 1, 0), //LMIC2B }; static const struct snd_kcontrol_new wm8960_rin[] = { SOC_DAPM_SINGLE("<- RMP2", WM8960_RINPATH, 6, 1, 0), //RMP2 SOC_DAPM_SINGLE("<- RMP3", WM8960_RINPATH, 7, 1, 0), //RMP3 SOC_DAPM_SINGLE("<- RMN1", WM8960_RINPATH, 8, 1, 0), //RMN1 }; static const struct snd_kcontrol_new wm8960_rin_boost[] = { SOC_DAPM_SINGLE("<- RMIC2B", WM8960_RINPATH, 3, 1, 0), //RMIC2B }; static const struct snd_kcontrol_new wm8960_loutput_mixer[] = { SOC_DAPM_SINGLE("<- LD2LO", WM8960_LOUTMIX, 8, 1, 0), //LD2LO SOC_DAPM_SINGLE("<- LI2LO", WM8960_LOUTMIX, 7, 1, 0), //LI2LO SOC_DAPM_SINGLE("<- LB2LO", WM8960_BYPASS1, 7, 1, 0), //LB2LO }; static const struct snd_kcontrol_new wm8960_routput_mixer[] = { SOC_DAPM_SINGLE("<- RD2RO", WM8960_ROUTMIX, 8, 1, 0), //RD2RO SOC_DAPM_SINGLE("<- RI2RO", WM8960_ROUTMIX, 7, 1, 0), //RI2RO SOC_DAPM_SINGLE("<- RB2RO", WM8960_BYPASS2, 7, 1, 0), //RB2RO }; static const struct snd_kcontrol_new wm8960_mono_out[] = { SOC_DAPM_SINGLE("<- L2MO", WM8960_MONOMIX1, 7, 1, 0), //L2MO SOC_DAPM_SINGLE("<- R2MO", WM8960_MONOMIX2, 7, 1, 0), //R2MO }; Then, create the inputs, ADC, DAC, mixers, PGA and outputs. static const struct snd_soc_dapm_widget wm8960_dapm_widgets[] = { SND_SOC_DAPM_INPUT("LINPUT1"), SND_SOC_DAPM_INPUT("RINPUT1"), SND_SOC_DAPM_INPUT("LINPUT2"), SND_SOC_DAPM_INPUT("RINPUT2"), SND_SOC_DAPM_INPUT("LINPUT3"), SND_SOC_DAPM_INPUT("RINPUT3"), SND_SOC_DAPM_MICBIAS("MICB", WM8960_POWER1, 1, 0), SND_SOC_DAPM_MIXER("Left Boost Mixer", WM8960_POWER1, 5, 0, wm8960_lin_boost, ARRAY_SIZE(wm8960_lin_boost)), SND_SOC_DAPM_MIXER("Right Boost Mixer", WM8960_POWER1, 4, 0, wm8960_rin_boost, ARRAY_SIZE(wm8960_rin_boost)), SND_SOC_DAPM_MIXER("Left Input PGA", WM8960_POWER3, 5, 0, wm8960_lin, ARRAY_SIZE(wm8960_lin)), SND_SOC_DAPM_MIXER("Right Input PGA", WM8960_POWER3, 4, 0, wm8960_rin, ARRAY_SIZE(wm8960_rin)), SND_SOC_DAPM_ADC("Left ADC", "Capture", WM8960_POWER1, 3, 0), SND_SOC_DAPM_ADC("Right ADC", "Capture", WM8960_POWER1, 2, 0), SND_SOC_DAPM_DAC("Left DAC", "Playback", WM8960_POWER2, 8, 0), SND_SOC_DAPM_DAC("Right DAC", "Playback", WM8960_POWER2, 7, 0), SND_SOC_DAPM_MIXER("Left Output Mixer", WM8960_POWER3, 3, 0, wm8960_loutput_mixer, ARRAY_SIZE(wm8960_loutput_mixer)), SND_SOC_DAPM_MIXER("Right Output Mixer", WM8960_POWER3, 2, 0, wm8960_routput_mixer, ARRAY_SIZE(wm8960_routput_mixer)), SND_SOC_DAPM_PGA("Left HP PGA", WM8960_POWER2, 6, 0, NULL, 0), SND_SOC_DAPM_PGA("Right HP PGA", WM8960_POWER2, 5, 0, NULL, 0), SND_SOC_DAPM_PGA("Left Speaker PGA", WM8960_POWER2, 4, 0, NULL, 0), SND_SOC_DAPM_PGA("Right Speaker PGA", WM8960_POWER2, 3, 0, NULL, 0), SND_SOC_DAPM_PGA("Right Speaker Output", WM8960_CLASSD1, 7, 0, NULL, 0), //SPK_OP_EN SND_SOC_DAPM_PGA("Left Speaker Output", WM8960_CLASSD1, 6, 0, NULL, 0), SND_SOC_DAPM_OUTPUT("SPK_LP"), SND_SOC_DAPM_OUTPUT("SPK_LN"), SND_SOC_DAPM_OUTPUT("HP_L"), SND_SOC_DAPM_OUTPUT("HP_R"), SND_SOC_DAPM_OUTPUT("SPK_RP"), SND_SOC_DAPM_OUTPUT("SPK_RN"), SND_SOC_DAPM_OUTPUT("OUT3"), }; Now, we can start to route the audio path. The path is from right to left , like : { “destination”, “switch”, “source” } So, lets take the LINPUT1 to ADC as an example: { "Left Input PGA", "<- LMN1", "LINPUT1" }, { "Left Boost Mixer", "<- LMIC2B", "Left Input PGA" }, { "Left ADC", NULL, "Left Boost Mixer" }, Another example is DAC to Headphone.                 { "Left Output Mixer", "<- LD2LO", "Left DAC" },                 { "Right Output Mixer", "<- RD2RO", "Right DAC" },                 { "Left HP PGA", NULL, "Left Output Mixer" },                 { "Right HP PGA", NULL, "Right Output Mixer" },                 { "HP_L", NULL, "Left HP PGA" },                 { "HP_R", NULL, "Right HP PGA" }, In linux, you can run "alsamixer" to turn on/off the switches and adjust the volumes. (this picture is an example of alsamixer of other codec, not for wm8960) In alsamixer, use 'M' to turn the switch on/off,  use arrow keys to control the volumes. wm8960_dai_ops is another important part in the driver. Here is the ops of the wm8960_dai. static struct snd_soc_dai_ops wm8960_dai_ops = {                 .hw_params = wm8960_hw_params,                 .digital_mute = wm8960_mute,                 .set_fmt = wm8960_set_dai_fmt,                 .set_clkdiv = wm8960_set_dai_clkdiv,                 .set_pll = wm8960_set_dai_pll, }; wm8960_hw_params : used to set the PCM format (16bit/24bit), set the deemph, alc_rates and etc. wm8960_mute:  used to mute the output wm8960_set_dai_fmt : used to set the Master/Slave mode, set the interface format (I2S, DSP, Left justified and Right justified) and set the clock inversion. wm8960_set_dai_clkdiv: used to set the CLK divider such as DACDIV, ADCDIV, BCLKDIV and so on. wm8960_set_dai_pll: used to calculate the proper PLL values. In the wm8960_set_dai_pll, we need to calculate the proper PLL values. Base on the table, if the MCLK >14.4, the sysclk prescale divider is 2. So, set the sysclk pre-divider to 2 before finding pll_factors. if (freq_in > 15000000 ) {                                 /* update sysclk div */                                 reg = snd_soc_read(codec, WM8960_CLOCK1) & 0x1f9;                                 snd_soc_write(codec, WM8960_CLOCK1, reg | 0x4);                                 clk_in = clk_in/2;                                 }                 if (freq_in && freq_out) {                                 ret = pll_factors(clk_in, freq_out, &pll_div);                                 if (ret != 0)                                                 return ret;                 } In the driver, there are two names are important. One is the name of codec dai. The name is “wm8960”. Make sure this codec dai name is the same codec dai name used in the imx-wm8960.c. static struct snd_soc_dai_driver wm8960_dai = {                 .name = "wm8960",                 .playback = {                                 .stream_name = "Playback",                                 .channels_min = 1,                                 .channels_max = 2,                                 .rates = WM8960_RATES,                                 .formats = WM8960_FORMATS,},                 .capture = {                                 .stream_name = "Capture",                                 .channels_min = 1,                                 .channels_max = 2,                                 .rates = WM8960_RATES,                                 .formats = WM8960_FORMATS,},                 .ops = &wm8960_dai_ops,                 .symmetric_rates = 1, }; Another name is the I2C device id. Make sure the I2C name is same as the name used in your_board.c file. static const struct i2c_device_id wm8960_i2c_id[] = {                 { "wm8960", 0 },                 { } }; MODULE_DEVICE_TABLE(i2c, wm8960_i2c_id); static struct i2c_driver wm8960_i2c_driver = {                 .driver = {                                 .name = "wm8960",                                 .owner = THIS_MODULE,                 },                 .probe =    wm8960_i2c_probe,                 .remove =   __devexit_p(wm8960_i2c_remove),                 .id_table = wm8960_i2c_id, }; Here is the name used in your_board.c static struct i2c_board_info mxc_i2c0_board_info[] __initdata = {     {         I2C_BOARD_INFO("wm8960", 0x1a),     }, } Machine driver imx-wm8960.c Basically, the machine driver is the connection between wm8960.c and the i.MX. It is modified base on the imx-wm8962.c. I didn't add the HP and MIC detection in this driver. If you need the HP and MIC detection, please take the imx-wm8962.c for reference. Here is an example of my_board.c. The following platform data pass to the machine driver from my board. static struct platform_device audio_wm8960_device = {     .name = "imx-wm8960", }; static struct mxc_audio_platform_data wm8960_pdata; static int wm8960_clk_enable(int enable) {     if (enable)         clk_enable(clko);     else         clk_disable(clko);     return 0; } static int mxc_wm8960_init(void) {     int rate;     clko = clk_get(NULL, "clko_clk");     if (IS_ERR(clko)) {         pr_err("can't get CLKO clock.\n");         return PTR_ERR(clko);     }     /* both audio codec and comera use CLKO clk*/     rate = clk_round_rate(clko, 24000000);     clk_set_rate(clko, rate);     wm8960_pdata.sysclk = rate;     return 0; } static struct mxc_audio_platform_data wm8960_pdata = {     .ssi_num = 1,     .src_port = 2,     .ext_port = 3,     .init = mxc_wm8960_init,     .clock_enable = wm8960_clk_enable, }; I attach the driver and the machine driver here. I hope this document is useful for you.
View full article
If you want to use a USB camera (these types of cameras are also called 'Web Cameras') with GStreamer on i.MX6 devices (Linux Kernel version >= 3.035), you need to either load the module dynamically or compile and link statically selecting (Y) the following config on the Kernel configuration      Device Drivers -> Multimedia support -> Video capture adapters -> V4L USB devices -> <*> USB Video Class (UVC) After the Kernel image has been built, flash it into the target, plug the web cam, then on a (target) terminal run      gst-launch v4l2src ! mfw_v4lsink You should see what the camera is capturing on the display. In case you need to encode the camera src data, you need to place the encoder into the pipeline      gst-launch v4l2src num-buffers=100  ! queue ! vpuenc codec=0 ! matroskamux ! filesink location=output.mkv sync=false We are using a certain codec (codec=0 means mpeg4), check options using 'gst-inspect vpuenc'.
View full article
To build Android version earlier than Lollipop from source code, you need the Sun's 1.6 SDK to be installed for ubuntu as the link Initializing a Build Environment | Android Developers. You may still cannot get the Sun's JDK  with below instruction: $ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" $ sudo apt-get update $ sudo apt-get install sun-java6-jdk    There are below options to help install the Sun's JDK  if you cannot find a valid source through apt-get commands: $ wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin $ chmod u+x jdk-6u45-linux-x64.bin $ ./jdk-6u45-linux-x64.bin $ sudo mv jdk1.6.0_45 /opt $ sudo update-alternatives --install /usr/bin/java java /opt/java/64/jdk1.6.0_45/bin/java 1 $ sudo update-alternatives --install /usr/bin/javac javac /opt/java/64/jdk1.6.0_45/bin/javac 1 $ sudo update-alternatives --install /usr/bin/jar jar /opt/java/64/jdk1.6.0_45/bin/jar 1 # if you have already install some other version of JDK, please export the JAVA_HOME env before your android build every time $ export JAVA_HOME=/opt/jdk1.6.0_45/ #or you can directly link the java binary to the sdk version you need as below: sudo ln -s /opt/java/64/jdk1.6.0_45/bin/jar /bin/jar sudo ln -s/opt/java/64/jdk1.6.0_45/java /bin/java sudo ln -s/opt/java/64/jdk1.6.0_45/javac /bin/javac sudo ln -s/opt/java/64/jdk1.6.0_45/javah /bin/javah sudo ln -s/opt/java/64/jdk1.6.0_45/javadoc /bin/javadoc sudo ln -s/opt/java/64/jdk1.6.0_45/javaws /bin/javaws    To built the Android version Lollipop and Marshmallow from source code, you need the OpenJDK 7 to be installed for ubuntu as the link Initializing a Build Environment | Android Developers. $ sudo apt-get update $ sudo apt-get install openjdk-7-jdk You may have both openjdk7 and SUN JDK 1.6 intalled in your ubuntu to build different Android version. If you have default java SDK to be Sun's JDK 1.6, you can just use below commands to make android build system use the openjdk7 for Lollipop built $ export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/ $ cd myandroid $ . ./build/envsetup.sh           //be sure to resetup the envsetup, and pick the platform to be built $ lunch
View full article