Create your own Android Automotive OS for your car on Raspberry Pi

Create your own Android Automotive OS for your car on Raspberry Pi

Android Automotive is an operating system and platform running directly on the in-vehicle hardware. It is a full-stack, open source, highly customizable platform powering the infotainment experience. Android Automotive supports apps built for Android as well as those built for Android Auto. In this article we gonna need a 8GB or 4GB Raspberry model B.

Setting up a build machine and download the code source

Before building any system first we need a linux machine Ubuntu18 or Ubuntu16 with at least 250GB of free disk space and 16?GB of available RAM is required.

First we need to install some additional packages needed

$ sudo apt-get install -y git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig libncurses5 procps libssl-dev bc fdisk ejec

$ sudo apt-get install -y gcc-aarch64-linux-gnut        

also we need to install repo and prepare your environment of build. To prepare this please look at my previous article Trying The Android Open Source Project For The First Time .

Once you have prepare this ! you can start by getting the version of Repo for our case we gonna work with Android 11

$ mkdir android_auto_rpi4 && cd android_auto_rpi4
$ repo init -u https://android.googlesource.com/platform/manifest -b android11-qpr2-release        

After running the repo init we add Android Rpi and RpiAutomotive changes to the build. So to get the modifications we need to add a local manifest to the build which we do by running

$ git clone https://github.com/ayariboudour/automotive_rpi_manifests.git .repo/local_manifests -b main

$ repo sync -c -j4
         

Once the repo sync has completed there are a set of manual modifications you need to do to make it build, take a look at this link.

Build the AAOS

Before starting the build we need to build the kernel


$ ARCH=arm64 scripts/kconfig/merge_config.sh arch/arm64/configs/bcm2711_defconfig kernel/configs/android-base.config kernel/configs/android-recommended.config

$ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make Image.gz

$ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- DTC_FLAGS=”-@” make broadcom/bcm2711-rpi-4-b.dtb

$ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- DTC_FLAGS=”-@” make overlays/vc4-kms-v3d-pi4.dtbo

$ cd ../..        

Then we build the AAOS

$ source build/envsetup.sh
$ lunch rpi_car_rpi4-userdebug
$ make -j4 ramdisk systemimage vendorimage        

Testing and flashing

The partitions should be created using fdisk with sizes and types as follows

 Partitions of the card should be set-up like followings.
  p1  128MB for boot : Do fdisk, set W95 FAT32(LBA) & Bootable type, mkfs.vfat
  p2 2048MB for /system : Do fdisk, new primary partition
  p3  128MB for /vendor : Do fdisk, new primary partition
  p4 remainings for /data : Do fdisk, mkfs.ext4
 Set volume label of /data partition as userdata
  : use -L option for mkfs.ext4, and -n option for mkfs.vfat        

Then write the system & vendor partition

  $ cd out/target/product/rpi
  $ sudo dd if=system.img of=/dev/<p2> bs=1M
  $ sudo dd if=vendor.img of=/dev/<p3> bs=1M        

Copy kernel & ramdisk to boot partition

device/snappautomotive/rpi/boot/* to p1:/

kernel/arpi/arch/arm64/boot/Image.gz to p1:/

kernel/arpi/arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b.dtb to p1:/

kernel/arpi/arch/arm64/boot/dts/overlays/vc4-kms-v3d-pi4.dtbo to p1:/overlays/

out/target/product/rpi/ramdisk.img to p1:/        

Now hopefully you get to run the Android Automotive OS 11 on a Raspberry Pi, If you have any questions please contact me.

References

https://github.com/android-rpi

https://source.android.com/setup/contribute

https://medium.com/snapp-automotive/android-automotive-os-11-on-a-raspberry-pi-2abaa133f468

要查看或添加评论,请登录

Boudour Ayari的更多文章

  • AOSP System customization

    AOSP System customization

    Before we start you need to have the Android source Code already dowloaded and compiled in you machine. To see how to…

  • Use HIDL to create a new virtual HAL

    Use HIDL to create a new virtual HAL

    Introduction HAL interface definition language or HIDL is an interface description language (IDL) to specify the…

    3 条评论
  • Android Automotive

    Android Automotive

    What is Android Automotive ? Android is an open source, Linux based OS, created for a wide array of devices and form…

  • [AOSP] Including Google Aplication Services GAPPS

    [AOSP] Including Google Aplication Services GAPPS

    Introduction If you compile the source code from the Android Open Source Project, you can compile and upload the…

  • Android Boot Process

    Android Boot Process

    Android is a software stack that includes operating system, middle ware, applications for the development of devices…

  • Certification For Android Devices

    Certification For Android Devices

    Android is an operating system (OS) made available by Google under an open source license. It focuses on mobile devices…

  • What is the difference between Android Open Source Project and Linux based systems?

    What is the difference between Android Open Source Project and Linux based systems?

    1. Linux and AOSP Architecture If you look at the architecture of any embedded Linux system, you will always find the…

  • Trying The Android Open Source Project For The First Time

    Trying The Android Open Source Project For The First Time

    The AOSP is an open-source operating system development project maintained by Google. Being open-source, anyone is free…

社区洞察

其他会员也浏览了