RISC-V Android
Update history
Date | Version | Author | Update content |
---|---|---|---|
2023-07-27 | v1.1 | ztd |
|
2023-05-08 | v1.0 | wonder |
|
1. Android#
This project is a repository supported by the Android Open Source Project (AOSP), which contains board-level configuration, peripheral HAL layer, kernel, u-boot and pre-compiled component support for the LPi4A board, while the rest of the components can be pulled directly from the upstream AOSP repository.
1.1. Precautions#
The image offered in this document only support basic functions such as HDMI display and Ethernet after compilation. Touch screens and USB peripherals are not supported yet. It is expected to update the SDK and documentation with more complete functions in October.
1.2. Get Started#
Before downloading the source code of Android open source project , please check your working environment , it is recommended to use a Linux system with at least 250G free disk space , 16GB + RAM (Ubuntu 20.04 or later version is recommended ) of the working environment , compilation time and the number of processor cores of the host computer is related to the host computer , it is recommended to use a host computer with more cores . It is recommended to use a host with more cores. Due to the network, the download time may vary greatly depending on the network conditions, and it is recommended to use a proxy to download the source code.
The following data is for reference:
Compiling on a machine with an E5-2699 CPU and 377GB of RAM took about 2 hours (in a docker environment on Ubuntu 22.04). Downloading the source code took about 3 hours.
Download the Android open source project (mainline version) and development board support source code to the working directory, using a fixed version of the upstream code:
Using the latest version of the upstream code may cause some compilation issues due to compatibility:
1.3. Compile Source Code#
Once the download is complete, install some of the dependencies that will be used for compilation:
The system can then be built with the following commands:
After the compilation is complete, check the generated files:
1.4. Burn to LPi4A Development Board#
Use fastboot to burn the system image, for adb and fastboot tools use the version downloaded from here:
https://developer.android.com/tools/releases/platform-tools
Copy the files to be burned to the directory where the fastboot utility is located for use by fastboot:
The development board mainly needs to be connected to the power supply, serial port, USB and display:
The serial port is mainly used for U-boot and kernel command interaction, can be connected through the U0-RX and U0-TX of the GPIO on the board, baud rate is 115200. USB Device interface is mainly used for fastboot and adb tool connection MIPI DSI/HDMI interface can be used to connect the screen to display the UI interface.
To fully burn the system, you need to press and hold the boot button of the development board and press the reset button to enter the boot burning mode. Use the just downloaded fastboot to burn:
A typical burn log is shown below:
When the completion of the burn-in reset power into the system boot mode, you can access the command line of the system through the serial port / ADB, and can interact with the touch screen or external HDMI display system image interface:
1.5. Common Problems#
When compiling with the docker environment, you may encounter the following error:
This error can be ignored for now, and will not affect later compilation steps. If you want to run nsjail, try upgrading the kernel version to 5.XX or pass in these parameters when you start the docker --security-opt apparmor=unconfined --security-opt seccomp=unconfined --security-opt systempaths=unconfined
or --privileged
.
Related Issues not found
Please login GitHub to create issue