Android4SAM v2.1


Demo Package

Demo based on
Android-2.3.7_r1
SAM9M10 MCU SAM9G45 MCU SAM9X5 MCU
Nand Boot 9M10/Nand (~ 46 MB, md5) 9G45/Nand (~ 45 MB, md5) 9X5/Nand (~ 45 MB, md5)
SD Boot 9M10/SD (~ 54 MB, md5) 9G45/SD (~ 53 MB, md5) 9X5/SD (~ 53 MB, md5)

These demo packages can be programmed to corresponding EK boards by using SAM-BA Tool.

Build Process

AT91Bootstrap

Pre-built Binaries

  SAM9M10 MCU SAM9G45 MCU SAM9X5 MCU
Nandflash Booting bootstrap-3.4-sam9m10-nandboot.bin bootstrap-3.4-sam9g45-nandboot.bin bootstrap-3.4-sam9x5-nandboot.bin
SD Card Booting bootstrap-3.4-sam9m10-sdcardboot.bin bootstrap-3.4-sam9g45-sdcardboot.bin bootstrap-3.4-sam9x5-sdcardboot.bin

Load AT91Bootstrap on SAM9 Boards

This section describes how to load AT91Bootstrap into the boot media with SAM-BA.

  • Connect the USB Device Interface to your host machine using the USB Device Cable
  • Make sure that the chip can execute the bootROM monitor SAM-BA-boot
  • Start SAM-BA GUI Application
  • Select the the board in the drop-down menu and choose the USBSerial connection

    samba-2.11.PNG

  • Click connect to start SAM-BA UI
  • In the main SAM-BA window :

    samba-2.11_9x5_PMECC.PNG

  1. Choose the proper media tab (NandFlash) in the SAM-BA GUI interface
  2. Initialize the media choosing the Enable action in the Scripts rolling menu and press Execute
  3. Choose Enable OS PMECC is only for sam9x5 and the default PMECC parameters shall be kept
  4. Choose Send boot file, press Execute
  5. Select the at91bootstrap binary file and press Open ; the media is written down
  6. Close SAM-BA, remove the USB cable

Build AT91Bootstrap

For SD Card Booting

  1. Get the source code of AT91Bootstrap
     $ wget ftp://ftp.linux4sam.org/pub/Android4SAM/v2.1/patches/at91bootstrap-3.4.tar.gz
  2. Decompress the package
     $ tar zxvf at91bootstrap-3.4.tar.gz && cd at91bootstrap-3.4
  3. Configure AT91Bootstrap
     $ make mrproper && make at91sam9m10g45eksd_android_defconfig

    You may need to run
    make menuconfig

    to configure other parameters such as Linux kernel command line.
  4. Build AT91Bootstrap
     $ make CROSS_COMPILE=(path_to_cross-compiler/cross-compiler-prefix-) 
  5. Format one SD Card to FAT32
    
    
  6. Copy binaries/at91sam9m10g45ek-sdcardboot-linux-3.4.bin to SD card and rename it to boot.bin
Warning, important For the board with AT91SAM9G45 MCU
Using the same file with AT91SAM9M10 MCU

Warning, important For the board with AT91SAM9X5 MCU
step 3 will be

 $ make mrproper && make at91sam9x5edsd_android_defconfig .config
Step 6 will be,
Copy binaries/at91sam9x5ek-sdcardboot-linux-3.4.bin to SD card and rename it to boot.bin

Warning, important In Linux environment, you may need to name the booting image as BOOT.BIN

Warning, important In order to boot from SD card, the MCU ROM code has two assumptions,

  • The first partition of the SD Card is formated with FAT or FAT32
  • The bootstrap file shall be named with "boot.bin" and is copied into the first partition

For NandFlash Booting

  1. Get the source code of AT91Bootstrap
     $ wget ftp://ftp.linux4sam.org/pub/Android4SAM/v2.1/patches/at91bootstrap-3.4.tar.gz
  2. Decompress the package
     $ tar zxvf at91bootstrap-3.4.tar.gz && cd at91bootstrap-3.4
  3. Configure AT91Bootstrap
     $ make mrproper && make at91sam9m10g45eknf_android_defconfig
  4. Build AT91Bootstrap
     $ make CROSS_COMPILE=(path_to_cross-compiler/cross-compiler-prefix-) 
  5. The final image can be found as binaries/at91sam9m10g45ek-nandflashboot-linux-3.4.bin
  6. Flash the final image to your EK board, as mentioned above
Warning, important For the board with AT91SAM9G45 MCU
Using the same file with AT91SAM9M10 MCU

Warning, important For the board with AT91SAM9X5 MCU
step 3 will be

 $ make mrproper && make at91sam9x5eknf_android_defconfig
Step 5 will be,
The final image can be found as binaries/at91sam9x5ek-nandflashboot-linux-3.4.bin

Android Root File System

Android root file system consists of Android libraries, Java VM, applications and some configurations, besides the basic root file system components. This page will give you a hands-on introduction on how to build android system and generate a RootFS image.

BuildAndroidSteps

Build Android

Please follow the steps below during the building process:
  1. Get Android source code from Google's git repository.
  2. For the target board, several patches need to be applied.
  3. The final step is to configure the building parameters, and then build it.
Android official web site also provides a guide on how to build from source code, you can reference it from http://source.android.com/source/download.html.

Building Steps

GetAndroid

BuildAndroid

GenerateAndroidImage

Linux Kernel

Introduction

Pre-built images

  SAM9M10 MCU SAM9G45 MCU SAM9X5 MCU
