FlashPreBuildDemo

Prepare Environment

Before flashing the demo, make sure that you have installed the SAM-BA tool on your host computer.

Download Pre-built Demo Packages

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.

Flash Pre-built Demo

There are two types of demo packages:

  • NAND flash based: Android system works on NAND flash
  • SD card based: Android system works on SD card

Nand Flash Based

Connect Device in SamBA Mode To PC

  • Connect a USB cable between the board and PC
  • Connect a serial link between DBGU connector and PC, then open a terminal emulator program on PC
  • Choose the proper procedure depending on your chip
    • Power down the board
    • Check and conform to the Default Jumpers Settings
      • For other boards, please refer to the schematics respectively
    • Warning, important BMS shall be configured to boot from the on-chip Boot ROM
    • Disable NAND Flash chip select
    • Power up the board
    • Verify that the USB connection is established
    • Enable NAND Flash chip select

Flash into Nandflash

After the target is connected to the PC successfully, we can run the batch file (.bat) in the pre-built package to flash the Android demo into Nandflash.

Before doing this we need to enable Nandflash chip select.

  1. Unzip above Nandflash based demo package file
  2. Run the batch file from the unzip folder (*.bat)
  3. Wait for the log file: logfile.log (Opened by notepad.exe). This will take a few minutes. Debug messages can be observed from the DBGU port.
  4. Close the logfile.log (by close the Notepad)

Warning, important NOTE: If anything goes wrong, the logfile.log and the output of DBGU are helpful for you to find what the problems are.

Bootup from Nandflash

After nand flash base demo package has been flashed into your EK board:

  1. Reset target EK board
  2. Wait about 1 minute for android booting up

Warning, important NOTE: If anything goes wrong, the output of DBGU is helpful for you to find where the problems are.

SD Card Based

Generate SD card

We need to use Linux host PC with SD card device to program SD Card based demo.

  1. Unzip the SD Based Demo package.
  2. Copy the demo image file (*.img, for example: Android-2.3.7_r1-sam9m10-sdboot.img) to Linux host
  3. Write image file to SD Card

    For Linux platform you can
    $ dd if=Android-2.3.7_r1-sam9m10-sdboot.img of=/dev/sdb
    Here, we assume the demo image file is in current directory, and /dev/sdb for SD card device node as an example
    Warning, important You need to specify the correct device name, or you may come across the data loss.

    For Windows platform, you can use the tool from https://launchpad.net/win32-image-writer/+download to write the image file to SD Card.

TIP To find out the device node of the SD Card you are using, you could use:

$ mount
before and after you insert your SD card. The newly added device after you insert your SD Card is the device node of your SD Card.

TIP We assume SD Card size is larger than 2GB.

Boot from SD Card

ALERT! As the SD Card is chosen as the boot device, you need to disable all external booting memory

  • Dataflash boot
  • NOR flash boot
  • NAND flash boot
Please refer to schematics for chip select configuration

  1. After the SD Card has been flashed successfully, insert SD card on EK board and power on the system.
  2. Wait about 1 minute for android booting

Warning, important NOTE: If anything goes wrong, the output of DBGU is helpful for you to find what the problems are.

Android Booting

Following pictures show the different stage of Android booting process, this will take a few minutes:

bootup.jpg

Desktop-2.3.5_r1.png


Tip, idea TIPS: If the start screen is the lock screen, you can drag the lock icon to the top to unlock the screen.

Here is an example of boot log which can be received from DBGU:

Start AT91Bootstrap...
Downloading image...
chip id: 0x2caa
Copy 0x300000 bytes from 0x200000 to 0x72000000
Image size: 0x291084, load_addr: 0x70008000, ep: 0x70008000
relocating linux kernel, dst: 0x70008000, src: 0x72000040, len: 0x291084, machid: 0x726
... 0x291084 bytes data transferred!

Starting linux kernel ..., machid: 0x726, tags: 0x70000100

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.39.4 (bshen@test4ip) (gcc version 4.2.0 20070413 (prerelease) (CodeSourcery Sourcery G++ Lite 2007q1-10)) #1 PREEMPT Thu Dec 29 14:13:39 CST 2011
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Atmel AT91SAM9M10G45-EK
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 400 MHz, master 133 MHz, main 12.000 MHz
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
Kernel command line: mem=128M console=ttyS0,115200 mtdparts=nand0:5M(Bootstrap),95M(system),92M(userdata) ubi.mtd=1 ubi.mtd=2 rw root=ubi0:system rootfstype=ubifs init=/init androidboot.console=ttyS0
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 128MB = 128MB total
Memory: 124012k/124012k available, 7060k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffa00000 - 0xffe00000   (   4 MB)
    vmalloc : 0xc8800000 - 0xfee00000   ( 870 MB)
    lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .init : 0xc0008000 - 0xc006a000   ( 392 kB)
      .text : 0xc006a000 - 0xc04e4000   (4584 kB)
      .data : 0xc0504000 - 0xc0536e00   ( 204 kB)
