Android Automotive OS 13 on a Raspberry Pi 4

Jan 31, 2023

Jan 31, 2023

Al Sutton

Al Sutton

Nearly two years ago we released details of how to build Android Automotive OS 11 for the Raspberry Pi 4B to give folk a cheap and easy way to run it on actual hardware. Today we’re making AAOS 13 available for the same platform.

Since making the AAOS 11 build available we’ve seen a lot of interest in Raspberry Pi AAOS builds from various groups, and, while we do not feel that the RPi 4B is a good platform for automotive devices, we understand that the development community likes to experiment with ideas, and the RPi4 provides an easy way to do this.

Our AAOS 13 Raspberry Pi build is designed for the development community to work with, and, for now, you will need to build the disk images yourself, and the end result is not a fully functioning product. We are releasing it as a starting point for people to work with, rather than holding it back until it is in a consumer-friendly state. For this reason we recommend using the -eng build variant and a serial console (as discussed in the original AAOS 11 post), to ensure you can debug issues you may encounter.

For AAOS 13 we have altered how we create the build targets to allow folk to place our AAOS build files, and the Android RPi build (on which it’s based), side-by-side. This means there is no need to select one build or the other and allows you to test any updates from the Android RPi project in the same checkout as our AAOS build.

To obtain the source code for the build you will need to perform the following steps, which are also in the README in the repository.

$ sudo apt install meson python3-setuptools
$ repo init -u https://android.googlesource.com/platform/manifest -b android-13.0.0_r52
$ git clone https://github.com/snappautomotive/firmware_rpi-local_manifests .repo/local_manifests -b sa-arpi-13
$ repo sync

The build instructions are available in the README file in the device repository, and consist of these steps;

$ source build/envsetup.sh
$ lunch rpi4_car-eng
$ make ramdisk systemimage vendorimage

This will create the disk images you will need to create a bootable SD card. You will then need to partition the SD card with the following layout using fdisk;

p1 128MB W95 FAT32(LBA) & Bootable
p2 2048MB Linux
p3 1024MB Linux
p4 All remaining space

Once your build has been completed you can write the disk images to p2 and p4 using the following commands;

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

You will also need to create filesystems on p1 and p4 using the following commands;

$ sudo mkfs.vfat /dev/<p1>
$ sudo mkfs.ext4 -L userdata /dev/<p4>

You will then need to mount p1 to copy the boot files to it, you can use the following commands;

$ sudo mount /dev/<p1>

You will then need to build the Android RPi kernel using the instructions available from that group. Once you have built the kernel, you should, from the kernel build directory, run the following commands;

$ sudo cp out/arpi-5.15/dist/Image.gz /mnt
$ sudo cp out/arpi-5.15/dist/bcm2711-rpi-*.dtb /mnt
$ sudo mkdir -p /mnt/overlays
$ sudo cp out/arpi-5.15/dist/vc4-kms-v3d-pi4.dtbo /mnt/overlays

You now have everything you need to boot the SD card, so you should run the following commands;

$ sudo umount /mnt
$ sudo eject /dev/<p>

You can now remove the SD card from your build machine, insert it into your Raspberry Pi 4, and boot AAOS!

Warnings

This is an engineering development build. It can take several minutes for the first boot, so please be patient. If you are in any doubt about the boot process please connect a serial console and check the output before reporting the system as not booting.

Known Issues

The system currently does not have working WiFi.

Sign up to be informed of our updates and blog posts

Sign up to be informed of our updates and blog posts

Sign up to be informed of our updates and blog posts