Difference between revisions of "Android BSP User Guide for rk3568 series 12"

From ESS-WIKI
Jump to: navigation, search
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<h2>Android BSP Version</h2>
 
  
<p>Android 12.0</p>
+
== Android BSP Version ==
  
<p>Kernel 4.19.206</p>
+
Android 12.0
  
<h2>Build Environment on Host</h2>
+
Kernel 4.19.206
  
<p>Currently, we adopt <a alt="https://www.docker.com/" href="https://www.docker.com/" title="https://www.docker.com/">Docker</a> as build environment.</p>
+
== Build Environment on Host ==
  
<p>You can get the latest version of <a alt="https://hub.docker.com/r/advrisc/u18.04-rk3399abv10" href="https://hub.docker.com/r/advrisc/u18.04-rk3399abv10" title="https://hub.docker.com/r/advrisc/u18.04-rk3399abv10">advrisc/u18.04-rk3399abv10</a> Docker image for developing Rockchip RK3399 and rk3568 projects.</p>
+
Currently, we adopt [https://www.docker.com/ Docker] as build environment.
  
<p>Docker command:</p>
+
You can get the latest version of [https://hub.docker.com/r/advrisc/u18.04-rk3399abv10 advrisc/u18.04-rk3399abv10] Docker image for developing Rockchip RK3399 and rk3568 projects.
  
<pre>
+
Docker command:
docker pull advrisc/u18.04-rk3399abv10:latest;</pre>
+
<pre>docker pull advrisc/u18.04-rk3399abv10:latest;</pre>
  
<h2>Run Docker example</h2>
+
== Run Docker example ==
  
<p>Step1 Run docker container (example)</p>
+
Step1 Run docker container (example)
 
+
<pre>docker run --privileged -it --name android_S12 -v /home/your-name/myandroid:/home/adv/BSP:rw advrisc/u18.04-rk3399abv10 /bin/bash
<pre>
 
docker run --privileged -it --name android_S12 -v /home/your-name/myandroid:/home/adv/BSP:rw advrisc/u18.04-rk3399abv10 /bin/bash
 
 
</pre>
 
</pre>
  
<p>Step2 In container, change the user. (example)</p>
+
Step2 In container, change the user. (example)
  
<p>&nbsp;</p>
+
&nbsp;
 
+
<pre>$ sudo chown adv:adv -R BSP
<pre>
 
$ sudo chown adv:adv -R BSP
 
 
</pre>
 
</pre>
  
<h2>Getting Android Source Code</h2>
+
&nbsp;
  
<pre>
+
== Getting Android Source Code ==
$ cd ~/BSP
+
<pre>$ cd ~/BSP
 
$ sudo git clone https://github.com/ADVANTECH-Rockchip/repo.git
 
$ sudo git clone https://github.com/ADVANTECH-Rockchip/repo.git
$ mkdir rk3568_android_S12
+
$ mkdir rk3568_android_S12-rkr13
$ cd rk3568_android_S12
+
$ cd rk3568_android_S12-rkr13
$ git config --global user.name &amp;amp;quot;Your Name&amp;amp;quot;
+
$ git config --global user.name "Your Name"
 
$ git config --global user.email you@example.com
 
$ git config --global user.email you@example.com
 
$ git config --global http.postBuffer 52428800000
 
$ git config --global http.postBuffer 52428800000
 
$ git config --global http.maxRequestBuffer 100M
 
$ git config --global http.maxRequestBuffer 100M
 
$ git config --global core.compression 0
 
$ git config --global core.compression 0
$ ../repo/repo init -u https://dev.azure.com/AIM-Linux/RISC-RK3568-Android/_git/android-manifest -b rk3568-androidS12 -m RK3568_S12_AIV0001.xml
+
$ ../repo/repo init -u https://dev.azure.com/AIM-Linux/RISC-RK3568-Android/_git/android-manifest -b rk3568-androidS12-rkr13 -m default.xml
------If you want to get the newest code, please use default.xml-----
+
------If you want to get the latest code, please use default.xml------
 +
------If you want to get RSB4810 code, please use RK3568_S12_AIV12017.xml------
 +
------If you want to get ROM5880 code, please use RK3568_S12_AIV12015.xml------
 
$ ../repo/repo sync -c -f --no-clone-bundle -j`nproc`
 
$ ../repo/repo sync -c -f --no-clone-bundle -j`nproc`
 
</pre>
 
</pre>
  
<h2>Getting Prebuilts &nbsp;(must download)</h2>
+
&nbsp;
  
<p><a alt="https://pan.baidu.com/s/1AE84XmoURcAIfDxREH3kww" href="https://pan.baidu.com/s/1AE84XmoURcAIfDxREH3kww" title="https://pan.baidu.com/s/1AE84XmoURcAIfDxREH3kww">prebuilts.tar.gz</a> Key: 1234</p>
+
== Getting Prebuilts &nbsp;(must download) ==
  
<pre>
+
Baidu:[https://pan.baidu.com/s/1jDOMJTM6jTNGqpNdgNKC7w?pwd=1234 prebuilts]&nbsp;Key: 1234&nbsp; &nbsp; DropBox:[https://www.dropbox.com/scl/fi/plwys31je681795kt4fvy/prebuilts-rk3399-AndroidS12-20230518.tar.gz?rlkey=72an8vh184gib5on39opd5msb&dl=0 prebuilts.tar.gz]
Exit docker and copy the file to /home/your-name/myandroid
+
<pre>Exit docker and copy the file to /home/your-name/myandroid
$ cp prebuilts.tar.gz /home/your-name/myandroid/rk3568_android_S12/android
+
$ cp prebuilts.tar.gz /home/your-name/myandroid/rk3568_android_S12-rkr13/android
  
 
In container and Unzip file
 
In container and Unzip file
 
$ docker attach android_S12
 
$ docker attach android_S12
$ tar zxvf ~/BSP/rk3568_android_S12/android/prebuilts.tar.gz
+
$ tar zxvf ~/BSP/rk3568_android_S12-rkr13/android/prebuilts.tar.gz
 
</pre>
 
</pre>
  
<h2>Compile all</h2>
+
== Compile all ==
  
<p>Build RSB-4810 project</p>
+
Build RSB-4810 project
 +
<pre>$ source build/envsetup.sh
 +
$ lunch rsb4810_s-userdebug
 +
$./build.sh -AUCKu</pre>
  
<pre>
+
Build ROM-5880 project
$ source build/envsetup.sh;lunch rsb4810_s-userdebug;
+
<pre>$ source build/envsetup.sh
$./build.sh -AUCKu
+
$ lunch rom5880_s-userdebug;
</pre>
+
$./build.sh -AUCKu</pre>
  
<h2>Build U-boot</h2>
+
== Build U-boot ==
  
<h3>Build RSB-4810 U-boot</h3>
+
=== Build RSB-4810 U-boot ===
 +
<pre>$ cd u-boot
 +
$ ./make.sh rk3568_rsb4810a2</pre>
  
<pre>
+
=== Build ROM-5880 U-boot ===
$ ./make.sh rk3568_rsb4810a2
+
<pre>$ ./make.sh rk3568_rom5880a1</pre>
</pre>
 
  
<h2>Build Kernel</h2>
+
== Build Kernel ==
  
<h3>Build RSB-4810 Kernel</h3>
+
=== Build RSB-4810 Kernel ===
 +
<pre>$ cd kernel-4.19
 +
$ make ARCH=arm64 rk3568_adv_defconfig
 +
$ make ARCH=arm64 rk3568-rsb4810-a2.img -j12</pre>
  
<pre>
+
=== Build RSB-5880 Kernel ===
$ cd kernel-4.19
+
<pre>$ cd kernel-4.19
 
$ make ARCH=arm64 rk3568_adv_defconfig
 
$ make ARCH=arm64 rk3568_adv_defconfig
$ make ARCH=arm64 rk3568-rsb4810-a2.img -j12
+
$ make ARCH=arm64 rk3568-rom5880-a1.img -j12</pre>
</pre>
 
  
<h2>Build Android</h2>
+
== Build Android ==
  
<h3>Build RSB-4810 Android</h3>
+
=== Build RSB-4810 Android ===
 
+
<pre>$ source build/envsetup.sh
<pre>
+
$lunch rsb4810_s-userdebug
$ source build/envsetup.sh;lunch rsb4810_s-userdebug;
 
 
$ ./build.sh -A
 
$ ./build.sh -A
 
</pre>
 
</pre>
  
<p>All image in</p>
+
=== Build RSB-5880 Android ===
 +
<pre>$ source build/envsetup.sh
 +
$ lunch rom5880_s-userdebug;
 +
$ ./build.sh -A</pre>
  
<p>rockdev/Image-rsb4810_s/</p>
+
All image in
  
<p>The common image files are listed below:</p>
+
rockdev/Image-rsb4810_s/
  
<pre>
+
rockdev/Image-rom5880_s/
MiniLoaderAll.bin
+
 
 +
The common image files are listed below:
 +
<pre>MiniLoaderAll.bin
 
baseparameter.img
 
baseparameter.img
 
boot-debug.img
 
boot-debug.img
Line 123: Line 130:
 
</pre>
 
</pre>
  
<h2>How to&nbsp;update images?</h2>
+
&nbsp;
 +
 
 +
== How to&nbsp;update images? ==
 +
 
 +
There are three ways to update images:
  
<p>There are three ways to update images:</p>
+
(The corresponding tools are in the '''RKTools/ '''directory of the source code)
  
<p>(The corresponding tools are in the <b>RKTools/ </b>directory of the source code)</p>
+
=== '''[[Using_AndroidToool_for_NEW|1._Using_AndroidToool.]]''' ===
  
<h3><b><a href="1.%20Using%20AndroidToool.">1._Using_AndroidToool.</a></b></h3>
+
There is no limitation by this way.
  
<p>There is no limitation by this way.</p>
+
=== '''[[2._Using_storage(such_sd_or_USB_disk)with_update.zip_in_it.|2._Using_storage(such&nbsp;sd_or_USB_disk)with_update.zip_in_it.]]''' ===
  
<h3><b><a href="2.%20Using%20storage%EF%BC%88such%20sd%20or%20USB%20disk%EF%BC%89with%20update.zip%20in%20it.">2._Using_storage(such&nbsp;sd_or_USB_disk)with_update.zip_in_it.</a></b></h3>
+
There are some&nbsp;limitations:
  
<p>There are some&nbsp;limitations:</p>
+
(1)The device must be able to boot up to Android system.
  
<p>(1)The device must be able to boot up to Android system.</p>
+
(2)Only update images from the same os,&nbsp; eg&nbsp;:&nbsp;
  
<p>(2)Only update images from the same os,&nbsp; eg&nbsp;:&nbsp;</p>
+
&nbsp; &nbsp; &nbsp; &nbsp; Android12.0 upgrade to Android12.0.
  
<p>&nbsp; &nbsp; &nbsp; &nbsp; Android6.0 upgrade to Android6.0 or&nbsp;Android7.1&nbsp;upgrade to Android7.1.</p>
+
(3)Using update.zip to upgrade.
  
<p>(3)Using update.zip to upgrade. (see more detail in &quot;Create OTA zip&quot; on how to create update.zip)</p>
+
&nbsp; &nbsp; &nbsp; &nbsp; update.zip comes from the rockdev\image in the publishing system image package and is renamed from PRODUCT-NAME-ota-XX.zip
  
<h3><b><a href="3.%20Using%20bootup%20sd%20disk%20made%20by%20SDDiskTool.">3._Using_bootup_sd_disk&nbsp;made_by&nbsp;SDDiskTool.</a></b></h3>
+
=== '''[[Using_bootup_sd_disk_made_by_SDDiskTool_for_new|3._Using_bootup_sd_disk&nbsp;made_by&nbsp;SDDiskTool.]]''' ===
  
<p>(1)Only update images from the same os,&nbsp; eg&nbsp;:&nbsp;</p>
+
(1)Only update images from the same os,&nbsp; eg&nbsp;:&nbsp;
  
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Android6.0 upgrade to Android6.0 or&nbsp;Android7.1&nbsp;upgrade to Android7.1.</p>
+
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Android12.0 upgrade to Android12.0.
  
<p>(2)Using update.img to upgrade.</p>
+
(2)Using update.img to upgrade.

Latest revision as of 05:39, 20 May 2024

Android BSP Version

Android 12.0

Kernel 4.19.206

Build Environment on Host

Currently, we adopt Docker as build environment.

You can get the latest version of advrisc/u18.04-rk3399abv10 Docker image for developing Rockchip RK3399 and rk3568 projects.

Docker command:

docker pull advrisc/u18.04-rk3399abv10:latest;

Run Docker example

Step1 Run docker container (example)

docker run --privileged -it --name android_S12 -v /home/your-name/myandroid:/home/adv/BSP:rw advrisc/u18.04-rk3399abv10 /bin/bash

Step2 In container, change the user. (example)

 

$ sudo chown adv:adv -R BSP

 

Getting Android Source Code

$ cd ~/BSP
$ sudo git clone https://github.com/ADVANTECH-Rockchip/repo.git
$ mkdir rk3568_android_S12-rkr13
$ cd rk3568_android_S12-rkr13
$ git config --global user.name "Your Name"
$ git config --global user.email you@example.com
$ git config --global http.postBuffer 52428800000
$ git config --global http.maxRequestBuffer 100M
$ git config --global core.compression 0
$ ../repo/repo init -u https://dev.azure.com/AIM-Linux/RISC-RK3568-Android/_git/android-manifest -b rk3568-androidS12-rkr13 -m default.xml
------If you want to get the latest code, please use default.xml------
------If you want to get RSB4810 code, please use RK3568_S12_AIV12017.xml------
------If you want to get ROM5880 code, please use RK3568_S12_AIV12015.xml------
$ ../repo/repo sync -c -f --no-clone-bundle -j`nproc`

 

Getting Prebuilts  (must download)

Baidu:prebuilts Key: 1234    DropBox:prebuilts.tar.gz

Exit docker and copy the file to /home/your-name/myandroid
$ cp prebuilts.tar.gz /home/your-name/myandroid/rk3568_android_S12-rkr13/android

In container and Unzip file
$ docker attach android_S12
$ tar zxvf ~/BSP/rk3568_android_S12-rkr13/android/prebuilts.tar.gz

Compile all

Build RSB-4810 project

$ source build/envsetup.sh
$ lunch rsb4810_s-userdebug
$./build.sh -AUCKu

Build ROM-5880 project

$ source build/envsetup.sh
$ lunch rom5880_s-userdebug;
$./build.sh -AUCKu

Build U-boot

Build RSB-4810 U-boot

$ cd u-boot 
$ ./make.sh rk3568_rsb4810a2

Build ROM-5880 U-boot

$ ./make.sh rk3568_rom5880a1

Build Kernel

Build RSB-4810 Kernel

$ cd kernel-4.19
$ make ARCH=arm64 rk3568_adv_defconfig
$ make ARCH=arm64 rk3568-rsb4810-a2.img -j12

Build RSB-5880 Kernel

$ cd kernel-4.19
$ make ARCH=arm64 rk3568_adv_defconfig
$ make ARCH=arm64 rk3568-rom5880-a1.img -j12

Build Android

Build RSB-4810 Android

$ source build/envsetup.sh
$lunch rsb4810_s-userdebug
$ ./build.sh -A

Build RSB-5880 Android

$ source build/envsetup.sh
$ lunch rom5880_s-userdebug;
$ ./build.sh -A

All image in

rockdev/Image-rsb4810_s/

rockdev/Image-rom5880_s/

The common image files are listed below:

MiniLoaderAll.bin
baseparameter.img
boot-debug.img
boot.img
config.cfg
dtbo.img
misc.img
parameter.txt
pcba_small_misc.img
pcba_whole_misc.img
recovery.img
resource.img
super.img
uboot.img
update.img
vbmeta.img

 

How to update images?

There are three ways to update images:

(The corresponding tools are in the RKTools/ directory of the source code)

1._Using_AndroidToool.

There is no limitation by this way.

2._Using_storage(such sd_or_USB_disk)with_update.zip_in_it.

There are some limitations:

(1)The device must be able to boot up to Android system.

(2)Only update images from the same os,  eg : 

        Android12.0 upgrade to Android12.0.

(3)Using update.zip to upgrade.

        update.zip comes from the rockdev\image in the publishing system image package and is renamed from PRODUCT-NAME-ota-XX.zip

3._Using_bootup_sd_disk made_by SDDiskTool.

(1)Only update images from the same os,  eg : 

          Android12.0 upgrade to Android12.0.

(2)Using update.img to upgrade.