From a7c7a4caf5c2b95fd3b16eaa4aec56d4cbc0afa8 Mon Sep 17 00:00:00 2001 From: Alvin Date: Tue, 9 Apr 2024 17:05:12 +0800 Subject: [PATCH] feat: add nio12l format ufs docs and update docs Signed-off-by: Alvin Xie --- .github/CODEOWNERS | 2 + docs/nio/nio12l/format-ufs.md | 54 +++++ docs/nio/nio12l/install-yocto-system.md | 203 ++++++++++++++++- docs/rock3/rock3c/accessories/mipi-dsi.md | 2 +- .../current/nio/nio12l/format-ufs.md | 54 +++++ .../nio/nio12l/install-yocto-system.md | 210 ++++++++++++++++-- 6 files changed, 501 insertions(+), 24 deletions(-) create mode 100644 docs/nio/nio12l/format-ufs.md create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/nio/nio12l/format-ufs.md diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index aa5ba5a78..d7439e022 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -294,3 +294,5 @@ zh/zero/zero/other-os/README.md @CodeChenL en/zero/zero/other-os/android/low-level-dev.md @CodeChenL en/zero/zero/radxa-os/remote-access.md @CodeChenL static/img/rock3/3c/rock3c-8hd-overlay.webp @Radxa-Alvin +docs/nio/nio12l/install-yocto-system.md @Radxa-Alvin +i18n/en/docusaurus-plugin-content-docs/current/nio/nio12l/install-yocto-system.md @Radxa-Alvin diff --git a/docs/nio/nio12l/format-ufs.md b/docs/nio/nio12l/format-ufs.md new file mode 100644 index 000000000..6053ce7aa --- /dev/null +++ b/docs/nio/nio12l/format-ufs.md @@ -0,0 +1,54 @@ +--- +sidebar_position: 3 +--- + +# 格式化UFS + +UFS 格式化工具只能在linux环境下运行,你需要使用 Linux 系统的主机。 + +格式化 UFS 步骤: + +- 在您的主机设备上安装 modemanger API 工具。 + +``` +sudo apt install modemmanger +``` + +- 单击此处下载 [SP Flash Tool](https://dl.radxa.com/nio12l/tools/sp_flash_tool.tar.gz) + +- 解压下载的文件 + +``` +tar zxvf sp_flash_tool.tar.gz +``` + +- 运行以下脚本文件 + +``` +cd /sp_flash_tool +sudo ./format_ufs.sh +``` + +- 按住 download key ,使用 TYPE C 数据线连接 TYPE-C OTG 口和你的 PC,进入烧录模式后会进行格式化 + +- 完成后您将看到以下输出: + +``` +... +Formatting Flash(2)... addr(0x0), len(0x0) +0% of flash has been formatted. +Formatting Flash(2)... addr(0x0), len(0x0) +10% of flash has been formatted. +20% of flash has been formatted. +30% of flash has been formatted. +40% of flash has been formatted. +50% of flash has been formatted. +60% of flash has been formatted. +70% of flash has been formatted. +80% of flash has been formatted. +90% of flash has been formatted. +100% of flash has been formatted. +Format Succeeded. +All command exec done! +Disconnect! +``` diff --git a/docs/nio/nio12l/install-yocto-system.md b/docs/nio/nio12l/install-yocto-system.md index d0581d556..8859ca190 100644 --- a/docs/nio/nio12l/install-yocto-system.md +++ b/docs/nio/nio12l/install-yocto-system.md @@ -4,33 +4,218 @@ sidebar_position: 2 # Yocto系统安装 -## 安装环境配置 +Yocto 系统的烧录需要使用 MTK 提供的 Genio Tools 烧录工具,Genio Tools 包含以下工具: -[Linux 环境配置](https://mediatek.gitlab.io/aiot/doc/aiot-dev-guide/master/sw/yocto/get-started/env-setup/flash-env-linux.html) +- `genio-config` 检查 Linux 或 Windows 主机是否已正确设置 +- `genio-flash` 提供Flash写入功能 +- `genio-board` 允许您以编程方式重置开发板 -[Windows 环境配置](https://mediatek.gitlab.io/aiot/doc/aiot-dev-guide/master/sw/yocto/get-started/env-setup/flash-env-windows.html) +## Genio Tools 环境配置 -## 安装步骤 +## Linux 环境配置 + +### 1. 安装必要软件 + +``` +sudo apt update +sudo apt install git +sudo apt-get install python3 +sudo apt-get install python3-pip +``` + +您可以通过运行以下命令来检查 Python 和 pip 版本: + +``` +$ python3 --version +Python 3.9.2 +$ pip3 --version +pip 21.2.4 from /usr/bin/pip3 (python 3.9) +``` + +如果您的 pip3 版本低于 20.3。请通过运行以下命令进行升级: + +``` +pip3 install --upgrade pip +``` + +### 2. Fstboot 安装 + +``` +sudo apt update +sudo apt-get install android-tools-adb android-tools-fastboot +``` + +如果您使用的是 Ubuntu 以外的 Linux 发行版,请参阅 [Android SDK Platform-Tools](https://developer.android.com/studio/releases/platform-tools) 安装 fastboot。 + +### 3. 配置 USB 设备规则 + +为了让您的主机能够通过 USB 与开发板通信而无需 root 权限,您需要创建一个 udev 规则来授予用户访问您设备的权限: + +``` +$ echo -n 'SUBSYSTEM=="usb", ATTR{idVendor}=="0e8d", ATTR{idProduct}=="201c", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTR{idVendor}=="0e8d", ATTR{idProduct}=="0003", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTR{idVendor}=="0403", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="gpio", MODE="0660", TAG+="uaccess" +' | sudo tee /etc/udev/rules.d/72-aiot.rules + +$ sudo udevadm control --reload-rules + +$ sudo udevadm trigger +``` + +另外,如果您打算使用 adb 连接到开发板,请添加新的 udev 规则并将您的用户帐户添加到 Plugdev 组: + +``` +$ echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="0e8d", ATTR{idProduct}=="201c", MODE="0660", $ GROUP="plugdev"' | sudo tee -a /etc/udev/rules.d/96-rity.rules +$ sudo udevadm control --reload-rules +$ sudo udevadm trigger +$ sudo usermod -a -G plugdev $USER +``` + +udev 是 Linux 内核的设备管理器。它可用于授予用户或组访问设备的权限。在本例中,我们添加了一条 udev 规则,将 Plugdev 组分配给新创建的 SoC USB 设备。为了访问 SoC,您的用户帐户必须是plugdev 组的成员。 + +### 4. Genio Tools 安装 + +``` +$ pip3 install -U genio-tools +``` :::tip -安装系统到UFS之前,UFS需要 [格式化](https://www.ipi.wiki/pages/1200-docs?page=UfsFormat.html) +安装genio-tools后请注销并重新登录。这可确保 PATH 环境变量得到正确更新。 ::: -1. 下载镜像并解压,进入镜像文件夹 +重新登录后,请使用 genio-config 检查您的安装 + +``` +$ genio-config +fastboot: OK +udev rules: OK +``` + +更多信息请参考 [MTK 官方文档](https://mediatek.gitlab.io/aiot/doc/aiot-dev-guide/master/sw/yocto/get-started/env-setup/flash-env-linux.html) + +## Windows 环境配置 + +### 1. 安装 Git + +访问 https://gitforwindows.org/ 下载并安装适用于 Windows 的 git + +安装完成后,打开git bash程序,执行以下配置命令: + +``` +> git config --global http.sslBackend schannel +> git config --global credential.helper manager-core +``` + +这会将 git 配置为使用 Windows 默认凭据和安全连接通道。 + +### 2. 安装 Fastboot 和 ADB 驱动 + +Google USB 驱动程序包含 Windows 上的 `adb` 和 `fastboot` 设备驱动程序。Genio Tools 需要正确安装 fastboot 设备驱动程序。如果使用 rity-demo-image 进行了烧写,adb 就可以用来连接到开发板。 + +需要安装这两个驱动程序: + +- 下载 Google USB 驱动 https://developer.android.com/studio/run/win-usb +- 解压缩下载的 zip 文件。文件名应该类似于 `usb_driver_r13-windows.zip` +- 在解压后的目录中找到该文件 `android_winusb.inf` +- 右键单击文件 `android_winusb.inf` 并从上下文菜单中选择安装 + +详情请参阅 https://developer.android.com/studio/run/oem-usb#InstallingDriver + +在实际连接开发板并进入下载模式之前,可能无法正确检测到 fastboot 设备驱动程序。 您可能需要手动将“未知设备”分配为 Android 引导加载程序设备。 请参考[故障排除](https://mediatek.gitlab.io/aiot/doc/aiot-dev-guide/master/sw/yocto/get-started/flash/flash-troubleshoot-windows.html#missing-yocto-driver) +来执行此操作。 + +### 3. 安装 Fastboot Tool + +- 下载 Windows 版 [SDK Platform-Tools](https://developer.android.com/studio/releases/platform-tools)并解压包 + +- 将解压后的目录添加到PATH环境变量中 + +通过以下命令检查是否正确安装: + +``` +> fastboot --version +fastboot version 34.0.4-10411341 +``` + +版本应大于 34.0.4。 + +### 4. 安装 Python3 + +- 下载并安装 Python 3.9 https://www.python.org/downloads/release/python-3912/. + +:::tip +在 Windows 平台上安装 genio-tools 时报告了 Python 3.10 的已知问题。如果您使用Windows,我们建议您安装Python 3.9。 +::: + +确保pip3的版本大于20.3,并通过pip3安裝必要的包: + +``` +> pip3 --version +pip 21.2.4 from c:\python39\lib\site-packages\pip (python 3.9) +>pip3 install python-certifi-win32 --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host gitlab.com +``` + +安装完成后,将以下环境变量添加到您的Windows系统中: + +``` +> setx REQUESTS_CA_BUNDLE %LOCALAPPDATA%\.certifi\cacert.pem +> set REQUESTS_CA_BUNDLE=%LOCALAPPDATA%\.certifi\cacert.pem +``` + +### 5 安装 Genio Tools + +以管理员身份运行以下命令来安装 Genio Tools: + +``` +> pip3 install -U genio-tools +``` + +:::tip +缺少依赖项 +如果遇到安装错误,例如缺少 `setuptools_scm`,可以先使用以下命令安装软件包: + +``` +> pip3 install wheel setuptools_scm gpiod libusb1 packaging pyserial pyftdi pyusb pyyaml pyparsing enum34 oyaml windows-curses --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host gitlab.com +``` + +然后运行 `​​pip3 install -U genio-tools`。 +::: + +使用以下命令检查是否正确安装: + +``` +> genio-flash --version +1.3.4 +> genio-config +fastboot: OK +``` + +更多信息请参考 [MTK 官方文档](https://mediatek.gitlab.io/aiot/doc/aiot-dev-guide/master/sw/yocto/get-started/env-setup/flash-env-windows.html#install-genio-tools) + +## 镜像烧录步骤 + +:::tip +安装系统到UFS之前,UFS需要 [格式化](nio/nio12l/format-ufs) +::: + +### 1. 下载镜像并解压 - 下载地址:https://github.com/radxa-build/radxa-nio-12l/releases -2. 执行 genio-flash +### 2. 执行 genio-flash - 开启 overlay 可以添加 --load-dtbo 参数, 例如: genio-flash --load-dtbo palmshell-nio12-radxa-display-8hd.dtbo ![install-yocto](/img/nio/nio12l/install-yocto-system.webp) -3. 按住 download key ,使用 TYPE C 数据线连接 TYPE-C OTG 口和你的 PC,开始烧录后可以松开 download key +### 3. 烧录镜像 + +按住 download key ,使用 TYPE C 数据线连接 TYPE-C OTG 口和你的 PC,开始烧录后可以松开 download key :::tip 必须先执行步骤2,再执行步骤3 ::: -# 参考文档 +## 参考文档 [MT8395 (Genio 1200) 开发手册](https://mediatek.gitlab.io/aiot/doc/aiot-dev-guide/master/hw/mt8395-soc.html) diff --git a/docs/rock3/rock3c/accessories/mipi-dsi.md b/docs/rock3/rock3c/accessories/mipi-dsi.md index ee9a6f2cf..0aef69e06 100644 --- a/docs/rock3/rock3c/accessories/mipi-dsi.md +++ b/docs/rock3/rock3c/accessories/mipi-dsi.md @@ -56,4 +56,4 @@ Radxa ROCK 3C 拥有一个 15 PIN 的 CSI 接口,接口定义如下: - Radxa 8HD/Radxa 10HD 有背光无画面输出 -如果使用 Radxa 8HD/Radxa 10HD 出现上电后只有背光没有画面输出的现象,请检查排线和屏幕的 mipi 连接座是否连接正确,次情况多数是由于排线没有接好导致。 +如果使用 Radxa 8HD/Radxa 10HD 出现上电后只有背光没有画面输出的现象,请检查排线和屏幕的 mipi 连接座是否连接正确,此情况多数是由于排线没有接好导致。 diff --git a/i18n/en/docusaurus-plugin-content-docs/current/nio/nio12l/format-ufs.md b/i18n/en/docusaurus-plugin-content-docs/current/nio/nio12l/format-ufs.md new file mode 100644 index 000000000..de68e84ac --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current/nio/nio12l/format-ufs.md @@ -0,0 +1,54 @@ +--- +sidebar_position: 3 +--- + +# Format UFS + +The UFS formatting tool can only be run in a Linux environment. You need to use a Linux PC. + +The steps to follow when formatting the UFS + +- Install the modemanger API tool on your host device. + +``` +sudo apt install modemmanger +``` + +- Download the latest version of SP Flash Tool by [clicking here] (https://dl.radxa.com/nio12l/tools/sp_flash_tool.tar.gz) + +- Unzip the downloaded file. + +``` +tar zxvf sp_flash_tool.tar.gz +``` + +- Run the following script file. + +``` +cd /sp_flash_tool +sudo ./format_ufs.sh +``` + +- Press and hold the download key and use the TYPE C data cable to connect the TYPE-C OTG port and your PC. After entering the burning mode, it will be formatted. + +- When it’s get done you will see the following output: + +``` +... +Formatting Flash(2)... addr(0x0), len(0x0) +0% of flash has been formatted. +Formatting Flash(2)... addr(0x0), len(0x0) +10% of flash has been formatted. +20% of flash has been formatted. +30% of flash has been formatted. +40% of flash has been formatted. +50% of flash has been formatted. +60% of flash has been formatted. +70% of flash has been formatted. +80% of flash has been formatted. +90% of flash has been formatted. +100% of flash has been formatted. +Format Succeeded. +All command exec done! +Disconnect! +``` diff --git a/i18n/en/docusaurus-plugin-content-docs/current/nio/nio12l/install-yocto-system.md b/i18n/en/docusaurus-plugin-content-docs/current/nio/nio12l/install-yocto-system.md index f69e61988..af1f4b12f 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/nio/nio12l/install-yocto-system.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/nio/nio12l/install-yocto-system.md @@ -4,34 +4,216 @@ sidebar_position: 2 # Install Yocto System -## Environment configuration +The burning process of the Yocto system requires the use of the Genio Tools burning tool provided by MTK. Genio Tools include the following tools: -[Linux environment](https://mediatek.gitlab.io/aiot/doc/aiot-dev-guide/master/sw/yocto/get-started/env-setup/flash-env-linux.html) +- `genio-config`: checks whether the Linux or Windows host has been properly configured. +- `genio-flash`: provides flash writing functionality. +- `genio-board`: allows you to reset the development board programmatically. -[Windows environment](https://mediatek.gitlab.io/aiot/doc/aiot-dev-guide/master/sw/yocto/get-started/env-setup/flash-env-windows.html) +## Genio Tools Environment configuration -## Installation Steps +## Linux Environment + +### 1. Install necessary software + +``` +sudo apt update +sudo apt install git +sudo apt-get install python3 +sudo apt-get install python3-pip +``` + +You can check the Python and pip versions by running: + +``` +$ python3 --version +Python 3.9.2 +$ pip3 --version +pip 21.2.4 from /usr/bin/pip3 (python 3.9) +``` + +If your version of pip3 is older than 20.3. Please upgrade it by running: + +``` +pip3 install --upgrade pip +``` + +### 2. Fstboot Install + +``` +sudo apt update +sudo apt-get install android-tools-adb android-tools-fastboot +``` + +Refer to [Android SDK Platform-Tools](https://developer.android.com/studio/releases/platform-tools) to install fastboot if you are using Linux distributions other than Ubuntu. + +### 3. Configure USB Device rules + +In order for your host machine to be able to talk to the board through USB without needing root privileges, you need to create a udev rules that will grant user access to your device: + +``` +$ echo -n 'SUBSYSTEM=="usb", ATTR{idVendor}=="0e8d", ATTR{idProduct}=="201c", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTR{idVendor}=="0e8d", ATTR{idProduct}=="0003", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTR{idVendor}=="0403", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="gpio", MODE="0660", TAG+="uaccess" +' | sudo tee /etc/udev/rules.d/72-aiot.rules + +$ sudo udevadm control --reload-rules + +$ sudo udevadm trigger +``` + +Also, add new udev rule and add your user account to `plugdev` group if you plan to use `adb` to connect to the board: + +``` +$ echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="0e8d", ATTR{idProduct}=="201c", MODE="0660", $ GROUP="plugdev"' | sudo tee -a /etc/udev/rules.d/96-rity.rules +$ sudo udevadm control --reload-rules +$ sudo udevadm trigger +$ sudo usermod -a -G plugdev $USER +``` + +udev is a device manager for the Linux kernel. It can be used to grant an user or a group the permission to access a device. In this case, we added an udev rule to assign plugdev group to the newly created SoC USB device. In order to access the SoC, your user account must be a member of the plugdev group. + +### 4. Genio Tools Install + +``` +$ pip3 install -U genio-tools +``` + +:::tip +Please logout and login again after installing genio-tools. This makes sure the PATH environment variable is being properly updated. +::: + +After re-login, please check your installation with `genio-config`: + +``` +$ genio-config +fastboot: OK +udev rules: OK +``` + +For more information, please refer to the [MTK documentation](https://mediatek.gitlab.io/aiot/doc/aiot-dev-guide/master/sw/yocto/get-started/env-setup/flash-env-linux.html) + +## Windows Environment + +### 1. Install Git + +Visit https://gitforwindows.org/ to download and install git for Windows. + +After installation, open the git bash program and execute the following configuration commands: + +``` +> git config --global http.sslBackend schannel +> git config --global credential.helper manager-core +``` + +This configures git to use Windows default credentials and secure connection channels. + +### 2. Install Fastboot and ADB Device USB Driver + +The Google USB Driver contains both device drivers for `adb` and `fastboot` on Windows. Genio Tools require the fastboot device driver to be properly installed. adb can be used to connect to the board once it has been flashed with rity-demo-image. + +To install these two drivers: + +- Download Google USB Driver from https://developer.android.com/studio/run/win-usb +- Extract the downloaded zip file. The filename should be similar to `usb_driver_r13-windows.zip`. +- In the extracted directory, locate the file `android_winusb.inf` +- Right-click on the file `android_winusb.inf` and select Install from the context menu: + +For details, please refer to https://developer.android.com/studio/run/oem-usb#InstallingDriver + +The fastboot device driver may not be properly detected until you actually connect the board and enter download mode. You might have to manually assign the “Unknown Device” as an Android Bootloader Device. Please refer to the [troubleshooting page](https://mediatek.gitlab.io/aiot/doc/aiot-dev-guide/master/sw/yocto/get-started/flash/flash-troubleshoot-windows.html#missing-yocto-driver) to do so. + +### 3. Install Fastboot Tool + +- Download [SDK Platform-Tools for Windows](https://developer.android.com/studio/releases/platform-tools) and unzip the package +- Add the unzipped directory to `PATH` environment variable + +Check if it is properly installed by following commands: + +``` +> fastboot --version +fastboot version 34.0.4-10411341 +``` + +The version should be greater than 34.0.4. + +### 4. Install Python3 + +- Download and install Python 3.9 from https://www.python.org/downloads/release/python-3912/. + +:::tip +There are known issues reported for Python 3.10 on Windows platform when installing genio-tools. If you use Windows, we recommend you to install Python 3.9. +::: + +Make sure the version of pip3 is greater than 20.3: + +``` +> pip3 --version +pip 21.2.4 from c:\python39\lib\site-packages\pip (python 3.9) +>pip3 install python-certifi-win32 --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host gitlab.com +``` + +After installation, add the following environment variable to your Windows system: + +``` +> setx REQUESTS_CA_BUNDLE %LOCALAPPDATA%\.certifi\cacert.pem +> set REQUESTS_CA_BUNDLE=%LOCALAPPDATA%\.certifi\cacert.pem +``` + +### 5 Install Genio Tools + +Run the following command as administrator to install Genio Tools: + +``` +> pip3 install -U genio-tools +``` + +:::tip +Missing Dependencies +If you encountered installation errors such as missing `setuptools_scm`, you can install the packages first with following commands: + +``` +> pip3 install wheel setuptools_scm gpiod libusb1 packaging pyserial pyftdi pyusb pyyaml pyparsing enum34 oyaml windows-curses --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host gitlab.com +``` + +And then run `​​pip3 install -U genio-tools`。 +::: + +Check if it is properly installed with the following commands: + +``` +> genio-flash --version +1.3.4 +> genio-config +fastboot: OK +``` + +For more information, please refer to [MTK documentation](https://mediatek.gitlab.io/aiot/doc/aiot-dev-guide/master/sw/yocto/get-started/env-setup/flash-env-windows.html#install-genio-tools) + +## Image burning steps :::tip -Before installing the system to the UFS, the UFS needs to be [formatted](https://www.ipi.wiki/pages/1200-docs?page=UfsFormat.html). +Before installing the system to UFS, UFS needs to be [formatted](nio/nio12l/format-ufs) ::: -1. Download the image and unzip it, enter the image folder +### 1. Download the image and unzip it -- Download address:https://github.com/radxa-build/radxa-nio-12l/releases +- Download link:https://github.com/radxa-build/radxa-nio-12l/releases -2. run genio-flash +### 2. Run genio-flash -- Enable overlay need add --load-dtbo parameter, For example: genio-flash --load-dtbo palmshell-nio12-radxa-display-8hd.dtbo +- To enable overlay, you can add the --load-dtbo parameter, for example: genio-flash --load-dtbo palmshell-nio12-radxa-display-8hd.dtbo ![install-yocto](/img/nio/nio12l/install-yocto-system.webp) -3. Press and hold download key,Use the TYPE C data cable to connect the TYPE-C OTG port and your PC,after starting to download, - you can release the download key. +### 3. Burn image + +Press and hold the download key, use the TYPE C data cable to connect the TYPE-C OTG port and your PC, and release the download key after starting to burn. :::tip -Step 2 must be performed first, and then step 3. +Step 2 must be performed first, and then step 3 ::: -# Reference +## Reference documentation -[MT8395(G1200) Dev Guide](https://mediatek.gitlab.io/aiot/doc/aiot-dev-guide/master/hw/mt8395-soc.html) +[MT8395 (Genio 1200) Development manual](https://mediatek.gitlab.io/aiot/doc/aiot-dev-guide/master/hw/mt8395-soc.html)