Android源码编译(6)---选择设备

Selecting Devices

You can create builds for Nexus devices using Android Open Source Project (AOSP) builds and the relevant hardware-specific binaries. For available Android builds and targeted Nexus devices, see Source Code, Tags, and Builds.

Note: Due to hardware differences, do not use Android 4.1.1 on a Nexus 7 originally sold with Android 4.1.2 or newer.

You can also create builds for the HiKey Android reference board (described below). Reference boards are designed to help non-Nexus component vendors develop and port drivers to Android releases. Using a reference board can ease upgrade efforts, reduce time-to-market for new Android devices, lower device costs by enabling ODM/OEMs to choose from a wider range of compatible components, and increase the speed of innovation among component suppliers.

HiKey boards


Google supports HiKey, a certified 96Board, as an Android reference board. AOSP provides kernel source and board support for HiKey to enable developers to easily create and debug new and existing peripheral drivers, do kernel development, and perform other tasks with fewer OEM encumbrances.

HiKey boards are available in 1GB RAM and 2GB RAM configurations from Lenovator:

HiKey board image

Figure 1. HiKey board by Lenovator

Additional resources:

Running Android on HiKey


Use the following commands to download, build, and run Android on a HiKey board.

Compiling userspace

  1. Download the Android source tree:
    $ repo init -u https://android.googlesource.com/platform/manifest -b master
    
    $ repo sync -j24
  2. Download and extract HDMI binaries into the Android source tree:
    $ wget https://dl.google.com/dl/android/aosp/linaro-hikey-20160226-67c37b1a.tgz
    
    $ tar xzf linaro-hikey-20160226-67c37b1a.tgz
    
    $ ./extract-linaro-hikey.sh
  3. Install mcopy utility:
    $ apt-get install mtools
  4. Build:
    $ . ./build/envsetup.sh
    
    $ lunch hikey-userdebug
    
    $ make -j32

Note: For 4GB eMMC, instead of $ make -j32 use: $ make -j32 TARGET_USERDATAIMAGE_4GB=true.

Installing initial fastboot and ptable

  1. Select special bootloader mode by linking J15 1-2 and 3-4 pins (for details, refer to the HiKey User Guide).
  2. Connect USB to PC to get ttyUSB device (ex: /dev/ttyUSB1).
  3. Power the board:
    $ cd device/linaro/hikey/installer
    
    $ ./flash-all.sh /dev/ttyUSB1 [4g]
  4. Remove jumper 3-4 and power the board.

Flashing images

  1. Enter fastboot mode by linking J15 1-2 and 5-6 pins.
  2. Run the following commands:
    $ fastboot flash boot out/target/product/hikey/boot.img
    
    $ fastboot flash -w system out/target/product/hikey/system.img
  3. Remove jumper 5-6 and power the board.

Building the kernel

  1. Run the following commands:
    $ git clone https://android.googlesource.com/kernel/hikey-linaro
    
    $ cd hikey-linaro
    
    $ git checkout -b android-hikey-linaro-4.4 origin/android-hikey-linaro-4.4
    
    $ make ARCH=arm64 hikey_defconfig
    
    $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- -j24
  2. Copy output to the hikey kernel directory (/kernel/hikey-linaro):
    1. Copy hi6220-hikey.dtb (arch/arm64/boot/dts/hisilicon/hi6220-hikey.dtb) to the hikey-kernel directory.
    2. Copy the Image file (arch/arm64/boot/Image-dtb) to the hikey-kernel directory.
    3. Make the boot image:
      $ make bootimage -j24

Setting monitor resolution

Edit device/linaro/hikey/BoardConfig.mk parameter BOARD_KERNEL_CMDLINE and configure the video setting. Example setting for a 24" monitor: video=HDMI-A-1:1280x800@60.

Configuring kernel serial output (uart3)

Set the J2 low speed expansion connector to 1 - Gnd, 11 - Rx, 13 - Tx . For details, refer to the HiKey User Guide).

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Pro Android 5 shows you how to build real-world and fun mobile apps using the Android 5 SDK. This book updates the best-selling Pro Android and covers everything from the fundamentals of building apps for smartphones, tablets, and embedded devices to advanced concepts such as custom components, multi-tasking, sensors/augmented reality, better accessories support and much more., Using the tutorials and expert advice, you'll quickly be able to build cool mobile apps and run them on dozens of Android-based smartphones., You'll explore and use the Android APIs, including those for media and sensors., And you'll check out what's new in Android, including the improved user interface across all Android platforms, integration with services, and more., By reading this definitive tutorial and reference, you'll gain the knowledge and experience to create stunning, cutting-edge Android apps that can make you money, while keeping you agile enough to respond to changes in the future., What you’ll learn, How to use Android to build Java-based mobile apps for Android smartphones and tablets, How to build irresistible user interfaces (UIs) and user experiences (UXs) across Android devices, How to populate your application with data from data sources, using Content Providers, How to build multimedia and game apps using Android's media APIs, How to use Android's location-based services, network-based services, and security, How to use key Android features, such as Fragments and the ActionBar, Who this book is for, This book is for professional software engineers and programmers looking to move their ideas and applications into the mobile space with Android. It assumes a passable understanding of Java, including how to write classes and handle basic inheritance structures.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值