Booting Android
In this section you will find instructions on various ways to boot Android on the Ventana boards.
4GB USB Flash Drive Pre-Loaded with Android
Developers can get started quickly by purchasing a USB Stick Pre-Loaded with Android 4.3 on the Gateworks Online Shop
Installing Pre-built image onto boot media
You can download a pre-built disk image or build an image yourself from source:
- Pre-Built Android Images
- Installing Gateworks Android Precompiled Binary onto Removable Media
- Building/Installing Android Instructions for the Ventana Family
Boot Devices
The Gateworks Android bootloader script will boot by default from a USB stick, micro-SD, mSata, Flash, in that order (checking for /boot/uImage on the 1st (ext2 in the case of all but Flash) partition) therefore simply powering the board with a storage device created with one of the methods described on this page will boot to Android.
If you are not booting from USB you can change the uboot 'bootdevs' env variable to specify the boot device which can save a few seconds during boot depending on your configuration.
Setting USB Delay
If using a USB flash storage device, some USB storage devices need a longer than typical delay to properly initialize. Please see the following link for setting this delay: Setting USB Delay
Booting from USB OTG (Android Jellybean only)
By default, The Android boot script is configured to boot from a USB Mass Storage device on the EHCI host port and auto-detection of which port was used is not currently possible.
To change the Android USB boot device set the 'usbdevport' env variable in u-boot:
- To boot off fsl-ehci.0 USB_OTG:
setenv usbdevport 0 saveenv boot
- To boot off fsl-ehci.1 USB_EHCI (Standard type-B front-panel host connector):
setenv usbdevport 1 saveenv boot
You do not need to do this when booting from SATA or micro-SD or if using Android KitKat or beyond - the Android boot script will auto-detect
Display Output Selection
The Gateworks Android BSP supports various LVDS touchscreen displays as well as HDMI output and Dual-Display by mirroring the two.
The Gateworks bootloader will display a splash-screen on boot based on the panel env variable. The bootloader splash will be a Gateworks logo for the most recent bootloader or a Linux tux for earlier bootloader versions. If you wish to disable the bootloader splash you can set this to none. See ventana/bootloader for more details.
The Gateworks bootloader will configure display timings and the Gateworks Android bootloader script will configure kernel parameters for specific displays based on the display bootloader env variable. This can be one of the following:
- Hannstar-XGA (for 10" 1024x768 Freescale MXC-LVDS1 display with a egalax touch controller at i2c 0x04)
- AUO-G070VW01 (for 7" 800x480 display with a tsc2007 touch controller at i2c 0x49)
- DLC700JMGT4 - 7in WSVGA (1024x600) with capacitive multitouch touchscreen - not detected (must be assigned manually - see below)
- HDMI (for HDMI display - set the hdmi env variable to 480p, 720p, 1080p to specific the specific resolution)
Examples:
- 1080p HDMI display with bootloader splash:
setenv panel HDMI setenv display HDMI setenv hdmi 1080p saveenv
- 720p HDMI display without bootloader splash:
setenv panel none setenv display HDMI setenv hdmi 720p saveenv
- Freescale MCIMX-LVDS1 10" XGA Touchscreen Display with bootloader splash:
setenv panel Hannstar-XGA setenv display Hannstar-XGA saveenv
- Gateworks GW17029 DLC700JMGT4 7" WSVGA Touchscreen Display with bootloader splash:
setenv panel DLC700JMGT4 setenv display DLC700JMGT4 saveenv
- Gateworks GW17039 DLC800FIGT3 8" XGA Touchscreen Display with bootloader splash:
setenv panel DLC800FIGT3 setenv display DLC800FIGT3 saveenv
HDMI Resolutions Supported
The mxc_hdmi driver by default supports the following progressive CEA modes:
- #1: 640x480p@59.94/60Hz 4:3
- #2: 720x480p@59.94/60Hz 4:3
- #3: 720x480p@59.94/60Hz 16:9
- #4: 1280x720p@59.94/60Hz 16:9
- #8: 720(1440)x240pH@59.94/60Hz 4:3
- #9: 720(1440)x240pH@59.94/60Hz 16:9
- #14: 1440x480p@59.94/60Hz 4:3
- #15: 1440x480p@59.94/60Hz 16:9
- #16: 1920x1080p@60Hz 16:9
- #17: 720x576pH@50Hz 4:3
- #18: 720x576pH@50Hz 16:9
- #19: 1280x720p@50Hz
- #23: 720(1440)x288pH@50Hz 4:3
- #24: 720(1440)x288pH@50Hz 16:9
- #29: 720(1440)x576pH@50Hz 4:3
- #30: 720(1440)x576pH@50Hz 16:9
- #31: 1920x1080p@50Hz
- #32: 1920x1080p@23.98/24Hz
- #33: 1920x1080p@25Hz
- #34: 1920x1080p@30Hz
- #41: 1280x720p@100Hz 16:9
- #47: 1280x720p@119.88/120Hz 16:9
Out of the above list of supported modes only those present in the monitor's Extended Display Identification Data (EDID) are considered.
If your monitor supports a non-CEA mode or mode not listed above you can set the only_cea=0 kernel commandline parameter to allow it, however you may find that this disables HDMI audio output. This can be set in the bootloader for example:
setenv extra 'mxc_hdmi.only_cea=0'
saveenv
The default mode is specified in the kernel device-tree (for example, here for the GW52xx) as '1920x1080M@60' for 1080p@60Hz. This can be overridden with a video= kernel parameter (see above). For example, if you monitor is defaulting to 1920x1080p@60Hz and you want it instead to be 1680x1050@59Hz from a matching mode of 'D:1680x1050p-59' in /sys/class/graphics/fb0/modes you could use:
setenv video 'video=mxcfb0:dev=hdmi,1680x1050M@59 video=mxcfb1:off' saveenv
Note that the Android BSP has a bootloader script which will set the kernel commandline (unless the video bootloader env variable is set to override it). The script will use the hdmi env variable (and defaults to 1080p if not set) to determine the resolution and use this for HDMI if an HDMI monitor is connected at bootup. For example:
- specify 720p
setenv video # make sure video var is blank for auto-configuration to work setenv hdmi 720p # set to 1280x720M@60 saveenv
- specify 1080p
setenv video # make sure video var is blank for auto-configuration to work setenv hdmi 1080p # set to 1920x1080M@60 saveenv
Note that if you specify a video mode that the monitor's EDID does not support (or supports per the EDID but doesn't appear in /sys/class/graphics/fb0/modes because only_cea=1) the mxc_hdmi driver will try to find the nearest supported resolution to what you specified.
Once booted, you can see the list of available video modes via /sys/class/graphics:
- see current video mode:
# cat /sys/class/graphics/fb0/mode D:1680x1050p-59
- see available modes:
# cat /sys/class/graphics/fb0/modes S:1280x1024p-60 S:1152x864p-75 V:1280x1024p-75 V:1024x768p-75 V:1024x768p-60 V:800x600p-75 V:800x600p-60 V:640x480p-75 V:640x480p-60 U:720x400p-70 D:1680x1050p-59 V:640x480p-60
- 'S' refers to an EDID 'Standard Timing' in EDID
- 'V' refers to a VESA mode from 'Established Timings' in EDID
- 'D' refers to the 'Detailed mode' in EDID (which should be the monitors preferred or native mode)
- change the resolution (must provide a mode matching those show from modes):
echo "V:1024x768p-60" > /sys/class/graphics/fb0/mode
Dual Display (Mirrored Display)
To mirror the Android OS to both HDMI and LVDS displays you can set the display env variable to multiple options described above.
The Android OS will use the resolution of the first display specified therefore you should typically specify the LVDS display first and HDMI after if you have a lower resolution LVDS display than the HDMI monitor. In this case the HDMI monitor will show a letter-boxed display of what is present on the LVDS touch-screen. The bootloader does not support dual-display so if you want to show the bootloader splashscreen you must specify one display argument.
Examples:
- Freescale MCIMX-LVDS1 10" XGA Touchscreen Display and a standard 1080p HDMI monitor with bootloader splash on LVDS:
setenv panel Hannstar-XGA setenv display "Hannstar-XGA HDMI" setenv hdmi 1080p saveenv
Serial Console
When using Android 5.x (Lollipop) serial console "input" is disabled by default as a requirement for passing Android Certification Test Suite (CTS). To use serial console input you must disable selinux by adding the 'androidboot.selinux=disabled' to the kernel command line. You can do this by using the extra env variable in the bootloader as such:
setenv extra 'androidboot.selinux=disabled'; saveenv
Memory Requirements
Android on Gateworks Ventana boards requires 512MB of DRAM but 1GB+ is highly recommended. In low memory situations you will find that tasks are constantly being killed and re-started and/or are slow to start.
A certain amount of DRAM is carved out using the Linux Contiguous Memory Allocator (CMA) for VPU and GPU based on the amount of system memory available. This is done automatically by the Android boot scripts based on the mem_mb U-Boot env variable.
Please ensure you have a bootloader built from 2015 or later to ensure the mem_mb env variable is set automatically by the bootloader.
You can override the allocation manually if you desire however it is not clear what the overall effect would be if you limit this beyond the Freescale recommended values. See the bootloader script for examples.
References:
- https://source.android.com/devices/tech/low-ram.html
- Freescale IMX6 Android release notes
Booting Tips
Once booted you will likely want to disable the screen-blanking right away (as there is no 'power button' configured to wake the device).
To do this for Android Jellybean 4.3 / KitKat 4.4.3:
- Launch 'Settings' application
- Select 'Developer options' menu and select 'Stay awake'
- if you are using a 'user' build you need to head to 'Settings' -> 'About tablet' and click on 'Build number' 6 times to enable the 'Settings' -> 'Developer options' menu.
While you are also in settings you probably also want to:
- enable USB debugging: Developer options -> USB debugging (if you want to use adb over a USB OTG cable to a host PC)
- enable installing apps from unknown sources: Security -> Unknown sources (to allow installation of apps from unknown sources if you want to sideload apps)
- disable auto-rotate screen: Accessibility -> System: Auto-rotate screen
Troubleshooting
Android may have issues booting up if there is no video source connected or the video source has not been defined in the bootloader. Please confirm that the bootloader has been configured for the proper display device.
Boot Speed / Speeding Up
It typically requires 30 to 40 seconds to boot to the lock screen but to achieve this you need to do a bit of uboot environment tuning (such as setting bootdevs to just your boot device, minimizing or eliminating bootdelay, and disabling kernel console):
- See Wiki Page -> Boot Speed Wiki Page </ul