Raspberry + Android


Raspberry Pi 3 Repository Has Been Added to Android Open Source Project

How to Build an Android TV Box With a Raspberry Pi



Android Things: Raspberry Pi 3


Supported hardware


Raspberry Pi 3 Model B

  • Broadcom BCM2837
  • 1.2GHz quad-core ARM Cortex A53
  • 1GB RAM
  • MicroSD card slot
  • 3.5mm Analog Output
  • 10/100 Ethernet, Wi-Fi 802.11n (2.4GHz), Bluetooth® 4.1
  • 4x USB 2.0 Host

Developer Kits


Get started with kits


Flash Android Things


Before you begin flashing, you will need the following items in addition to your Raspberry Pi:
  • Micro-USB cable
  • Ethernet cable
  • MicroSD card reader and 8 GB or larger microSD card
Download an image from the Android Things Console and write it to the microSD card.

AOSP


android-o-mr1-iot-release-1.0.14

Getting AOSP


Customizing AOSP


creating a new Board Support Package


Device specific configuration is in:

 device/[organisation]/[product]


Build the Code


Select the one you want with command lunch command



$ source build/envsetup.sh
$ lunch [product]-eng

Base product is selected in device configuration by device.mk:

$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk)


Building AOSP



 m
When the build is over, you will find images in out/target/product/[product name]

Kernel


Android runs on top of Linux, you need a Linux kernel with the Android kernel patches.
For Raspberry Pi, use Konsta’s kernel:

$ git clone https://github.com/lineage-rpi/android_kernel_brcm_rpi3 -b lineage-15.1 rpi3
$ cd rpi3
$ make lineageos_rpi3_defconfig
$ make -j $(nproc) zImage
$ make dtbs

Booting the Raspberry Pi


Most Android devices have a bootloader that supports the fastboot protocol for flashing and booting images.
Raspberry Pi does not have such a bootloader.
Therefore, we have to package the kernel and initial ramdisk and use Broadcom loader to start Linux

Boot Partition

The RPi boots from the first partition of the SD card:
  • Bootloader
  • 
    bootcode.bin
    fixup.dat
    fixup_x.dat
    start.elf
    start_x.elf
    config.txt
    
  • Linux
  • 
    cmdline.txt
    bcm2710-rpi-3-b.dtb
    overlays/
    zImage
    
  • Android
  • 
    ramdisk.img
    

ADB


Raspberry Pi only has USB host ports, we can use ADB over Ethernet instead

$ adb connect Android.local
connected to Android.local:5555

References


留言

熱門文章