Hierarchical RCU implementation.
        Verbose stalled-CPUs detection is disabled.
NR_IRQS:192
AT91: 160 gpio irqs in 5 banks
Console: colour dummy device 80x30
console [ttyS0] enabled
Calibrating delay loop... 197.63 BogoMIPS (lpj=98816)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
AT91: Power Management
AT91: Starting after software reset
bio: create slab  at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
i2c-gpio i2c-gpio.0: using pins 52 (SDA) and 53 (SCL)
at_hdmac at_hdmac: Atmel AHB DMA Controller ( cpy slave ), 8 channels
Advanced Linux Sound Architecture Driver Version 1.0.23.
cfg80211: Calling CRDA to update world regulatory domain
Switching to clocksource tcb_clksrc
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
hx170dec: dec/pp kernel module. $Revision: 1.11 $ 
hx170dec: supports 8170 and 8190 hardware 
hx170dec: base_port=0x00900000 irq=30
hx170dec: HW ID=0x81701250
hx170dec: Compatible HW found at 0x00900000
hx170dec: module inserted. Major = 253
memalloc: 8190 Linear Memory Allocator, $Revision: 1.11 $ 
memalloc: linear memory base = 0x20000000 
memalloc: allocation method: MEMALLOC_BASIC x 2
memalloc: 235454464 bytes (224MB) configured. Check RAM size!
NetWinder Floating Point Emulator V0.97 (double precision)
ashmem: initialized
JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
msgmni has been set to 242
alg: No test for stdrng (krng)
io scheduler noop registered (default)
atmel_lcdfb atmel_lcdfb.0: 510KiB frame buffer at 77e00000 (mapped at c7e00000)
Console: switching to colour frame buffer device 60x34
atmel_lcdfb atmel_lcdfb.0: fb0: Atmel LCDC at 0x00500000 (mapped at c88c8000), irq 23
atmel_usart.0: ttyS0 at MMIO 0xfeffee00 (irq = 1) is a ATMEL_SERIAL
atmel_usart.2: ttyS2 at MMIO 0xfff90000 (irq = 8) is a ATMEL_SERIAL
brd: module loaded
loop: module loaded
atmel_nand atmel_nand: No DMA support for NAND access.
NAND device: Manufacturer ID: 0x2c, Chip ID: 0xaa (Micron NAND 256MiB 1,8V 8-bit)
Scanning device for bad blocks
Bad eraseblock 1823 at 0x00000e3e0000
Creating 3 MTD partitions on "atmel_nand":
0x000000000000-0x000000500000 : "Bootstrap"
0x000000500000-0x000006400000 : "system"
0x000006400000-0x000010000000 : "userdata"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "system"
UBI: MTD device size:            95 MiB
UBI: number of good PEBs:        760
UBI: number of bad PEBs:         0
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     1
UBI: available PEBs:             17
UBI: total number of reserved PEBs: 743
UBI: number of PEBs reserved for bad PEB handling: 7
UBI: max/mean erase counter: 1/0
UBI: image sequence number: 464214832
UBI: background thread "ubi_bgt0d" started, PID 466
UBI: attaching mtd2 to ubi1
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
UBI: attached mtd2 to ubi1
UBI: MTD device name:            "userdata"
UBI: MTD device size:            156 MiB
UBI: number of good PEBs:        1247
UBI: number of bad PEBs:         1
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     1
UBI: available PEBs:             0
UBI: total number of reserved PEBs: 1247
UBI: number of PEBs reserved for bad PEB handling: 12
UBI: max/mean erase counter: 2/1
UBI: image sequence number: 1548478725
UBI: background thread "ubi_bgt1d" started, PID 469
macb macb: invalid hw address, using random
MACB_mii_bus: probed
eth0: Atmel MACB at 0xfffbc000 irq 25 (92:e1:6a:6e:e0:96)
eth0: attached PHY driver [Davicom DM9161A] (mii_bus:phy_addr=ffffffff:00, irq=-1)
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
atmel-ehci atmel-ehci: Atmel EHCI UHP HS
atmel-ehci atmel-ehci: new USB bus registered, assigned bus number 1
atmel-ehci atmel-ehci: irq 22, io mem 0x00800000
atmel-ehci atmel-ehci: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
at91_ohci at91_ohci: AT91 OHCI
at91_ohci at91_ohci: new USB bus registered, assigned bus number 2
at91_ohci at91_ohci: irq 22, io mem 0x00700000
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver usbserial
usbserial: USB Serial Driver core
atmel_usba_udc atmel_usba_udc: MMIO registers at 0xfff78000 mapped at c88cc000
atmel_usba_udc atmel_usba_udc: FIFO at 0x00600000 mapped at c8e00000
android init
android_probe pdata: c050b3b8
android_bind
android_usb gadget: android_usb ready
f_adb init
android_register_function adb
f_mass_storage init
fsg_probe pdev: c050b098, pdata: c050b3dc
android_register_function usb_mass_storage
android_usb gadget: Mass Storage Function, version: 2009/09/11
android_usb gadget: Number of LUNs=1
 lun0: LUN: removable file: (no medium)
