A20 Android Build Misc Settings

In here I will document a few things on how to make changes to the Android build so that you can customise your own build.


The language settings are located in the following location


You can change the following lines to suit which langauge you want to show on first boot. The original was Chinese.

persist.sys.timezone=Asia/Bangkok \
persist.sys.language=en \
persist.sys.country=UK \

You’ll need to do a quick search on Google for the different options. Here, I’ve chosen English and UK with Asia/Bangkok as the timezone offset.

Note that there are other options in this file. I have simply chosen only to show the language and timezone here.

ADB Secure

You may noticed that everytime you connect the USB for debugging, you have to click on OK to allow your computer to connect. This is easily sorted with the following setting in this same file.


The default is 1 for secure so set this to 0 (zero) to allow you to connect without any prompt. I see no real advantage of this as anyone who wants ADB access can simply click OK on the device!!


This file is placed in the bootloader and is setup by editing the sys_config.fex file located in the tools for the Linux kernel.

This file is critical to setup all the IO for the A20 processor and I have put a working version here for you to download. It is configured for SD but is easily changed to NAND as I will explain below.

sys_config.fex (not longer available. Check out the main source for this now)

Power Start

Open this file and locate in the [target] section the following:

power_start=1       #1 means boot on applying power, 0 means power up and go to standby

With the 0 option you have to press the power button to bring the unit on if you are also using a battery.

With the 1 option, the unit will go a full boot after it has been powered off but note that you can’t use the quick boot. I couldn’t get it to boot with this setting.

Storage Type

The following entry determines the storage type and is mainly used for Phoenixsuit to determine where to write the image. It does seem to have any other use as on boot the system will look first in SD and then in NAND for a boot partition. This is good because it means you can have a working system in NAND and do development from SD without affecting the original installation.

storage_type=1          #1 - SD, 0 - NAND, -1 seems to indicate use SD if present and NAND if not.


You can add additional serial ports to the image by changing the following. These are brought out to the GPIO connectors. See schematic for details of which pins.

uart_used = 1
uart_port = 3
uart_type = 4
uart_tx = port:PG06<4><1><default><default>
uart_rx = port:PG07<4><1><default><default>
uart_rts = port:PG08<4><1><default><default>
uart_cts = port:PG09<4><1><default><default>
uart_used = 1
uart_port = 4
uart_type = 2
uart_tx = port:PG10<4><1><default><default>
uart_rx = port:PG11<4><1><default><default>
uart_used = 1
uart_port = 5
uart_type = 2
uart_tx = port:PI10<4><1><default><default>
uart_rx = port:PI11<4><1><default><default>

I’ve enabled 3, 4 and 5 in the configuration file you can download. You can easily disable these by changing the uart_used to 0.


At present, none of the SPI ports are enabled in the script as no device on the board currently uses SPI. They are brought out to the UEXT connectors so if you need to use SPI, then you can enable them otherwise, they can be used as GPIO pins.

Battery Capacity

The default setting in [pmu_para] is 2700 but in my case I am using a 6600mA battery so I changed this.

pmu_battery_cap = 6600



30 comments on “A20 Android Build Misc Settings

  1. Thanks for posting your experience.

    Do I need a serial cable to monitor your debug infos? I have the board only connected by OTG USB. I tried to call “adb -d logcat”, but it just waits for the device and nothing happens.
    Do you get a white or pink screen?

  2. Hi Henno, sorry for the late reply. Been hard at work on this problem as can see from the updates. The serial cable is very handy and you only need 1 for all your work. I’d certainly recommend you get one as it shows you stuff during the boot cycle and when flashing.

    The adb call will only work once Android has fully booted and hopefully now that I sorted the issues, people can get far enough to test it.

  3. Pingback: Build Options | My Android Exploits

    • Sorry for the late reply. I just saw this and must have missed the notification.

      You don’t need any driver to use GPIO. You can do this direct from within Android via a JNI. All I had to do was ensure that you export the GPIO pins in the init.sun7i.rc file and made them available to user space. Have a look in the source I made available fort the GPIO initialisation to see how I did this. If you need a JNI to work with this, I have one you can adapt that does both GPIO and I2C. I’ll sort out the files and stick them up on the blog this week.

  4. Hi

    I m getting following error while packing

    dragon image.cfg sys_partition.fex [Failed]

    refer to out / pack.log for detail information.

    ERROR:. Packing Failed

    • Hi, did you run the “extract-bsp” command to copy the Linux images to Android?

      Are you running pack from the Android directory?

      Can you post the last few lines from the pack.log file?

  5. yeah i did run “extract-bsp” its copied something
    and “make -j4” given some errors as follows.

    BEGIN failed–compilation aborted at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
    make: *** [out/target/product/olinuxino-a20/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/html/DocTypeStrings.cpp] Error 2
    make: *** Waiting for unfinished jobs….
    make: *** [out/target/product/olinuxino-a20/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/platform/ColorData.cpp] Error 2

    by ignoring those errors, i am running “pack”
    thats giving error as follows

    cp /home/lokesh/android1/olimex-a20/lichee/out/android/common/u-boot.bin bootfs/linux/ [OK]
    script sys_config.fex [OK]
    script sys_partition.fex [OK]
    update_mbr sys_partition.bin 4 [OK]
    update_boot0 boot0_nand.bin sys_config.bin NAND [OK]
    update_boot0 boot0_sdcard.fex sys_config.bin SDMMC_CARD [OK]
    update_boot1 boot1_nand.fex sys_config.bin NAND [Uncheck]
    update_boot1 boot1_sdcard.fex sys_config.bin SDMMC_CARD [Uncheck]
    fsbuild bootfs.ini split_xxxx.fex [OK]
    dragon image.cfg sys_partition.fex [Failed]

    refer to out/pack.log for detail information.

    ERROR: Packing Failed.

  6. thank you for your blog..
    by following above steps I have successfully compiled the kernel source, i have my imge file “sun7i_android_olinuxino-a20.img” located at the folder /home/android/android1/olimex-a20/lichee/tools/pack/

    Now my problem is

    I am unable to load the “sun7i_android_olinuxino-a20.img” file to the NAND/SD card.

    when i connected my alwinner a20 board to windows pc, phoenix suite detects the board. when i press the upgrade button to upgrade “sun7i_android_olinuxino-a20.img ” immedietely device gets disconneted.

    I am not encountering this problem when i am going to upgrade other “xxxxx.img” file.

    please suggest any solution…

    thank you

  7. thank you for you blog..
    I am trying to compile android with sun7ismp_android_defconfig.
    But when I try to build it, I am getting an error:
    “Please build buildroot first”

    Thanks for your help..

  8. hi dave, can you help me regarding how to make changes in the settings.apk via code, eg if i want to enable/disable gps or if i want the battery options to show…
    any suggestions?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s