i.MX Android R10.3 User Guide Update
Last Update: Oct 28th, 2011
- 1. Setup
- 2. Build Android for i.MX
- 3. Download images and Boot-up system
- 3.1 Board Dip Switch Setting
- 3.2 System on MMC/SD and eMMC
- 3.3 System on NFS
- 3.4 System on NAND Flash
3.4.1 NAND layout and contents - 3.4.2 Download Images with MFG Tool
- 3.4.3 Boot from SPI nor and NAND flash
- 3.5 Boot Up configurations
- 4. Run
- 4.1 Multimedia
- 4.2 Storage
- 4.3 Connection
- 4.4 Display
- 4.5 Application & Development
- 5. FAQ
- 5.1 Why did the code fail to download from Google when repo init?
- 5.2 Why I can't access the internet with browser using ethernet?
- 5.3 Can I access Android shell using ethernet instead of a serial port?
- 5.4 How do I change Android boot logo?
- 5.5 How to use wake_lock to control specific devices?
1. Setup
1.1 PC Setup
To build the Android source files, you will need to use Linux PC. It's suggested that you use the most recent version of Ubuntu which is the mostly tested OS for an Android build.After installing Linux PC, you need check whether you have all necessary packages installed for an Android build. Refer to "Setting up your machine" on the Android web site http://source.android.com/source/download.html.
1.2 Unpack i.MX Android Release Package
After you setup a Linux PC, unpack the FSL i.MX Android Release Package using the following commands: $ cd /opt (or any other directory you like) $ tar xzvf imx-android-r10.3.tar.gz $ cd imx-android-r10.3/code $ tar xzvf r10.3.tar.gz |
1.3 Run Android with Prebuilt Image
To try Android before building any code, use the prebuilt images under image/ and directly go to "Download Images and Bootup"。The prebuilt image is under each platform directory that uncompressed from the release package:
- bootloader: imx51_BBG/u-boot-no-padding.bin or imx51_BBG/u-boot.bin (with padding)
- kernel: imx51_BBG/uImage
- Android file system:
- Initramfs: imx51_BBG/SD/uramdisk.img
- System root: imx51_BBG/SD/system.img
- Data: imx51_BBG/SD/userdata.img. Not provided as it's empty.
System images for TFTP/NFS
- bootloader: imx51_BBG/u-boot-no-padding.bin or imx51_BBG/u-boot.bin (with padding)
- kernel: imx51_BBG/uImage
- Android file system: imx51_BBG/NFS/android_fs.tar.gz
2. Build Android for i.MX
2.1 Get Android Source Code (Android/Kernel/uboot)
the Android source code is maintained as more than 100 gits in an Android repository (Visit GitWeb from browser).To get the Android source code from Google repo, follow the steps:
Assume you had unzipped i.MX Android release package to /opt/imx-android-r10.3/. $ cd ~ $ mkdir myandroid $ cd myandroid $ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ./repo $ chmod a+x ./repo $ ./repo init -u https://android.googlesource.com/platform/manifest -b android-2.3.7_r1 $ ./repo sync after sync code successfully,do the following: $ cd myandroid/external $ git clone git://android.git.linaro.org/platform/external/alsa-lib.git $ git clone git://android.git.linaro.org/platform/external/alsa-utils.git $ git clone git://android.git.linaro.org/platform/external/mtd-utils.git $ cd myandroid/hardware $ git clone git://android.git.linaro.org/platform/hardware/alsa_sound.git $ cd myandroid/packages/apps $ rm -rf CellBroadcastReceiver |
Get a clean kernel source code from kernel.org, and checkout the tag of 2.6.35.3:
$ cd myandroid $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git kernel_imx $ cd kernel_imx $ git checkout v2.6.35.3 |
$ cd myandroid/bootable/bootloader $ git clone git://git.denx.de/u-boot.git uboot-imx |
2.2 Patch Code for i.MX
Apply all i.MX Android patches using following steps: Assume you had unzipped i.MX Android release package to /opt/imx-android-r10.3/. $ cd ~/myandroid $ . /opt/imx-android-r10.3/code/r10.3/and_patch.sh $ help Now you should see "c_patch" function is available for you $ c_patch /opt/imx-android-r10.3/code/r10.3 imx_r10.3 Here "/opt/imx-android-r10.3/code/r10.3" is the location of the patches (i.e. directory created when you unzip release package) "imx_r10.3" is the branch which will be created automatically for you to hold all patches (only in those existing Google gits). You can choose any branch name you like instead of "imx_r10.3". If everything is OK, "c_patch" will generate the following output to indicate successful patch: ************************************************************** Success: Now you can build android code for FSL i.MX platform ************************************************************** |
2.3 Build Uboot Images
$ cd ~/myandroid/bootable/bootloader/uboot-imx $ export ARCH=arm $ export CROSS_COMPILE=~/myandroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- Command to build for i.MX51 BBG board is: $ make distclean $ make mx51_bbg_android_config $ make Command to build for i.MX53 TABLET board is: $ make distclean $ make mx53_smd_android_config $ make
Command to build for i.MX53 ARD board is: $ make distclean $ make mx53_ard_config (If your board has DDR3, then using mx53_ard_ddr3_config) $ make
Command to build for i.MX50 RD3 board is:
$ make distclean $ make mx50_rd3_android_config $ make
"u-boot.bin" is generated if you have a successful build. The above u-boot.bin has 1024KB padding at the head of file,for example first executable instruction is at the offset 1KB. If you want to generate a no-padding image, you need do below dd command in host. $ sudo dd if=./u-boot.bin of=./u-boot-no-padding.bin bs=1024 skip=1; sync Usually this no-padding uboot image is used in the SD card, for example, program this no-padding uboot image into 1KB offset of SD card so that we do not overwrite the MBR (including partition table) within first 512B on the SD card. Note : Any image which must be loaded by uboot must have an unique image head, for example, some data must be added at the head of loaded image to tell uboot about the image (for example, it's a kernel, or ramfs, etc) and how to load the image (for example, load/execute address). Therefor before you can load any image into RAM by uboot, you need a tool to add this information to generate a new image which can be recognized by uboot. Fortunately, this tool is delivered together with uboot. After you make uboot using the above steps, you can find the tool (mkimage) under tools/. Later the document will describe how to use mkimage to generate the image (for example kernel image, ramfs image) to be loaded by uboot. |
2.4 Build Kernel Image
Kernel image will be built out when building the android root file system. So you can jump to next section if you do not take care how to build kernel image.
Assume you had already built uboot. mkimage was generated under myandroid/bootable/bootloader/uboot-imx/tools/ and it's in your PATH $ export PATH=~/myandroid/bootable/bootloader/uboot-imx/tools:$PATH $ cd ~/myandroid/kernel_imx $ echo $ARCH && echo $CROSS_COMPILE Make sure you have those 2 environment variables set If the two variables have not set, please set the as: $ export ARCH=arm $ export CROSS_COMPILE=~/myandroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
$ make imx5_android_defconfig Generate ".config" according to default config file under arch/arm/configs. $ make uImage |
To generate uImage from the built zImage, generate a uImage based on the above zImage as follows:
$ cd ~/myandroid/kernel_imx/arch/arm/boot For i.MX51 BBG Board: $ ~/myandroid/bootable/bootloader/uboot-imx/tools/mkimage -A arm -O linux -T kernel -C none -a 0x90008000 -e 0x90008000 -n "Android Linux Kernel" -d ./zImage ./uImage For i.MX53 TABLET/ARD and i.MX50 RD3 Board: $ ~/myandroid/bootable/bootloader/uboot-imx/tools/mkimage -A arm -O linux -T kernel -C none -a 0x70008000 -e 0x70008000 -n "Android Linux Kernel" -d ./zImage ./uImage During boot, when uboot try to load above "uImage", it will know to load it (without image head added by mkimage tool) into 0x90008000 or 0x70008000 (specified by "-a"), and then jump to 0x90008000 or 0x70008000 (specified by "-e") to execute it. "-C none" means no compression when generating "uImage". This is because the original zImage is already a compressed one. |
2.5 Build Android Image
$ cd ~/myandroid $ export CROSS_COMPILE=~/myandroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- Command to build for i.MX51 BBG3 board is: $ source build/envsetup.sh "imx51_bbg" is the product names (see ~/myandroid/device/fsl/product) Command to build for i.MX53 ARD board is: Command to build for i.MX50 RD3 board is: After build, check build_*_android.log to make sure no build error. |
root/ : root file system (including init, init.rc, etc). Mounted at /
system/: Android system binary/libraries. Mounted at /system
data/: Android data area. Mounted at /data
recovery/: root file system when booting in "recovery" mode. Not directly used.
ramdisk.img: Ramdisk image generated from "root/". Not directly used.
android_root.img: UBI raw image generated from "system/", it contains system, data and cache UBI volumes with UBIFS format.
android_recovery.img: UBI raw image generated from "recovery/". it contains recovery UBI volumes with UBIFS format.
For i.MX53 TABLET build, the following outputs are generated as default under myandroid/out/target/product/imx53_smd :
root/ : root file system (including init, init.rc, etc). Mounted at /
system/: Android system binary/libraries. Mounted at /system
data/: Android data area. Mounted at /data
recovery/: root file system when booting in "recovery" mode. Not directly used.
ramdisk.img: Ramdisk image generated from "root/". Not directly used.
system.img: EXT4 image generated from "system/". Can be programmed to "SYSTEM" partition on SD card with "dd"
userdata.img: EXT4 image generated from "data/".
recovery.img: EXT4 image generated from "recovery/". Can be programmed to "RECOVERY" partition on SD card with "dd"
2.5.1 User Build mode
It will install modules tagged with user.
install APK and tools according to product definition files, please check the PRODUCT_PACKAGES in device/fsl/imx5x/imx5x.mk
and set ro.secure=1, and ro.debuggable=0, and adb is disabled by default.
If you need add your customized package, please add the package's MODULES_NAME or PACKAGE_NAME to this list.
change the eng in previous section to user can generate user mode image:
eg:
$ make PRODUCT-imx51_bbg-user 2>&1 | tee build_imx51_bbg_android.log |
Or you can use:
$ . build/envsetup $ lunch imx51_bbg-user $ make |
Change imx51_bbg to imx5x_xxx board list in previous section.
More android building information please refer: http://source.android.com/source/building.html
NOTE: if you build the system images by user build mode, the ADB is disabled by default. If want to use ADB, you must enable it in the settings application after android startup: Settings->Applicaitons->Development.
The following steps generate a RAMDISK image recognized by uboot:
Assume you had already built uboot. mkimage was generated under myandroid/bootable/bootloader/uboot-imx/tools/ $ cd myandroid/out/target/product/imx50_rdp $ ~/myandroid/bootable/bootloader/uboot-imx/tools/mkimage -A arm -O linux -T ramdisk -C none -a 0x70308000 -n "Android Root Filesystem" -d ./ramdisk.img ./uramdisk.img $ cd myandroid/out/target/product/imx51_bbg $ ~/myandroid/bootable/bootloader/uboot-imx/tools/mkimage -A arm -O linux -T ramdisk -C none -a 0x90308000 -n "Android Root Filesystem" -d ./ramdisk.img ./uramdisk.img $ cd myandroid/out/target/product/imx53_ard $ ~/myandroid/bootable/bootloader/uboot-imx/tools/mkimage -A arm -O linux -T ramdisk -C none -a 0x70308000 -n "Android Root Filesystem" -d ./ramdisk.img ./uramdisk.img $ cd myandroid/out/target/product/imx53_smd $ ~/myandroid/bootable/bootloader/uboot-imx/tools/mkimage -A arm -O linux -T ramdisk -C none -a 0x70308000 -n "Android Root Filesystem" -d ./ramdisk.img ./uramdisk.img |
3. Download images and Boot-up system
3.1 Board Dip Switch Setting
3.1.1 USB serial download settings
i.MX51 BBG
Switch | S-1 | S-2 | S-3 | S-4 | S-5 | S-6 | S-7 | S-8 | S-9 | S-10 |
S1 | OFF | OFF | OFF | OFF | OFF | OFF | OFF | OFF | OFF | ON |
i.MX53 TABLET
Switch | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 |
SW26 | OFF | OFF | OFF | OFF | OFF | OFF | OFF | OFF |
SW28 | OFF | OFF | ON | ON | OFF | OFF | OFF | OFF |
i.MX50 RD3
Switch | D1 | D2 |
S1 | ON | ON |
3.1.2 Boot up settings
i.mx51 BBG MMC/SD Slot1 Boot
Switch | S-1 | S-2 | S-3 | S-4 | S-5 | S-6 | S-7 | S-8 | S-9 | S-10 |
S1 | OFF | OFF | OFF | OFF | OFF | OFF | ON | ON | OFF | OFF |
i.mx53 TABLET eMMC(SD slot3) Boot
Switch | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 |
SW26 | OFF | ON | OFF | OFF | ON | ON | ON | OFF |
SW28 | OFF | OFF | OFF | OFF | OFF | OFF | OFF | ON |
i.mx53 TABLET MMC/SD (slot1) Boot
Switch | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 |
SW26 | OFF | OFF | OFF | OFF | OFF | OFF | ON | OFF |
SW28 | OFF | OFF | OFF | OFF | OFF | OFF | OFF | OFF |
i.mx50 RD3 SD boot; others boot mode, refer to "Codex_CPU_Boot_Mode.xls"
Switch | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 |
SW5 | OFF | ON | OFF | OFF | ON | OFF | OFF | OFF |
SW4 | OFF | OFF | OFF | OFF | OFF | OFF | OFF | OFF |
SW3 | OFF | OFF | OFF | OFF | OFF | OFF | OFF | OFF |
Switch | D1 | D2 |
S1 | OFF | OFF |
3.2 System on MMC/SD and eMMC
Android support running on the MMC/SD card, or on board eMMC device.- u-boot image: u-boot.bin or u-boot-no-padding.bin
- kernel image: uImage
- ramdisk image: uramdisk.img
- Android system root image: system.img
- Recovery root image: recovery.img
NOTE: i.MX53 TABLET take eMMC as the default storage for android system, so the default images in the release package only support android boot from on board eMMC device.
If you want to boot it from SD card, please change the init.rc in the uramdisk.img, and modify all the 'mmcblk0px' to 'mmcblk1px', as we take eMMC block device as mmcblk0, but external SD slot as mmcblk1:
# dd if=uramdisk.img of=ramdisk.img.gz skip=64 bs=1 # gunzip ramdisk.img.gz # mkdir ramdisk; cd ramdisk # cpio -i < ../ramdisk.img # vim init.rc (modify the init.rc, change the mmcblk0 to mmcblk1) # find . | cpio --create --format='newc' | gzip > ../ramdisk.img # mkimage -A arm -O linux -T ramdisk -C none -a 0x70308000 -n "Android Root Filesystem" -d ./ramdisk.img ./uramdisk.img |
3.2.1 Storage Partitions
- [Partition type/index] is which defined in the MBR.
- [Name] is only meaningful in android, you can ignore it when creating these partitions.
- [Start Offset] shows where partition is started, unit in MBytes.
Partition Type/Index | Name | Start Offset | Size | File System | Content |
N/A | BOOT | 0 | 10MB | N/A | bootloader/kernel/uramdisk images |
Primary 1 | MEDIA | 10MB | User Defined | VFAT. Mount as /sdcards | Media file storage |
Primary 2 | SYSTEM | follow MEDIA | >= 200MB | EXT4. Mount as /system (with read only) | Android system bin/libs (system.img) |
Logic 5 (Extended 3) | DATA | follow SYSTEM | > 200MB | EXT4. Mount as /data | Android data (e.g. installed app) |
Logic 6 (Extended 3) | CACHE | follow DATA | > 10MB | EXT4. Mount as /cache | Android cache |
Primary 4 | RECOVERY | follow CACHE | > 20MB | EXT4. Mount as / in recovery mode | Root file system for recovery mode (recovery.img) |
To create these partitions, you can simply use MFG tool described in next section, or use fdisk utility on Linux PC.
# mkfs.vfat /dev/sdx1 # mkfs.ext4 /dev/sdx2 -O ^extent -L system # mkfs.ext4 /dev/sdx4 -O ^extent -L recovery # mkfs.ext4 /dev/sdx5 -O ^extent -L data # mkfs.ext4 /dev/sdx6 -O ^extent -L cache |
NOTE: /dev/sdxN, the x is the disk index from 'a' to 'z', that may be different on each Linux PC.
3.2.2 Download Images with MFG Tool
Before using the MFG tool, please setup the board's Boot Dip switch settings to USB serial download mode.
- Copy the android images: u-boot.bin, uImage, uramdisk.img, system.img, recovery.img to Profiles/MX53 Linux Updata/OS Firmware/files/android.
- Run the MFGTool, plug in the usb cable and choose your profile
![](images/dc37ttrp_170c6g52hpq_b.png)
- Select the profile MX53SMD-Android-eMMC4.4: Option -> Configuration -> Profiles -> Options
- Power on the board, install the USB PC driver if needed. You will see the device connected: 'Freescale i.MX53 USB BulkIO Device'
- If not see this, please check the right port number and devices. (Or press the "reboot" key SW10 on debug board)
or the Boot dip on the board.
- After all preparation done, press the "Start"
Notes: you can connect the serial port to check the download process.
3.2.3 Download Images with dd utility
Download the uboot image: # sudo dd if=u-boot.bin of=/dev/sdx bs=1K skip=1 seek=1; sync Or If you're using no padding uboot image: # sudo dd if=u-boot-no-padding.bin of=/dev/sdx bs=1K seek=1; sync Download the kernel image: # sudo dd if=uImage of=/dev/sdx bs=1M seek=1; sync Download the initramfs image: # sudo dd if=uramdisk.img of=/dev/sdx bs=1M seek=6; sync Download the android system root image: # sudo dd if=system.img of=/dev/sdx2; sync Download the android recovery image: # sudo dd if=recovery.img of=/dev/sdx4; sync |
3.2.4 Download Images with fastboot
- Power on the board with USB otg connected.
- Press any key to enter the uboot shell.
- Select the correct device to do fastboot image download by command:
- SD/MMC card
- on board eMMC (only support on MX53 TABLET)
- SSD (only support on MX53 TABLET)
- Run the fastboot command, and you can see:
U-Boot > fastboot fastboot is in init......USB Mini b cable Connected! fastboot initialized USB_SUSPEND USB_RESET USB_RESET |
Host side:
- Enter the Android SDK tools directory and find the fastboot utility (it's fastboot.exe on Win, fastboot on Linux)
- Copy all download images to the "images" folder
- Run the following commands:
U-Boot > fastboot flash bootloader images\u-boot-no-padding.bin U-Boot > fastboot flash kernel images\uImage U-Boot > fastboot flash uramdisk images\uramdisk.img U-Boot > fastboot flash system images\system.img U-Boot > fastboot flash recovery images\recovery.img U-Boot > fastboot reboot |
When a MMC/SD or eMMC device ready for Android system boot, you can power on the board to setup the u-boot environment for loading kernel/ramdisk from device
U-Boot > setenv ethaddr 00:04:9f:00:ea:d3 [setup the MAC address]
U-Boot > setenv fec_addr 00:04:9f:00:ea:d3 [setup the MAC address]
U-Boot > setenv loadaddr <kernel load addr> [0x90800000 for i.MX51, 0x70800000 for i.MX50/3]
U-Boot > setenv rd_loadaddr <ramdisk load addr> [0x90D00000 for i.MX51, 0x70D00000 for i.MX50/3]
U-Boot > setenv bootcmd 'run bootcmd_SD; bootm ${loadaddr} ${rd_loadaddr}'
U-Boot > setenv bootcmd_SD 'mmc read 0 ${loadaddr} 0x800 0x2000; mmc read 0 ${rd_loadaddr} 0x3000 0x300;' [load kernel and ramdisk from MMC/SD or eMMC]
[About the eMMC boot, please use the "mmc read 1" replace the "mmc read 0"]
U-Boot > setenv bootargs <SD/MMC bootargs> [For different platforms, please refer to below table]
U-Boot > saveenv [Save the environments] |
Platform | Bootargs |
i.MX51 BBG with WVGA | console=ttymxc0 init=/init androidboot.console=ttymxc0 di1_primary gpu_nommu, gpu_memory=32M calibration ip=dhcp |
i.MX51 BBG with DVI | console=ttymxc0 init=/init androidboot.console=ttymxc0 di0_primary gpu_nommu, gpu_memory=32M video=mxcdi0fb:RGB24,1024x768M@60 |
i.MX53 TABLET with LVDS | console=ttymxc0 init=/init androidboot.console=ttymxc0 video=mxcdi1fb:RGB666,XGA ldb=di1 di1_primary ip=dhcp gpu_nommu, gpu_memory=64M |
i.MX53 TABLET with HDMI | console=ttymxc0 init=/init androidboot.console=ttymxc0 video=mxcdi0fb:RGB24,1280x720M@60 hdmi di0_primary ip=dhcp gpu_nommu, gpu_memory=64M console=ttymxc0 init=/init androidboot.console=ttymxc0 video=mxcdi0fb:RGB24,1920x1080M@60 hdmi di0_primary ip=dhcp gpu_nommu, gpu_memory=64M dmfc=3 |
i.MX53 ARD with LVDS | console=ttymxc0 init=/init androidboot.console=ttymxc0 video=mxcdi0fb:RGB666,XGA ldb=di0 di0_primary ip=dhcp gpu_nommu, gpu_memory=64M |
i.MX50 RD3 with E-Ink | console=ttymxc0 init=/init androidboot.console=ttymxc0 keypad video=mxc_el、cdif_fb:off |
i.MX50 RD3 with SEIKO LCD (connected on J13) | console=ttymxc0 init=/init androidboot.console=ttymxc0 keypad lcd=1 |
i.MX50 RD3 with SEIKO LCD (connected on J12) | console=ttymxc0 init=/init androidboot.console=ttymxc0 keypad lcd=1,j12 |
i.MX50 RD3 with CLAA LCD (connected on J12) | console=ttymxc0 init=/init androidboot.console=ttymxc0 keypad lcd=2 |
For the first time boot, it takes some time to the Android UI.
3.3 System on NFS
Android support running the system on NFS root filesystem. We can put the total android root system into NFS, but load kernel image from TFTP server.NOTE: due to support LCD display on MX508 RD3 board, the FEC pins has configured for elcd interface. So the FEC can not be used by default kernel images. If you're willing to use the NFS with EPDC display, please remove the CONFIG_FB_MXC_ELCDIF_FB, CONFIG_FB_MXC_CLAA_WVGA_SYNC_PANEL and CONFIG_FB_MXC_SEIKO_WVGA_SYNC_PANEL configure from kernel.
3.3.1 Setup the TFTP and NFS root
After you setup the TFTP/NFS server, please put the kernel image into the tftp server root directory and the Android file system files into the NFS server root directory.
When you setup NFS, please do following step:
To avoid some permission issue when enable wifi on NFS.
delete this line:
RPCMOUNTDOPT=--manage-gids
in /etc/default/nfs-kernel-server
For kernel image, use uImage instead of zImage
* If you are using a prebuilt image, make sure you pick up the correct uImage (see "Prebuilt image for using uboot")
* If you are building your own image, make sure you generated a uImage (see "Generate uImage to be loaded by u-boot").
Copy uImage to the TFTP server root directory. For example:
$ cp your_uImage /opt/tftproot/ |
Setup the Android file system:
* If you are using a prebuilt image, unzip the android zip file (see "Prebuilt image for using uboot") to the NFS server root. For example:
$ cd /opt/imx-android-r10.3/image/imx5x_BOARD/NFS $ tar xzvf ./android_fs.tar.gz $ cd android_fs $ rm -rf /opt/nfsroot/* $ cp -r * /opt/nfsroot/* |
* If you built out your own Android image, copy the generated Android files to the NFS root manually. For example:
$ cd myandroid $ rm -rf /opt/nfsroot/* $ cp -r out/target/product/imx5x_BOARD/root/* /opt/nfsroot/ $ cp -r out/target/product/imx5x_BOARD/system/* /opt/nfsroot/system/ |
Setup the u-boot environment for loading kernel from TFTP and mounting NFS as root filesystem after we got the u-boot shell:
U-Boot > setenv ethaddr 00:04:9f:00:ea:d3 [setup the MAC address]
U-Boot > setenv fec_addr 00:04:9f:00:ea:d3 [setup the MAC address]
U-Boot > setenv loadaddr <kernel load addr> [0x90800000 for i.MX51, 0x70800000 for i.MX50/3]
U-Boot > setenv bootfile uImage
U-Boot > setenv serverip <your server ip> [Your TFTP/NFS server ip]
U-Boot > setenv nfsroot <your rootfs> [Your rootfs]
U-Boot > setenv bootcmd 'dhcp;bootm' [load kernel from TFTP and boot]
U-Boot > setenv bootargs <NFS bootargs> [For different platforms, please refer to below table; do not add '']
U-Boot > saveenv [Save the environments]
|
Platform | Bootargs |
i.MX51 BBG with WVGA | console=ttymxc0 init=/init androidboot.console=ttymxc0 root=/dev/nfs nfsroot=${serverip}:${nfsroot} rw ip=dhcp di1_primary gpu_nommu, gpu_memory=32M |
i.MX53 TABLET with LVDS | console=ttymxc0 init=/init androidboot.console=ttymxc0 root=/dev/nfs nfsroot=${serverip}:${nfsroot} rw ip=dhcp video=mxcdi1fb:RGB666,XGA ldb=di1 di1_primary gpu_nommu, gpu_memory=64M |
i.MX50 RD3 with E-Ink | console=ttymxc0 init=/init androidboot.console=ttymxc0 root=/dev/nfs nfsroot=${serverip}:${nfsroot} rw ip=dhcp keypad video=mxc_elcdif_fb:off |
3.4 Boot Up configurations
3.4.1 U-Boot environment
- ethaddr/fec_addr: MAC address of your board
- serverip: IP address of your TFTP/NFS server
- loadaddr/rd_loadaddr: the kernel/initramfs image load address in memory. Different platform may have different loadaddr and rd_loadaddr, listed below:
-
I.MX51 BBG
I.MX53 SMD/ARD
I.MX50 RD3
loadaddr
0x90800000
0x70800000
0x70800000
rd_loadaddr
0x90D00000
0x70D00000
0x70D00000
- bootfile: the name of image file loaded by "dhcp" command, when you using TFTP to load kernel.
- bootcmd: the first variable to run after uboot boot
- bootargs: the kernel command line, bootloader passed to kernel. Described in 3.4.2 section
- dhcp: get ip address by BOOTP protocol, and load the kernel image ($bootfile env) from TFTP server.
- bootm: start to run the kernel.
3.4.2 Kernel command line (bootargs)
Kernel Parameter | Description | Typical Value | Used When |
console | where to output kernel log by printk | console=ttymxc0 | All case |
androidboot.console | indicate Android shell where to put log | androidboot.console=ttymxc0 | All case for Android (with this parameter, you can use Ctrl-C in Android shell) |
init | tell kernel where is the init file | init=/init | All case for Android. "init" in Android is located in "/" instead of in "/sbin" |
ip | tell kernel how/whether to get IP address | ip=none or ip=dhcp or ip=static_ip_address | "ip=dhcp" or "ip=static_ip_address" is mandatory in "boot from TFTP/NFS" |
nfsroot | where is NFS server/directory | rootfs=ip_address:/opt/nfsroot,v3,tcp | Used in "boot from tftp/NFS" together with "root=/dev/nfs" |
root | indicate where is the root file system | root=/dev/nfs or root=/dev/mmcblk0p2 | Used in "boot from tftp/NFS" (i.e. root=/dev/nfs); Used in "boot from SD" (i.e. root=/dev/mmcblk0p2) if no ramdisk is used for root fs |
video | tell kernel/driver which resolution/depth and refresh rate should be used | video=mxcdi0fb:1024x768M-16@60 | Used when display on DVI (i.MX51 BBG3 board). Please check "Display Settings" table below for detail. |
di1_primary | tell kernel/driver using DI1 display | di1_primary | Used to tell kernel which display interface is the default on for UI. |
calibration | tell kernel/driver to do touch panel calibration when 1st boot | calibration | Used when touch panel is needed. i.e. when you display everything on DVI or multitouch screen, no need for this. |
keypad (for i.mx50) | Use the keypad on E-ink panel board | keypad | Use the keypad on E-ink panel board |
dmfc | tell ipu driver to use a specific DMFC FIFO size, which is related with display/video performance. | dmfc=3 | Used when display/video resolution is close to MX51 or MX53 display bandwidth. For example, for MX53, this option should be added for 1080P60 display/video. Note that adding this option means that you are dropping dual display support. |
tve | tell kernel to probe TVE driver to support TVout | tve | When TVout is the primary display device, hot plug-in display devices, like HDMI monitor and DVI monitor are not supported as the secondary display device. This option is valid for TVout only case or TVout video only case. |
vga | tell kernel to probe TVE driver to support VGA monitor | vga | When VGA monitor is used |
MX51 | MX53 | |||||
Display device | Interface | Format | Video Mode | Interface | Format | Video Mode |
DVI | di0 | RGB24 | mxcdi0fb:800x600M-16@60 | di0 | RGB24 | mxcdi0fb:800x600M-16@60 |
HDMI | di0 | RGB24 | mxcdi0fb:1280X720M@60 hdmi | |||
LVDS | diX (X=0 or X=1) | RGB666 | mxcdiXfb:RGB666,XGA ldb=diX | |||
WVGA LCD | di1 | RGB565 | mxcdi1fb:CLAA-WVGA | di0 | RGB565 | mxcdi0fb:CLAA-WVGA |
TV Encoder | di1 | YUV444 |
mxcdi1fb:TV-NTSC mxcdi1fb:TV-PAL
mxcdi1fb:TV-720P60
| di1 | YUV444 |
mxcdi1fb:TV-NTSC mxcdi1fb:TV-PAL
mxcdi1fb:TV-720P60
|
4. Run
4.1 Multimedia
4.1.1 Music Play
- Insert a SD card with music files (such as mp3) on FAT partition
- Connect headset/headphone to your board
- Launch the main menu
- on the BBG3, use UP/DOWN/LEFT/RIGHT key to highlight the MENU icon at the right side of home screen, press ENTER (or F9)
- Launch the Music application by selecting the Music icon
4.1.2 Video Play
The one is to play video on the secondary display device only and UI is displayed on both display devices, which is called single video case.
The other one is to play video on both display devices and UI is shown on the primary display only, which is called dual video case.
Note that user need to decide which case he or she wants to use before system boots up. It cannot be changed at run time.
To use single video case, edit init.freescale.rc to this:
setprop ro.SIN_VIDEO_DUAL_UI 1
setprop ro.DUAL_VIDEO_SIN_UI 0
To use dual video case, edit init.freescale.rc to this:
setprop ro.SIN_VIDEO_DUAL_UI 0
setprop ro.DUAL_VIDEO_SIN_UI 1
- Insert a SD card with video stream files (.3gp, .mp4) on FAT partition
- Launch the main menu
- Launch the Gallery application by selecting Gallery icon
- During play, touching the screen will cause a semi-transient pop-up menu to be displayed. You can select backward/forward/pause/play.
4.1.3 Streaming Play
- Launch the main menu
- Launch the Browser application by selecting the Browser icon
- Open a webpage http link with a rtsp streaming link or a multimedia file http link embedded.
- Click the rtsp streaming link or multimedia http link.
- During play, touch the screen displays a semi-transient pop-up menu. You can select backward/forward/pause/play if the streaming server supports those features.
4.1.4 Camera & Camcorder
- Configure the sensor in Kernel
- Enable the on Board sensors(ov3640, ov5640, ov5642, etc), the default sensor is configured to OV5642.
- change the Board configure in file kernel_imx/arch/arm/mach-mx5/mx53_smd.c (or mx51_babbage.c, which depends on your board) in struct mxc_i2c0_board_info:
Configure the type to the sensor type on the board.
- Configure the corresponding sensor driver.
- Configure the corresponding sensor driver.
<*> Multimedia support --->
[*] Video capture adapters --->
MXC Camera/V4L2 PRP Features support --->
<*> Select Camera/TV Decoder (OmniVision ov5642 camera support) --->
(X) OmniVision ov5642 camera support
- Enable the UVC camera
<*> Multimedia support --->
[*] Video capture adapters --->
[*] V4L USB devices --->
<*> USB Video Class (UVC)
#Define the config for dual camera
setprop back_camera_name ov
setprop back_camera_orient 0
setprop front_camera_name uvc
setprop front_camera_orient 180
The camera name can just be set the key word of the sensor name since the Camera HAL will query and identify the whole sensor name.
The orientation indicates the rotation of the capture frame.
If only one camera is set, the system will only recognize one camera. At least one camera configure should be required.
- Insert a fat32 formatted SD card into the board
- Launch the Camera application by selecting the Camera icon
- Click the button on the right of the preview window to choose the front camera or back camera.
- Click the button on the right of the preview window to set the parameters for picture, now only support the configuration of the picture size.
- Click the Shot icon on the preview screen
- A still image is captured and saved as a JPEG file on the SD card
- Go to Gallery application to see the captured picture
4. Video capture
- Insert a fat32 formatted SD card into the board
- Connect a microphone to the board for imx51 babbage, and for imx53 smd there is a on board microphone.
- Launch the Camera application, since the Camera and Camcorder are in one application
- Switch to camecorder by the switch button on the left.
- Click the button on the right of the preview window to choose the front camera or back camera.
- Click the button on the left of the preview screen to configure the video recording, the default support the Following qualities:
- High quality: H.264 & AMR-NB in MP4.
- Low quality: H.263 & AMR-NB in 3GP.
- Click the record icon, which changes to stop icon.
- Show something before camera sensor and say something to the microphone
- Click the stop icon.
- Go to Gallery application to see the captured video
- The Camcorder configure file is in device/fsl/proprietary/codec/conf/media_profiles.xml, in which the Camera id, recorded video properties can be configured.
- For cameraId, 0 is mapped to the front camera if it is available.
- For default, only one Camera for video recording is enabled. To add another camera, you can add another CamcorderProfiles item according to the first one.
- For video size, it should be the set that the sensor supports.
- For bitrate, for VGA recording, bitrate is recommended to be 1500000, for 720p recording, bitrate is recommended to be 60000000
4.1.5 Sound Recording
- Insert a formated SD card into the board
- Connect microphone to the board
- Choose Main Menu > Sound Recorder
- Press the record button to start the recording
- Speak into the microphone
- Press the stop button to pause the recording
- Press the play to listen what has been recorded
- Select Use this recording. The application exits and a new file (.3gp with AMR-NB) is saved to the SD card
- Choose the Main Menu > Music. If you can't see the new .3gp file, try below:
- Choose the Main Menu > SD card & phone storage > Umount SD card
- Remove the SD card and insert the SD card again
- Choose the Main Menu > Music. You should be able to see the recorded sound file
4.2 Storage
4.2.1 USB Mass Storage
It shows a window with "Turn on USB Storage" button, click it.
4.2.2 Multi-Storage Access
There are total three storages supported in i.MX51 BBG.i.MX51 BBG supports the following storages:- SD card in MMC/SD connector P1
- SD card in MMC/SD connector P2
- UDISK connected to the board through the USB port
- The SDK API Environment.getExternalStorageDirectory()/getExternalStorageState() returns the external stoage directory based on the Storages present on the Board.
- The APIs are added into the Android SDK API to support access the external storages as request:
Environment.getExternalSDStorageDirectory()
Environment.getExternalUDiskStorageDirectory()
Environment.getExternalExtSDStorageDirectory()
Environment.getExternalSDStorageState()
Environment.getExternalUDiskStorageState()
Environment.getExternalExtSDStorageState()Environment.isExternalSDStorageRemovable()
Environment.isExternalExtSDStorageRemovable()
Environment.isExternalUDiskStorageRemovable()
dev_mount udisk /mnt/sdcard/udisk auto /devices/platform/fsl-ehci.1/usb
dev_mount udisk /mnt/sdcard/udisk auto /devices/platform/fsl-ehci.0/usb
4.3 Connection
4.3.1 Enable WiFi
- Choose Main Menu > Setting > Wireless control
- Enable Wi-Fi
- Enter the WiFi settings, it should automatically search all available APs and display them on screen
- Select your WiFi AP, and click connect
- Input password if required
- To make sure you have a WiFI connection type
$ netcfg (you should see a wlan0 interface) - Use the browser to access the internet
4.3.2 Browse Internet using 3G Modem Connection
- Make the 3G Modem ready for using.
- Insert a SIM card into the SIM slot on 3G module or board
- Wait for a few seconds, you should be able to use Dialer or Message to call others or send SMS
- Setup APN for packet call:
- Choose Main Menu > Wireless control > Mobile Networks > Access Point Names
- Press the MENU key and select New APN
- Name: ChinaMobile (any name you can choose), APN: cmnet (contact your operator), MCC/MNC:460/00 (country/network code for your operator)
- Press the MENU key and select Save
- reboot the board
- After reboot, make sure you already connect to internet via 3G modem:
$ netcfg (you should see a ppp interface)
$ getprop net.dns1 (a meaningful IP address should be displayed) - Launch browser
4.3.3 Enable the AR6102/AR6002 WIFI card
Notes: the default enabled is AR6003; the AR6102 also can use the same module with AR6002if you want to support ar6102, please replace
cp /system/bin/wlan_tool_6102 /system/bin/wlan_tool
chmod 777 /system/bin/wlan_tool
it will insmod from /system/lib/modules/ar6102.ko
the script 's source code is under :
android/system/wlan/atheros/AR6kSDK/host/tools/wlan_tool
You can replace the wlan_tool_6102's contents to wlan_too, or change the Android.mk
Notice: ar6102 don't support AP mode, so all AP mode related function will failed.
- Make sure "ip=dhcp" is not in the boot command for not nfs boot
- Choose Main Menu > Setting > Wireless control
- Enable Ethernet
- Use the browser to access the internet
Source: android/external/linux-firmware-imx/firmware/ar3k/30101/ar3kbdaddr.pst
And will install in your android image:
/system/lib/firmware/ar3k/30101/ar3kbdaddr.pst
If you are have more then 1 device with demo image, you should change the MAC address to make sure the MAC address will not conflict with others.
You can change the MAC address by these commands under debug console:
mount -w -o remount -t ext4 /dev/block/mmcblk0p2 /system echo 0060417f1234 > /system/lib/firmware/ar3k/30101/ar3kbdaddr.pst mount -r -o remount -t ext4 /dev/block/mmcblk0p2 /system |
This will be the new MAC address(BD addr) of BT chip, change 1234 to what you want to make sure the MAC address will not conflict with others.
If you are using same MAC address with others, and two machine enable BT in same time, unknown error will happens.
4.3.6 About Atheros GPS on MX53_SMD Board.
We have enable GPS device on MX53_SMD reference board, but for test, you must use an external antenna to test GPS.
The GPS antenna inside of SMD board is not work.
You can connect the external antenna to J123 on the Board(near the 3G mini-PCI-E slot).
4.4 Display
4.4.1 TVout (Video Only)
- On the i.MX51 Babbage board,WVGA and TVOUT cannot both be enabled at the same time, and the output resolution of DVI should be limited to 800x600 for 720P TVout setting. The valid setting in UBOOT are as follows:
- i.MX51 BBG: setenv bootargs_android 'setenv bootargs ${bootargs} init=/init androidboot.console=ttymxc0 gpu_nommu, gpu_memory=32M video=mxcdi0fb:RGB24,640x480M@60 video=mxcdi1fb:YUV444,TV-720P60 tve'
- Connect the board to TV using a composite video cable
- In the serial console, type the following:
- echo D:720x480i-60 > /sys/class/graphics/fb1/mode
you can change "D:720x480i-60" with below value:D:1920x1080p-24
D:1920x1080p-25
D:1920x1080p-30
D:1920x1080i-50
D:1920x1080i-60
D:1280x720p-30
D:1280x720p-60
- echo D:720x480i-60 > /sys/class/graphics/fb1/mode
D:720x576i-50
D:720x480i-60
- echo 0 >/sys/class/graphics/fb1/blank
- echo 1 >/sys/class/graphics/fb1/blank
-
setprop rw.VIDEO_TVOUT_DISPLAY 1
- Choose Main Menu > Gallery, to start to play the video. Now the video should be displayed on the TV, but UI is kept on the LCD
- Note that if TVout is the primary display, we don't support the secondary display. Especially, the secondary display might be a DVI monitor, which will defaultly be enabled when DVI cable is connected(EDID is read). So, add 'ddc=off' to kernel boot-up command line to disable reading EDID for this case. We can support a dumb LCD and a DVI monitor for dual display feature. Of course, if TVout is the secondary display, dual display can also be supported.
4.4.2 TVout (Video and UI)
- On the i.MX51 Babbage board, WVGA and TVOUT can not both be enabled at the same time. The di1_primary boot parameter should be set to enable 720P setting for TVOUPT. The valid setting in UBOOT are as follows:
- i.MX51 BBG: setenv bootargs_android 'setenv bootargs ${bootargs} init=/init androidboot.console=ttymxc0 di1_primary gpu_nommu, gpu_memory=32M video=mxcdi1fb:YUV444,TV-720P60 dmfc=3 tve'
- Connect the board to TV using a composite video cable.
- Boot up the board, you will see all UI on TV
4.4.3 Dual-Display
- setenv bootargs_android 'setenv bootargs ${bootargs} init=/init androidboot.console=ttymxc0 video=mxcdi0fb:RGB24,1024x768M@60 video=mxcdi1fb:RGB565,CLAA-WVGA,int_clk di1_primary gpu_nommu, gpu_memory=32M calibration'
- setenv bootargs_android 'setenv bootargs ${bootargs} init=/init androidboot.console=ttymxc0 video=mxcdi0fb:RGB24,1280x720M@60 video=mxcdi1fb:RGB565,CLAA-WVGA,int_clk di1_primary gpu_nommu, gpu_memory=32M calibration'
- setenv bootargs_android 'setenv bootargs ${bootargs} ip=dhcp init=/init androidboot.console=ttymxc0 di1_primary gpu_nommu, gpu_memory=64M video=mxcdi0fb:RGB24,1024x768M@60 video=mxcdi1fb:RGB666,XGA ldb=di1 calibration'
Dual-Display feature can be enabled dynamically with below steps:
- Connect i.MX51 BBG board with DVI panel or Connect i.MX53 TABLET board with HDMI TV. We enable ddc(edid reading and cable detection) by default in Android kernel. For MX51 BBG board, if ddc doesn't work for DVI connector, you probably need to rework DVI i2c to support this. As the final video mode to be used on DVI monitor is read from DVI monitor's EDID information, a closest video mode will be found in the video modes supported by monitor according to the video mode option in kernel boot-up command line, so it is possible for user to find that the final video mode on the monitor is different with that is specified in the command line. To force to use the video mode in kernel boot-up command line, the user can add 'ddc=off' to the command to disable reading EDID information.
- Set the below property in Android's console:
setprop rw.SECOND_DISPLAY_CONNECTED 1
setprop rw.SECOND_DISPLAY_CONNECTED 0
- UI will be output to both the displays if the secondary is connected with i.MX51 BBG board or i.MX53 TABLET. The image in secondary display is resized from the image in the primary display.
- Video will be output to the full screen size of the secondary display if the DVI panel is connected with i.MX51 BBG3 board or HDMI TV is connected with i.MX53 TABLET, unless it will output to the primary display.
- The dynamical switch between mono display and dual display is supported by hot-plug the secondary display, which is not been enabled in this package. It will be enabled with a updated package later.
- 'dmfc=3' in the kernel boot-up command line can be added if a single display's resolution and refresh rate is close to MX51 or MX53 display bandwidth, e.g., 1080P60 for MX53. Note that adding this option means that you are dropping dual display support feature.
4.4.4 24bpp pixel format support for UI
- setenv bootargs_android 'setenv bootargs ${bootargs} init=/init androidboot.console=ttymxc0 gpu_nommu, gpu_memory=64M video=mxcdi0fb:RGB24,1024x768M@60,bpp=32 '
4.5 Application & Development
4.5.1 Key Map
DELL USB Keyboard's key mapping (defined in /system/usr/keylayout/Dell_Dell_USB_Keyboard.kl):
Key Act as ESC BACK F1 MENU F2 SOFT_RIGHT F3 CALL F4 ENDCALL F5 ENDCALL F8 HOME F9 DPAD_CENTER UP DPAD_UP DOWN DPAD_DOWN BACK DEL ENTER ENTER
BBG add-on peripheral board key mapping (defined in /system/usr/keylayout/mxckpd.kl):
POWER N/A CALL VOLUME_UP
DPAD_LEFT
MENU
DPAD_DOWN DPAD_CENTER DPAD_UP HOME CAMERA N/A ENDCALL VOLUME_DOWN
DPAD_RIGHT
BACK
i.MX508 add-on board keyboard key mapping (defined in /system/usr/keylayout/mxckpd.kl):
Key Act as PREV(SW2) BACK F1(SW5) MENU F9(SW15) ENTER 9(SW24) DPAD_LEFT 0(SW25) DPAD_RIGHT O(SW34) DPAD_UP P(SW35) DPAD_DOWN POWER(SW70) POWER RESET(SW71) RESET NXT1(SW3)/NXT2(SW4) DPAD_CENTER
For imx53_EVK/imx50_PD, the "power key" on board support the suspend/resume operation.
MX53 TABLET Capacitive touch button key mapping:
KEY
Act as
SW30
MENU
SW31
HOME
SW32
BACK
SW29
POWER
MX53 TABLET On board key mapping:
KEY
Act as
SW11
VOLUME_UP
SW12
VOLUME_DOWN
SW5
POWER
4.5.2 Adjust Media Volume for Music and Video
Main Menu > Settings > Sound > Volume
4.5.3 Adjust Brightness of LCD Backlight
Main Menu > Settings > Display > Brightness
4.5.4 longer Screen Timeout
Main Menu > Settings > Display > Screen timeout > 30 minutes
4.5.5 App to SD
- adb install test.apk
- on console: # pm setInstallLocation 2
- Settings-->Applications-->Manage applications-->Downloaded
- you will see the applications move to SD card from the ""On SD card"
4.5.6 Software Update and Wipe Partition using Recovery Mode
- Prepare for all android source code that assumed to be saved in ~/myandroid directory.
-
Prepare for ADB over USB. make sure that ADB over USB is ok. USB cable is connected. Refer to ADB over USB section for more information.
-
Connect the UART to the PC and open a terminal to check for printed messages
- Enter the recovery by manual
setenv bootargs_android_recovery 'setenv bootargs ${bootargs} init=/init root=/dev/mmcblk0p4 rootfs=ext4 di1_primary'
setenv bootcmd_android_recovery 'run bootargs_android_recovery;mmc read 0 ${loadaddr} 0x800 0x2000;bootm'
run bootcmd_android_recovery
For imx53_SMD board:
setenv bootargs_android_recovery 'setenv bootargs ${bootargs} init=/init root=/dev/mmcblk0p4 rootfs=ext4 video=mxcdi1fb:RGB666,XGA ldb=di1 di1_primary
setenv bootcmd_android_recovery 'run bootargs_android_recovery;mmc read 1 ${loadaddr} 0x800 0x2000;bootm'
run bootcmd_android_recovery
- When system had complete to bootup, You will see this screen:
- You can press "MENU" "HOME" or "F1"(by USB keyboard, for developer)" going to the text menu like this:
![](images/dfpb5q7n_2g9txk6gs_b.jpg)
- Select the required option using the direction keys on the keypad or keyboard.
- Apply sdcard:update.zip, you may update the software from update.zip.
- Wipe data/factory reset. /data and /cache partitions are formatted.
- Wipe cache partition. /cache partition is formatted.
- Reboot the system.
- About system upgrade method:
- copy file and dirs from package to devices(you can use this method upgrade a few of files/dirs.), below is rough step in script.
- format the /system partition if needed (option)
- mount /system partition
- package_extract_dir command to extract system dir in updater.zip to /system/
- change the permissions, since signapk will clean up permission of files, you need set the permission by your self, you can refer the update-script, but maybe you need add some permission if needed.
- umount /system partition.
- use fake_dd command in update-script to dd whole system.img from update.zip to device (New)
- use fake_dd command to dd system.img file in your update.zip to your mmc block device.
- (This is much less script needs to write)
- copy file and dirs from package to devices(you can use this method upgrade a few of files/dirs.), below is rough step in script.
- About Kernel/uramdisk/U-boot upgrade:
- For Nand devices: you can use the write_raw_image() command upgrade your boot.img, like other android system.
- For SD/eMMC devices: you need use fake_dd command to dd your image to your device(written in updater-script.), eg:
-
For uboot upgrade for eMMC storage, since u-boot maybe stored in the "boot partition" of eMMC, you need do some sys file operation before dd, eg:ui_print("extract kernel image...");package_extract_file("files/uImage", "/tmp/uImage");# Write uImage to 1M position.ui_print("writting kernel image");simple_dd("/tmp/uImage", "/dev/block/mmcblk0", 1048576);
ui_print("extract uramdisk image...");package_extract_file("files/uramdisk.img", "/tmp/uramdisk.img");# Write uImage to 1M position.ui_print("writting uramdisk image");simple_dd("/tmp/uramdisk", "/dev/block/mmcblk0", 6291456);show_progress(0.1, 5);
# Write u-boot to 1K position.# u-boot binary should be a no padding uboot!# For eMMC(iNand) device, needs to unlock boot partition.ui_print("writting u-boot...");sysfs_file_write("class/mmc_host/mmc0/mmc0:0001/boot_config", "1");package_extract_file("files/u-boot-no-padding.bin", "/tmp/u-boot-no-padding.bin");simple_dd("/tmp/u-boot-no-padding.bin", "/dev/block/mmcblk0", 1024);sysfs_file_write("class/mmc_host/mmc0/mmc0:0001/boot_config", "8");show_progress(0.1, 5);
- About generate Update.zip.
This section describe about how to generate a Update.zip package.
First, you need prepare a dir like this, eg: ~/update-dir :
Directory / File | Description |
~/update-dir/META-INF | Copy from mydroid/bootable/recovery/etc/META-INF/ |
~/update-dir/META-INF/com/google/android/update-binary | Copy from ~/mydroid/out/target/product/xxx/system/bin/updater, and rename to update-binary, note: this file only can be find here in eng build, can't find in user build. |
~/update-dir/res/ | empty dir, file will be generate by make_update_zip.sh script. |
~/update-dir/files/ | empty is fine, or put some files you want to update, (need add related operation in updater-script) |
~/update-dir/system/ | empty is fine, or put some files you want to update. |
Second, you will find make_update_zip.sh in mydroid/bootable/recovery/ dir, you can use this script to generate update.zip
it take two parameter, first is Meyour android source code path(eg. ~/mydroid) , the second is the your update package dir, like "~/update-dir" in this example.
run script:
$ make_update_zip.sh ~/mydroid ~/update-dir
If success, you will see this message:
"Done"
"Your update.zip is under XXX/update.zip"
if meets any error: it will print some message like:
Error: Your package don't have this file:
META-INF/com/google/android/updater-script
Just follow the Error message to correct your ~/update-dir.
4.5.8 3D Demo
![](images/dc37ttrp_52dswz9ggp_b.png)
![](images/dc37ttrp_53ds6qx4f2_b.png)
![](images/dc37ttrp_54cw52rjfs_b.png)
- The image distortion in the 3D screen shown above is caused by screen capture.
- To disable hardware 2D for UI frameworks (surfaceflinger), use this command:
$ setprop debug.sf.enable_hgl 0
- To disable hardware 2D/3D (use Android software 2D/3D implementation), use this command:
$ setprop debug.egl.hw 0
- To show FPS(frame per second) in LOGCAT, use this command:
$ setprop debug.sf.showfps 1
5. FAQ
5.1 Why did the code fail to download from android.git.linaro.org?
Perhaps because you are behind the firewall. If you have http proxy and your firewall support socks, then take the following steps: * Install Dante - a socks client $ sudo apt-get install dante-client * Configure Dante by adding below lines into /etc/dante.conf route { from: 0.0.0.0/0 to: . via: DNS_OR_IP_OF_YOUR_SOCKS_SERVER port = PORT_OF_YOUR_SOCKS_SERVER proxyprotocol: socks_v5 } resolveprotocol: fake * Set environment variable for http proxy and socks $ export http_proxy=... $ export SOCKS_USER=... $ export SOCKS_PASSWD=... * Download Android code from linaro $ cd myandroid/external $ socksify git clone git://android.git.linaro.org/platform/external/alsa-lib.git $ socksify git clone git://android.git.linaro.org/platform/external/alsa-utils.git $ socksify git clone git://android.git.linaro.org/platform/external/mtd-utils.git $ cd myandroid/hardware $ socksify git clone git://android.git.linaro.org/platform/hardware/alsa_sound.git $ cd myandroid $ socksify git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git kernel_imx $ cd kernel_imx $ git checkout v2.6.35.3 $ cd myandroid/bootable/bootloader $ socksify git clone git://git.denx.de/u-boot.git uboot-imx |
5.2 Why I can't access the internet with browser using ethernet?
It always reports "Web page not available" even if I have directly internet access (not behind a proxy/firewall. Note: Android browser seems not support proxy setup)?DNS setup. For ethernet, the Android does not setup DNS automatically. So DNS must be manually setup. This is not an issue for WiFi since dhcpcd is explicitly called after WiFi access is available.
How to solve/workaround this issue:
In console, input setprop net.dns1 IP_OF_YOUR_PRIMARY_DNS_SERVER. Ping any host with DNS name. If successful, you should be able to use Browser to access any web site now.
5.3 Can I access Android shell using ethernet instead of a serial port?
Yes. On the Linux PC (assume you had built Android code or install Android SDK), complete the following actions:
$ ping IP_OF_YOUR_BOARD (run "netcfg" on board to get IP address)
$ export ADBHOST=IP_OF_YOUR_BOARD "adb" is a host tool created during Android build.It's under out/host/linux-x86/bin/. Make sure you set path properly. $ adb kill-server (not sure why need this step. Just re-start adb daemon on board) $ adb shell # NOW YOU ARE IN ANDROID SHELL ON BOARD |
5.4 How do I change Android boot logo?
If there is a file called initlogo.rle under the root folder, Android displays it while booting. Complete following steps to create a rle compressed picture from a png file.1. Find an image you like
2. Edit it with your favorite editing suite and scale it to 480x640
3. After scaling it, convert the colorspace to 256 colors (8-bit)
4. Save it as a PNG without alpha channel/transparency.
5. Use the convert tool from the ImageMagick toolkit: convert -depth 8 splash.png rgb:splash.raw
6. Compile the Android tool in mydroid/build/tools/rgb2565(gcc -O2 -Wall -Wno-unused-parameter -o rgb2565 to565.c)
7. Run the conversion command: rgb2565 < splash.raw > splash.raw565
8. Copy splash.raw565 to mydroid/out/target/product/imx51_BBG/root/initlogo.rle. make it to zImage ramdisk for nand boot
5.5 How to use wake_lock to control specific devices?
If an application hold a wake_lock, the system will not enter suspend mode. Except turn off LCD, you may want to do more things to control device during the time of holding a wake_lock. For instance, if mp3 player holds the wake_lock called “audioplay”, device drivers can also call register_lock_handle() with the same lock name as parameter, to register one or more device handles dealing with power related operation during early suspend.This is an extension to refine devices control during early suspend.5.6 How to enable Android running on SSD for MX53 TABLET?
- Code changes
- In device/fsl/imx5x/init.rc, change the mmcblk0px strings below the "on fs" lines to sdax.
- Rebuild the ramdisk.img
- Prepare the SSD with images ready
- Using MFG tool
- MFG tool supports TABLET SSD profile to format the SSD device, and flash all the images into it.
- Using fastboot
- Power up the board, and press any key to get into uboot shell
- Set the sata as default fastboot device:
- Using MFG tool
- Run the fastboot mode:
U-Boot > fastboot
- Download image on host side:
-
U-Boot > fastboot flash bootloader images\u-boot-no-padding.bin
U-Boot > fastboot flash kernel images\uImage
U-Boot > fastboot flash uramdisk images\uramdisk.img
U-Boot > fastboot flash system images\system.img
U-Boot > fastboot flash recovery images\recovery.img
U-Boot > fastboot reboot
- Run the fastboot mode:
- Using dd utility
- Export SSD block device to the Linux host
- Use SATA device USB reader to connect SSD to PC
- Or boot the TABLET board with linux, and export the /dev/block/sda device by UMS: echo "dev/block/sda" into /sys/devices/platform/usb_mass_storage/lun0/file
- Create partitions
- Use fdisk to do partition, the same layout as SD/MMC card. And format the /data, /cache partition.
- Write images
- Use dd to download uboot/uImage/uramdisk and system.img, same as what been done on SD/MMC card.
- Export SSD block device to the Linux host
- Using dd utility
- Board boot Dip switch
- SW26, 4/6 on, others off. SW28 all off.
- Bootup the board with SSD connected.
5.7 Why UMS(USB Mass Storage) write Speed downgrade in 2.6.35 kernel when using Windows as Host?
We have been asked why UMS's write speed, eg, copy video from PC to mx5x devices after upgrade kernel version from 2.6.31 to 2.6.35 on WinXP, we have inspect this issue.
It's really not a issue.
It's because of Windows's default U-disk policy is "Optimize for quick remove", this means it will sync every write command to device to ensure in case user unplug the u-disk to avoid damage the U-disk's file system. The sync write operation will cause device side sync it's write operation to SD/eMMC card.
However, Windows also have a policy named "Optmize for performance", it's will faster than previous policy when write. It let device side use memory as cache the write data, it will archive higher write speed, but it will not safe if user un-plug the SD card accidentally.
About how to change the Host(Windows) side policy, please reference this link: http://www.ehow.com/how_4698350_flash-drive-quick-safe-removal.html
However, If you are using a eMMC or other internal storage, You may want to remove this protection, you can edit :kernel_imx/drivers/usb/gadget/f_mass_storage.c
remove this line:
f_mass_storage.c: 890
curlun->filp->f_flags |= O_SYNC;
to disable sync write to storage.
5.8 How to workaround the video quality issue on MX53 TO2.0 silicon
MX53 TO2.0 silicon has issue that causes video quality poor with yellow blocks on the screen when playback some Videos. And we have a Software Workaround which is little dangerous to the silicon. This workaround increases the VPU voltage by increasing the VCC to 1.35V. We did not include this workaround code in the release, and suggest that you wait for TO2.1. Because It will shorten your silicon's life cycle, so please pay attention to this before you decided to do so:
- Increase VCC to 1.35V. Type command into uboot console:
- U-Boot> i2c mw 0x48 0x2f 0x62
- U-Boot> i2c mw 0x48 0x3c 0x62
- Reduce peripheral clocks:
- U-Boot > clk periph 380
- To monitor the impact of chip temperature to this issue, you can check temperature via SATA temperature sensor:
- $ cat /sys/devices/platform/ahci.0/temperature
5.9 How to setup PC (Windows) to support ADB/RNDIS
Before this release, we used HTC's vendor id and product id for all the android gadget functions. It's bad case, so we changed the default android USB gadget functions's VendorID to freescale's 0x15a2, and ProductID to fake ones(after acquiring the offical product id, we will replace them). Due to this change, we must update the PC's USB driver and ADB configuration to enable the android gadget functions:
For Windows PC:
- ADB function
- Download the Android SDK.
- Update the adb configuration to scan for freescale's pid:
- Run the SDK's tools to generate a configure file:
- Modify the files:
-
# ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT.
# USE 'android update adb' TO GENERATE.
# 1 USB VENDOR ID PER LINE.
0x15a2
-
- Unpack the freescale Android USB win driver in the release package tool\android_usb_fsl.zip.
- Connect the Android Device into PC, uninstall your old driver named "Android Phone" in the device manager, then reinstall driver by scanning .inf file under the directory you unpack the android_usb_fsl.zip.
- Restart the adb server
- adb kill-server
- adb start-server
- RNDIS function (USB Tethering)
- Connect your device to PC
- Enable USB tethering in the Android UI
- Settings-> Wireless settings -> Tethering -> USB Tethering
- Settings-> Wireless settings -> Tethering -> USB Tethering
- Install the PC driver by scanning the freescale Android USB driver .inf file in the adb driver directory mentioned above.
- If the Android RNDIS Network driver is ready, you can start to use tether by 3G or WIFI.
- Connect your device to PC
- ADB function
- Download the Android SDK.
- Update the adb configuration to scan for freescale's pid:
- Run the SDK's tools to generate a configure file:
- Modify the files:~/.android/adb_usb.ini, to add freescale vendor id:
# ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT. # USE 'android update adb' TO GENERATE. # 1 USB VENDOR ID PER LINE. 0x15a2 |
- Create a new udev rule file under the PC's /etc/udev/rules.d/ named: imx-android.rules. And fill in the following line into the file:
- Create a new udev rule file under the PC's /etc/udev/rules.d/ named: imx-android.rules. And fill in the following line into the file:
SUBSYSTEM=="usb", SYSFS{idVendor}=="15a2", MODE="0666" |
- Change the new udev rule file's permission:
- Connect the Android Device
- Restart the adb server
- adb kill-server
- adb start-server
In this release, we introduced a new power management feature called eXreme Energy Conservation (XEC). Freescale's XEC is a auto LCD brightness adjuster based on the current display content. It supports to do the LCD brightness adjustment for full screen video playback case and help to reduce the power consumption during such case. If you want to try it, please launch the Settings application, and pop up the dialog by: Settings -> Display -> XEC DLS Control.
- To select [Xec Enabled with Log on Screen] you can enable XEC, and see the current XEC's power result status on the screen.
- To select [Xec Enabled without Log] you can enable XEC without log.
- To select [Xec Disabled] you can disable XEC feature.
We also enable the auto brightness adjustment based on the Ambient light sensor. It's a default function of android, and be supported after Ambient light sensor driver/hal ready.
If you want to try it, please launch the Settings application, and select the auto adjustment checkbox in the brightness option.
NOTE: when you enabled the XEC, please turn off the Ambient light sensor based auto brightness adjustment. Otherwise, they will have conflict to adjust the brightness at the same time.
5.11 How to Change MFGTools partition script for SD/eMMC:
In MFGTool, It will use a script to Partition your SD/eMMC storage, you can find the script under "Profiles\MX5X Linux Update\OS Firmware\mksdcard-android.sh.tar",
the default partition is
SYSTEM_ROM_SIZE=150 -- for /system
DATA_SIZE=100 -- for /data/
CACHE_SIZE=100 -- for /cache
RECOVERY_ROM_SIZE=20 -- for recovery partition.
The other size will be VFAT's (for multimedia), you can change them if you need to change the partition size.
After change the mksdcard-android.sh in inside tar package, you need use
tar cf mksdcard-android.sh.tar mksdcard-android.sh
to generate this package.
Make sure you edit this file under Linux, if you edit it under Windows, it will cause partition failed.
Since UBIFS/NAND use a different partition method, so this guide only for SD/eMMC users.