adb_bind_config
mice: PS/2 mouse device common for all mice
input: gpio-keys as /devices/platform/gpio-keys/input/input0
atmel_tsadcc atmel_tsadcc: Master clock is set at: 133333333 Hz
atmel_tsadcc atmel_tsadcc: Prescaler is set at: 82
input: atmel touch screen controller as /devices/platform/atmel_tsadcc/input/input1
using rtc device, at91_rtt, for alarms
rtc-at91sam9 at91_rtt.0: rtc core: registered at91_rtt as rtc0
IR NEC protocol handler initialized
IR RC5(x) protocol handler initialized
IR RC6 protocol handler initialized
IR JVC protocol handler initialized
IR Sony protocol handler initialized
Linux video capture interface: v2.00
atmel_isi atmel_isi: Reading configuration
atmel_isi atmel_isi: video buffer: 614400 bytes at ffaef000 (phys 77500000)
atmel_isi atmel_isi: video buffer: 614400 bytes at ffb85000 (phys 77600000)
atmel_isi atmel_isi: video buffer: 614400 bytes at ffc1b000 (phys 77700000)
atmel_isi atmel_isi: capture buffer: 962560 bytes at ffa04000 (phys 0x77400000)
atmel_isi atmel_isi: Atmel ISI V4L2 device at 0xfffb4000
Battery Status:AC =0
Battery Status:Battery=0
cpuidle: using governor ladder
cpuidle: using governor menu
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
logger: created 64K log 'log_main'
logger: created 256K log 'log_events'
logger: created 64K log 'log_radio'
logger: created 64K log 'log_system'
atmel_ac97c atmel_ac97c.0: Atmel AC97 controller at 0xc8998000, irq = 24
ALSA device list:
  #0: Atmel AC97 controller
TCP cubic registered
NET: Registered protocol family 17
lib80211: common routines for IEEE802.11 drivers
rtc-at91sam9 at91_rtt.0: setting system clock to 1970-01-02 00:47:33 UTC (89253)
atmel_mci atmel_mci.0: Atmel MCI controller at 0xfff80000 irq 11, 1 slots
atmel_mci atmel_mci.1: Atmel MCI controller at 0xfffd0000 irq 29, 1 slots
Warning: unable to open an initial console.
Freeing init memory: 392K
android_usb gadget: high speed config #1: android
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new high speed SDHC card at address d555
mmcblk0: mmc0:d555 SD04G 3.79 GiB 
 mmcblk0:
 p1
UBIFS: mounted UBI device 0, volume 0, name "system"
UBIFS: mounted read-only
UBIFS: file system size:   91478016 bytes (89334 KiB, 87 MiB, 709 LEBs)
UBIFS: journal size:       9033728 bytes (8822 KiB, 8 MiB, 71 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root:  0 bytes (0 KiB)
UBIFS: recovery needed
UBIFS: recovery completed
UBIFS: mounted UBI device 1, volume 0, name "userdata"
UBIFS: file system size:   157280256 bytes (153594 KiB, 149 MiB, 1219 LEBs)
UBIFS: journal size:       9033728 bytes (8822 KiB, 8 MiB, 71 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root:  0 bytes (0 KiB)
init: cannot find '/system/etc/install-recovery.sh', disabling 'flash_recovery'
enabling adb
# adb_open

See also: PlayingWithAndroid, GettingStarted, Requirements

r11 - 11 Apr 2013 - 03:23:10 - 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