Skip to content

Commit

Permalink
Merge pull request #536 from wu-yue-yu/main
Browse files Browse the repository at this point in the history
Update doc and fix error
  • Loading branch information
wonderfullook authored Sep 15, 2023
2 parents a6a46e7 + 1af5bc6 commit 8a10d99
Show file tree
Hide file tree
Showing 14 changed files with 1,358 additions and 47 deletions.
19 changes: 9 additions & 10 deletions docs/hardware/en/lichee/th1520/lpi4a/3_images.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ The relevant files are in the `20230803_tempfix.zip` compressed package.
(images of 0721 and later versions can be used normally, no need to replace it with the file here)

```shell
sudo ./fastboot flash ram ./images/u-boot-with-spl-ddr16g.bin
sudo ./fastboot flash ram ./images/u-boot-with-spl-lpi4a-16g.bin
sudo ./fastboot reboot
sleep 1
sudo ./fastboot flash uboot ./images/u-boot-with-spl-ddr16g.bin
sudo ./fastboot flash ram ./images/u-boot-with-spl-lpi4a-16g.bin
# If there is no device tree corresponding to 16G ddr in the boot.ext4 you use, you need to burn the boot.ext4 corresponding to 16G ddr
sudo ./fastboot flash boot ./images/boot_16gddr.ext4
sudo ./fastboot flash boot ./images/boot.ext4
```

