Android BSP User Guide for mt8395 series 11.0

From ESS-WIKI
Revision as of 10:26, 9 December 2024 by Clayder.huang (talk | contribs)
Jump to: navigation, search

Android BSP Version

Android 11.0

Kernel 4.19.127

Introduction

This document describes how to work with the RISC and ELAA Android 11.0 Board Support Package (BSP) release. The BSP includes bootloaders; the Android Linux kernel and root file system; and tools and documentation to ease the development, deployment, and execution of Android-based systems.

Setup Ubuntu Host Computer

Required equipment and software

  • Ubuntu 18.04 LTS 64bit for Android build host OS
  • 250G bytes free disk spaces for build image

Install Ubuntu

  • IMPORTANT! You must be able to log in as root or use sudo to have root permissions during the installation.

Docker install and setting

If you don't have docker in your system, then you can follow the below  steps to install docker and run it first.

To install Docker Engine on your platform

Please refer to Docker Installation Guide for details

To pull ubuntu 18.04 image from Docker Hub 

$ docker pull advrisc/u18.04-mt8395abv1

Run Docker example

Step1 Run docker container (example)

 $ sudo docker run --privileged -it --name android_R11 -v /home/bsp/android-bsp:/home/adv/BSP:rw advrisc/u18.04-mt8395abv1:latest /bin/bash

Step2 In container, change the user. (example)

 adv@7cc0fa834366:~$ sudo chown adv:adv -R BSP

 

Getting Android Source Code

Related version information:

  • Android 11.0
  • kernel 4.19.127

Step1 : To pull down the Android source tree to your working directory from the repositories as specified in the default manifest

If you will be repo the bsp, you need to add ssh key. (Contact Advantech PM)

$ git config --global user.name "Your Name" 
$ git config --global user.email you@example.com
$ azcopy copy https://riscsw.blob.core.windows.net/bsp/mtk/android-bsp-alps-release-r0.mp6-aiot-v1.81.tar.gz . --recursive
$ tar -zxvf android-bsp-alps-release-r0.mp6-aiot-v1.81.tar.gz
$ mkdir bin
$ cd android-bsp
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ../bin/repo
$ chmod a+x ../bin/repo
$ ../bin/repo init -u https://AIM-Linux@dev.azure.com/AIM-Linux/RISC-MT8395-Android11/_git/android-manifest -b adv_alps-release-r0.mp6-aiot-V1.81 -m [ release_version.xml ]
$ ../bin/repo sync
=== The release_version.xml as follows:
RSB-3810 for default_alps-release-r0.mp6-aiot-V1.81.xml (latest commit) or mt8395AB10034.xml

Building Android 11.0 image for EMMC

If your product is RSB-3810, the product name is rsb3810a1

$PRODUCT = rsb3810a1

Build Instructions

Set up the environment for building. This only configures the current terminal.

$ source build/envsetup.sh

Execute the Android lunch command. In this example, the setup is for the production image of Advantech RISC platfrom device with user type. If you devices is RSB-3810, you will be send command full_mt8395_rsb3810a1-userdebug

$ lunch full_mt8395_$PRODUCT-userdebug

To build all image (Need to build kernel first)

Perform the following command in terminal console

$ make 2>&1 | tee build-log.ext

To build preloader

Perform the following command in terminal console

$ make -j16 preloader

To build lk

Perform the following command in terminal console

$ make -j16 lk

To build kernel

Perform the following command in terminal console

$ make -j16 kernel

To build boot image

Perform the following command in terminal console

$ make -j16 bootimage

To build system image

Perform the following command in terminal console

$ make -j16 systemimage

To build dtbo image

Perform the following command in terminal console

$ make -j16 dtboimage

Output directory: out/target/product/mt8395_$PRODUCT

 

Burning image

1. Get SF Flash Tool V5

\\172.22.31.128\risc$\Platform\MTK\AIoT\SW\Flash_Tool

Supported OS :

  • Windows 7
  • Windows 10
  • Ubuntu 16.x
  • Ubuntu 18.x

2. Connect the usb type A to host computer and device type A port:

2022-11-25 173838.jpg

 

3. Burning image by SF Flash Tool V5:

step 1 You need to download the file and below. File path:out/target/product/mt8395_rsb3810a1

MT8195_Android_scatter.txt
preloader_mt8395_rsb3810a1.bin
vbmeta.img
vbmeta_system.img
vbmeta_vendor.img
spmfw.img
pi_img.img
dpm.img
scp.img
sspm.img
mcupm.img
cam_vpu1.img 
cam_vpu2.img 
cam_vpu3.img
lk.img 
boot.img
dtbo.img
tee.img
logo.bin
super.img
userdata.img

step 2

2022-11-25 174501.jpg

(1) Select the MT8195_Android_scatter.txt file

(2) Select theFormat All + Download

(3) Click the Download button

4. Reboot the device and start to burn all image

5. ADB

Step1 :RSB-3810 Device setting

Setting-->Developer options-->USB debugging to "on"

Step2 :

console:/ $ su
console:/ # setprop service.adb.tcp.port 5555
console:/ # stop adbd
console:/ # start adbd
console:/ # ifconfig

Step3 :adb platform-tools

D:\platform-tools>ping 172.22.28.102
D:\platform-tools>adb connect 172.22.28.102:5555
D:\platform-tools>adb root
D:\platform-tools>adb shell

Debug port

Baudrate: 921600