Nandflash Booting linux-2.6.39-sam9m10-nf-uImage linux-2.6.39-sam9g45-nf-uImage linux-2.6.39-sam9x5-nf-uImage
SD Card Booting linux-2.6.39-sam9m10-sd-uImage linux-2.6.39-sam9g45-sd-uImage linux-2.6.39-sam9x5-sd-uImage

Android4SAM pre-built kernel image is included in Android4SAM demo package. It is of U-Boot format.

Download

AT91 Linux Kernel Source

Linux Kernel revision Vanilla Linux Kernel Atmel patch Android kernel patch Android4SAM patch
Linux 2.6.39 linux-2.6.39.tar.bz2 2.6.39-at91-exp.tar.gz linux-2.6.39.diff linux-2.6.39_Android-2.3.7_r1.diff

Warning, important You need to apply the patch from left to right orderly.

Patch Description

Atmel Patch (2.6.39-at91-exp.tar.gz):
  • Support for AT91SAM9x5 family (SAM9G15, SAM9G25, SAM9X25, SAM9G35 and SAM9X35)
  • DMA use on SD/MMC, SSC (I2S) audio, SPI and NAND flash peripherals
  • NAND hardware ECC support using PMECC controller
  • LCD with overlays and 2D acceleration
  • ISI support using Video4Linux2 SoC interface
  • Qtouch touch button
  • CAN bus support for SA

Android4SAM Patch (linux-2.6.39_Android-2.3.7_r1.diff)
  • Add hardware video decoder driver for sam9m10 chip NEW
  • Add ISI driver for camera applicaton NEW
  • Add dummy battery driver which is needed for android
  • Add LCD double buffer driver which is needed for android
  • Modify the NAND flash partition table
  • Modify touchscreen driver to make it more accurate
  • Modify LCD driver to make it not flicker under android
  • Modify button driver to make the button work well under android
  • Add QT1070 button support on 5-Series EK boards

Build

Get and Patch

To get an experimental Android4SAM kernel up and running on an AT91 product, please go through the following steps:

1. Download the corresponding Linux kernel, for example, we use 2.6.39 kernel.

$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.39.tar.bz2
$ tar xvjf linux-2.6.39.tar.bz2

2. Download the ATMEL's patch and apply it

$ wget ftp://ftp.linux4sam.org/pub/Android4SAM/v2.1/patches/2.6.39-at91-exp.tar.gz
$ tar zxvf 2.6.39-at91-exp.tar.gz
$ cd linux-2.6.39
$ for i in ../2.6.39-at91-exp/*; do patch -p1 < $i; done
$ cd ..

3. Download the Android kernel patch and apply it

$ wget ftp://ftp.linux4sam.org/pub/Android4SAM/v2.1/patches/linux-2.6.39.diff
$ cd linux-2.6.39
$ patch -p1 < ../linux-2.6.39.diff
$ cd ..

4. Download Android4SAM patch and apply it

$ wget ftp://ftp.linux4sam.org/pub/Android4SAM/v2.1/patches/linux-2.6.39_Android-2.3.7_r1.diff 
$ cd linux-2.6.39
$ patch -p1 < ../linux-2.6.39_Android-2.3.7_r1.diff 
$ cd ..
You now have an Android4SAM Linux kernel.

Configure and Build Linux Kernel

Now you need to configure the Linux Kernel according to your hardware. We provided a default configuration file in the patchset for you to use.

$ cd linux-2.6.39
$ make mrproper

1. For NAND Flash boot
Warning, important You need to BuildAndroid before this step, and copy mydroid/out/target/product/sam9m10/root (sam9m10 as an example) directory to linux-2.6.39 directory or use prebuilt extract it directly sam9m10-root.tar.gz, sam9g45-root.tar.gz, sam9x5-root.tar.gz

  • For AT91SAM9M10-G45-EK board with SAM9G45 MCU:
    $ make ARCH=arm at91sam9g45_android_ubifs_defconfig 
    

  • For AT91SAM9M10-G45-EK board with SAM9M10 MCU:
    $ make ARCH=arm at91sam9m10_android_ubifs_defconfig 
    

  • For AT91SAM9x5-EK board with SAM9G15, SAM9G35, SAM9X35 MCU:
    $ make ARCH=arm at91sam9x5_android_ubifs_defconfig 
    

2. For SD Card boot

  • For AT91SAM9M10-G45-EK board with SAM9G45 MCU:
    $ make ARCH=arm at91sam9g45_android_sdcard_defconfig 
    

  • For AT91SAM9M10-G45-EK board with SAM9M10 MCU:
    $ make ARCH=arm at91sam9m10_android_sdcard_defconfig 
    

  • For AT91SAM9x5-EK board with SAM9G15, SAM9G35, SAM9x35 MCU:
    $ make ARCH=arm at91sam9x5_android_sdcard_defconfig 
    

3. At this step, you can modify default configuration (Optional)

$ make ARCH=arm menuconfig 

4. And build the Linux kernel image

$ make uImage ARCH=arm  CROSS_COMPILE=<path_to_cross-compiler/cross-compiler-prefix->

After finish successfully, you can find kernel image in: arch/arm/boot/uImage

Warning, important NOTE: Make sure "mkimage" command can be found in your current path, otherwise U-Boot style image cannot be built.


r1 - 05 Aug 2014 - 02:53:31 - VoiceShen
 
Android4SAM

Copyright by the contributing authors. All material on the platform is the property of the contributing authors.

Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions

Atmel and others, are registered trademarks or trademarks of Atmel or its subsidiaries.This site is powered by the TWiki collaboration platform

ARM and others are registered trademarks or trademarks or ARM Ltd. Other terms and product names may be trademarks of others.

Under the terms of the Creative Commons Attribution License

Syndicate this siteRSS ATOM