### Debian
Expand All @@ -57,9 +57,9 @@ Download Links:
Mega Cloud Storage:[click me](https://mega.nz/folder/phoQlBTZ#cZeQ3qZ__pDvP94PT3_bGA)
ISCAS mirror: [click me](https://mirror.iscas.ac.cn/revyos/extra/images/lpi4a/)

1. LPI4A_20230721.zip
1. LPI4A_20230912.zip

- Release date: July 21, 2023
- Release date: September 12, 2023
- Kernel: 5.10
- Root file system: ext4, 4.3GB
- Main pre-installed packages:
Expand All @@ -76,11 +76,11 @@ ISCAS mirror: [click me](https://mirror.iscas.ac.cn/revyos/extra/images/lpi4a/)
- There is a problem with the sound quality of HDMI audio playing under chromium
- Instructions for use:
- This zip file only supports HDMI display, when burning, please note that the suffix in the file name corresponds to the relevant parameters of the device.
- boot, 8gddr/16gddr in the u-boot file name corresponds to 8g/16g memory respectively.
- u-boot with 16g suffix is u-boot that supports 16g memory, without suffix is u-boot that supports 8g memory.

2. LPI4A_20230721_mipi.zip
2. LPI4A_20230912_MIPI.zip

- Release date: July 21, 2023
- Release date: September 12, 2023
- Kernel: 5.10
- Root file system: ext4, 4.3GB
- Main pre-installed packages:
Expand All @@ -102,8 +102,7 @@ ISCAS mirror: [click me](https://mirror.iscas.ac.cn/revyos/extra/images/lpi4a/)
- There is a problem with the sound quality of HDMI audio playing under chromium
- Instructions for use:
- This zip file is the image of the MIPI screen, please note that the suffix in the file name corresponds to the relevant parameters of the device when burning.
- 8gddr/16gddr in the boot and u-boot file names correspond to 8g/16g memory respectively.
- mipi_720p/mipi_1080p in the boot file name corresponds to 800x1280 MIPI screen (with touch)/1200x1920 mipi screen respectively.
- u-boot with 16g suffix is u-boot that supports 16g memory, without suffix is u-boot that supports 8g memory.

<!-- 1. LPi4A_Test_0425
1. Release date: April 25, 2023
Expand Down
16 changes: 8 additions & 8 deletions docs/hardware/en/lichee/th1520/lpi4a/4_burn_image.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,20 @@ After putting the board into burning mode, you can use fastboot from `burn_tool.
Let´s take linux as an example:
Note that you need to mark the fastboot binary as executable first via `chmod +x fastboot`

`u-boot-with-spl-ddr8g.bin` and `u-boot-with-spl-ddr16g.bin` are u-boot firmware, please refer to the image description for specific differences.
`u-boot-with-spl-lpi4a.bin` and `u-boot-with-spl-lpi4a-16g.bin` are u-boot firmware, please refer to the image description for specific differences.
```bash
sudo ./fastboot flash ram ./images/u-boot-with-spl-ddr16g.bin
sudo ./fastboot flash ram ./images/u-boot-with-spl-lpi4a-16g.bin
sudo ./fastboot reboot
sleep 10
sudo ./fastboot flash uboot ./images/u-boot-with-spl-ddr16g.bin
sudo ./fastboot flash boot ./images/boot_16gddr.ext4
sudo ./fastboot flash root ./images/rootfs-thead-image-linux_sing.ext4.ext4
sleep 1
sudo ./fastboot flash uboot ./images/u-boot-with-spl-lpi4a-16g.bin
sudo ./fastboot flash boot ./images/boot_sing.ext4
sudo ./fastboot flash root ./images/rootfs-sing.ext4
```

The first three lines will check and create the partitions on the flash. If you skip this step,
burning the rootfs will be very slow later on.

`boot_8gddr.ext4`, `boot_8gddr_mipi_720p.ext4`, `boot_8gddr_mipi_1080p.ext4`, `boot_16gddr.ext4`, `boot_16gddr_mipi_720p.ext4` and `boot_16gddr_mipi_1080p.ext4` for boot For specific differences, please refer to the image description. They mainly include the following:
`boot-sing.ext4` and `boot-dual.ext4` for boot For specific differences, please refer to the image description. They mainly include the following:
```bash
fw_dynamic.bin #opensbi
Image #kernel image
Expand All @@ -131,7 +131,7 @@ light-lpi4a.dtb # ddr8G dtb
light-lpi4a-ddr16g.dtb # ddr16G dtb
```

`rootfs-thead-image-linux_sing.ext4` and `rootfs-thead-image-linux_mipi.ext4` are the root file system, and the default is Debian system. For the specific differences between the two, please refer to the image description.
`rootfs-sing.ext4` and `rootfs-mipi.ext4` are the root file system, and the default is Debian system. For the specific differences between the two, please refer to the image description.

Log output you typically see while burning an image:

Expand Down
72 changes: 69 additions & 3 deletions docs/hardware/en/lichee/th1520/lpi4a/6_peripheral.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
title: Peripheral Use
keywords: Linux, Lichee, TH1520, SBC, RISCV, Peripheral
update:
- date: 2023-09-12
version: v1.3
author: ztd
content:
- Update NPU user guide
- date: 2023-08-18
version: v1.2
author: ztd
Expand Down Expand Up @@ -698,15 +703,15 @@ echo "Start Play"
You can also use alsa-related tools, such as `alsamixer`, to do things like volume adjustments.
## HDMI
## HDMI Audio
> Note: HDMI audio does not work for earlier mirrors, please upgrade to a newer version to enable HDMI audio function.
Tap the speaker icon at the top right corner of the screen to enter Audio mixer, you can see the interface below:
![audiomixer](./../../../../zh/lichee/th1520/lpi4a/assets/peripheral/audiomixer.png)
The name of the device is Build-in Audio, i.e. HDMI audio, and you can switch between audio devices by clicking on its corresponding green checkmark icon in this interface, or you can switch between devices by clicking on the small speaker icon directly.
The name of the device is **Built-in Audio**, i.e. HDMI audio, and you can switch between audio devices by clicking on its corresponding green checkmark icon in this interface, or you can switch between devices by clicking on the small speaker icon directly.
If you confirm that the connection is correct and the HDMI monitor you are using supports HDMI audio, but you do not see the corresponding device in the device list, you can try to run the following command:
```shell
Expand Down Expand Up @@ -865,7 +870,68 @@ When playing video with Chromium browser, the state of GPU is as follows:
## NPU
TODO
> **Note**: To use the NPU driver, you need to upgrade to the [20230912](https://mega.nz/folder/phoQlBTZ#cZeQ3qZ__pDvP94PT3_bGA) version image.
NPU-related driver initialization commands
```shell
sudo npu_init
```
LicheePi4A contains a 1GHz NPU supporting 4TOPS@INT8 general purpose NNA computing power. The Wiki contains examples of NPU support as follows:
|Example Name|Example Functionality|Usage Model|Interface|HHB Version|
|---|---|---|---|---|
|Mobilenetv2 do image classification|image classification|mobilenetv2|c/c++|2.4 and above|
|YOLOv5 do object detection|object detection|YOLOv5|python|2.4 and above|
|RTMPose do pose estimation|pose estimation|RTMPose|python|2.6 and above|
In order to cross-compile the models in the above examples into executables on LicheePi4A, we first need to set up the HHB development environment on our own computer.
> Recommended environment: Ubuntu 20.04 system, Docker version 20.10.21.It is recommended to use the Docker image to set up the environment.
### Installation
First, we need to install Docker on our own computer. Uninstall any existing Docker version:
```shell
sudo apt-get remove docker docker-engine docker.io containerd runc
```
Install the basic software Docker depends on:
```shell
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
Add the official source: ```shell
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
```
Install Docker:
```shell
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
```
After installation, get the Docker image of the HHB environment:
```shell
docker pull hhb4tools/hhb:2.4.5
```
Once the image is pulled, enter the Docker image using the following command:
```shell
docker run -itd --name=your.hhb2.4 -p 22 "hhb4tools/hhb:2.4.5"
docker exec -it your.hhb2.4 /bin/bash
```
Once you are inside the Docker image, you can use the following command to verify the HHB version:
```shell
hhb --version
```
Once you are in the Docker image, you need to configure the cross-compile environment. Note that you must use the toolchain here, otherwise the compiled binaries will not run on LicheePi4A.
```shell
export PATH=/tools/Xuantie-900-gcc-linux-5.10.4-glibc-x86_64-V2.6.1-light.1/bin/:$PATH
```
At this point, the HHB environment is preliminarily built. You can try the following NPU examples:
[Mobilenetv2 for image classification](https://wiki.sipeed.com/hardware/eh/lichee/th1520/lpi4a/8_application.html#MobilenertV2)
[YOLOv5 for object detection](https://wiki.sipeed.com/hardware/eh/lichee/th1520/lpi4a/8_application.html#Yolov5n)
## Other
Contributions are welcome~ You can get ¥5~150 ($1~20) coupon if your contribution is accepted!
4 changes: 3 additions & 1 deletion docs/hardware/en/lichee/th1520/lpi4a/7_develop_android.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ update:

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.

> Note that the project is still in the early stage, the current AOSP on Licheepi 4A is not stable and the functionality is not yet complete. A stable version with improved functionality will be updated later, so please keep an eye on this document for updates.
### 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.**

### Get Started

Expand Down
Loading

0 comments on commit 8a10d99

Please sign in to comment.