Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: rock5c add adnroid document (#5) #65

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 5
sidebar_position: 0
---

# 资源下载汇总
Expand All @@ -10,6 +10,8 @@ sidebar_position: 5

- [ROCK 5C Debian 镜像 T2](https://github.com/radxa-build/rock-5c/releases/tag/test-build-2)

- Android12 镜像

## 硬件设计

### V1.1
Expand Down
2 changes: 1 addition & 1 deletion docs/rock5/rock5c/getting-started/install-os.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import Etcher from '../../../common/general/\_etcher.mdx'

## 镜像下载

请到 [资源下载汇总](./download) 下载对应的镜像文件
请到 [资源下载汇总](../download.md) 下载对应的镜像文件

## 安装系统

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sidebar_class_name: hidden

## 镜像下载

请到 [资源下载汇总](../getting-started/download) 下载对应的镜像文件
请到 [资源下载汇总](../download) 下载对应的镜像文件

## 进入 Maskrom 模式

Expand Down
4 changes: 4 additions & 0 deletions docs/rock5/rock5c/other-os/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ sidebar_position: 8
---

# 其他系统

介绍非 Radxa OS 的其他系统,例如 Android

<DocCardList />
9 changes: 9 additions & 0 deletions docs/rock5/rock5c/other-os/android/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
sidebar_position: 7
---

# Android 系统

主要介绍系统如何使用

<DocCardList />
103 changes: 103 additions & 0 deletions docs/rock5/rock5c/other-os/android/install-os.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
sidebar_position: 2
title: 系统安装
---

import Etcher from '../../../../common/general/\_etcher.mdx'

本文档将介绍如何把 Android 镜像安装到 ROCK 5C。

ROCK 5C 可以从 microSD 卡启动,也可以从 EMMC 启动,基于不同的启动方式,安装系统到不同的介质上.

<Tabs queryString="target">

<TabItem value="microsd" label="安装系统到 microSD 卡">

# 安装操作系统

## 准备工作

- 1x microSD 卡(容量 >=16GB,读写速度等级 >= class10)
- 1x microSD 读卡器
- 5V 电源适配器 (推荐使用 [Radxa Power PD30W](../../accessories/pd-30w))

## 镜像下载

请到 [资源下载汇总](../../download) 下载对应的镜像文件

## 安装系统

<Etcher model="rock5c" />

## 启动系统

- 按照上述步骤成功烧录 microSD 卡后,将 microSD 卡插入 Radxa ROCK 5C 的 MicroSD 插槽内。
- Radxa ROCK 5C 的供电接口为 [Type C port](/rock5/rock5c/hardware-design/hardware-interface),请使用 Type-C 线缆连接供电口和适配器。

:::tip
ROCK 5C 支持 9V/2A、12V/2A、15V/2A 和 20V/2A 的 USB Type-C PD 2.0。瑞莎推荐使用 [Radxa Power PD30W](../../accessories/pd-30w)。
:::

## 参考文档

</TabItem>

<TabItem value="emmc" label="安装系统到 eMMC ">

## 准备工作

### 准备安装介质

- micro usb 转 typea usb 接口线缆

### 镜像下载

请到 [资源下载汇总](../../download) 下载对应的镜像文件

## 系统安装

### 系统安装

1. 将micro usb 线缆连接到主机

2. 进入 maskrom 模式

- 断开开发板电源
- 移除 SD 卡,并插入 EMMC 模块
- 用 USB A-A 连接 Radxa ROCK 5C 的 USB3.0 口 和 PC 端
- 使用杜邦线短接 Maskrom Key
- 给开发板上电
- 查看是否有 USB 设备
- Linux/macOS: 检查执行 lsusb 后是否有显示 "Bus 001 Device 112: ID 2207:350a Fuzhou Rockchip Electronics Company"
- Windows: 打开 RKDevTool 您会看到设备处于 "maskrom mode".

<Tabs queryString="target">

<TabItem value="linux/mac" label="Linux/mac">

#### Linux/Mac 系统使用 rkdeveloptool 写入

[rkdeveloptool](../../low-level-dev/rkdeveloptool)

</TabItem>

<TabItem value="windows" label="Windows">

#### Windows 系统使用 rkdevetool 写入

[rkdevtool](/rock5/rock5c/low-level-dev/rkdevtool)

</TabItem>

</Tabs>

## 系统启动

### 启动 ROCK 5C

1. 通过适配器为 ROCK 5C 供电
2. ROCK 5C 将蓝色电源 LED 亮起的情况下启动

</TabItem>

</Tabs>
132 changes: 132 additions & 0 deletions docs/rock5/rock5c/other-os/android/low-level-dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
---
sidebar_position: 4
---

# 底层开发

主要介绍 uboot, kernel, aosp 编译打包等内容

## 环境配置

在 Ubuntu(>=15.04) 上使用OpenJDK

```bash
sudo apt-get update
sudo apt-get install openjdk-8-jdk
```

## 下载 Radxa Android SDK

Radxa Android SDK 包含数百个 Git 仓库,如果不用 repo 逐个下载会非常繁琐。

### Repo

Repo 是 Android 开发中用于管理多个 Git 仓库的工具,它是一个Python脚本,方便开发者对多个 Git 库进行版本控制和管理。

#### 下载 Repo

```bash
$ echo "export REPO_URL='https://storage.googleapis.com/git-repo-downloads/repo'" >> ~/.bashrc
$ source ~/.bashrc
$ curl https://storage.googleapis.com/git-repo-downloads/repo -o /tmp/repo
$ sudo cp /tmp/repo /usr/local/bin/repo
$ sudo chmod +x /usr/local/bin/repo
```

#### 代码下载

```bash
$ repo init -u https://github.com/radxa/manifests.git -b Android12_Radxa_rk14 -m rockchip-s-release.xml
$ repo sync -d --no-tags -j4
```

## 镜像编译

镜像编译可以使用两种方法

### 方法一 (**推荐**)

使用 SDK 编译脚本方式编译

```bash
radxa:rock-android12 $ source build/envsetup.sh
radxa:rock-android12 $ lunch RadxaRock5C-userdebug
radxa:rock-android12 $ ./build.sh -UACKup
# get images from IMAGE directory
```

等待编译完成就可以在 IMAGE 目录找到镜像

### 方法二

可以根据这个方法一步一步编译镜像

1. 设置编译项目的环境

```bash
radxa:rock-android12 $ export PRODUCT_NAME="RadxaRock5C"
radxa:rock-android12 $ export PRODUCT_UBOOT_CONFIG="rk3588"
radxa:rock-android12 $ export PRODUCT_KERNEL_CONFIG="rockchip_defconfig android-11.config rock5c.config"
radxa:rock-android12 $ export PRODUCT_KERNEL_DTS="rk3588s-rock-5c"
```

2. 编译 U-boot

```bash
android12 $ cd u-boot
android12/u-boot $ make clean
android12/u-boot $ make mrproper
android12/u-boot $ make distclean
android12/u-boot $ ./make.sh ${PRODUCT_UBOOT_CONFIG}
android12 $ cd -
```

3. 编译内核

```bash
radxa:rock-android12 $ cd kernel-5.10
radxa:rock-android12/kernel-5.10 $ export PATH=../prebuilts/clang/host/linux-x86/clang-r416183b/bin:$PATH
radxa:rock-android12/kernel-5.10 $ alias msk='make CROSS_COMPILE=aarch64-linux-gnu- LLVM=1 LLVM_IAS=1'
radxa:rock-android12/kernel-5.10 $ msk ARCH=arm64 ${PRODUCT_KERNEL_CONFIG}
radxa:rock-android12/kernel-5.10 $ msk ARCH=arm64 BOOT_IMG=../rockdev/Image-${PRODUCT_NAME}/boot.img ${PRODUCT_KERNEL_DTS}.img

radxa:rock-android12 $ cd -
```

4. 编译AOSP

```bash
android12 $ source build/envsetup.sh
android12 $ lunch ${PRODUCT_NAME}-userdebug
android12 $ make -j$(nproc)
```

5. 制作 Images

```bash
android12 $ rm -rf rockdev
android12 $ ln -s RKTools/linux/Linux_Pack_Firmware/rockdev .
android12 $ ./mkimage.sh
```

6. 打包 Image

```bash
android12 $ cd rockdev
android12/rockdev $ rm -rf Image
android12/rockdev $ ln -s Image-${PRODUCT_NAME} Image
```

- 打包成 RK update 格式镜像

```
radxa:rock-android12/rockdev $ ./mkupdate.sh rk3588 Image
```

在 rockdev/ 目录下生成了 update.img

- 打包成 GPT 格式镜像

```
android12/rockdev $ ./android-gpt.sh
```
47 changes: 47 additions & 0 deletions docs/rock5/rock5c/other-os/android/preparation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
sidebar_position: 1
---

# 准备工作

## 开发准备

<Tabs queryString="target">

<TabItem value="necessary item" label="必要项">

### 供电

:::tip
ROCK 5C 支持 9V/2A、12V/2A、15V/2A 和 20V/2A 的 USB Type-C PD 2.0。瑞莎推荐使用 [Radxa Power PD30W](../../accessories/pd-30w)。
:::

### 存储

microSD /emmc (>=16GB), 用于系统启动盘

### microSD 读卡器

用于制作系统启动盘

</TabItem>

<TabItem value="non essential" label="非必要项">

### 显示

### 网络连接

### Type-C Hub

用于 USB 口接口扩展,可外接类似 USB 鼠标, USB 键盘等设备

### USB 鼠标

### USB 键盘

</TabItem>

</Tabs>

[支持的配件](../../accessories)
Loading
Loading