Merge pull request #614 from SinKy-Yan/main

update
This commit is contained in:
Caize Wu
2024-01-31 14:31:11 +08:00
committed by GitHub
31 changed files with 505 additions and 1 deletions

View File

@@ -0,0 +1,81 @@
---
title: LicheeRV Nano
keywords: riscv, licheerv,nano
---
## Introduction
The LicheeRV Nano is a mini-sized development board (measuring only 22.86*35.56mm), equipped with the SG2002 processor. It features a powerful core running at 1GHz (RISC-V/ARM options available) and a smaller core at 700MHz RISC-V, along with 256MB DDR3 memory, and an integrated 1Tops NPU. The board includes a wealth of interfaces such as MIPI-CSI, MIPI-DSI, SDIO, ETH, USB, SPI, UART, I2C, etc., allowing for the expansion of a wide variety of applications. Its through-hole/half-hole design facilitates easy mass production and soldering.
![](./../assets/RV_Nano/intro/RV_Nano_1.jpg)
## Specifications
| Item | Specification |
| ------------------- | ------------------------------------------------------------ |
| CPU | SOPHGO SG2002; <br>Major core: 1GHz RISC-V C906 / ARM A53 (selectable); <br>Minor core: 700MHz RISC-V C906;<br>Low-power core: 25300M 8051 |
| NPU | 1TOPS INT8, supports BF16 |
| Memory | Integrated 2Gbit (256MByte) DDR3 |
| Storage | Bootable from either TF card / SD NAND (SD NAND pads under TF card slot) |
| Video Interface | Video Output: 2 lane MIPI DSI output, standard 31pin interface, supports 6pin capacitive touchscreen <br>Video Input: 4 lane MIPI CSI input, 22Pin interface, supports dual CSI split |
| Audio Interface | Audio Output: Onboard PA amplifier, can directly connect speakers under 1W <br>Audio Input: Onboard analog silicon microphone, capable of direct sound reception |
| Wired Connection | E suffix version supports 100M RJ45 connector |
| Wireless Connection | W suffix version supports 2.4G / 5.8G dual-band WiFi6 + BLE5.4 |
| USB | 1 x USB2.0 OTG Type-C |
| IO Interface | 2 x 14pin 2.54 pin headers, 800mil spacing, breadboard-friendly |
| Buttons | 1 x RST button + 1 x BOOT button |
| LEDs | 1 x Power LED, 1 x User LED |
| Operating System | Buildroot Linux / Debian |
| Dimensions | 22.86*35.56mm |
![](./../assets/RV_Nano/intro/RV_Nano_3.jpg)
![](./../assets/RV_Nano/intro/RV_Nano_4.jpg)
## Version Comparison
| **Specification** | **Basic System** | **Microphone/Speaker** | **Ethernet** | **WiFi6/BT5** |
| :------------------: | :--------------: | :--------------------: | :----------: | :-----------: |
| **LicheeRV-Nano-B** | Yes | Yes | No | No |
| **LicheeRV-Nano-E** | Yes | Yes | Yes | No |
| **LicheeRV-Nano-W** | Yes | Yes | No | Yes |
| **LicheeRV-Nano-WE** | Yes | Yes | Yes | Yes |
## Hardware Resources
Datasheets, schematic diagrams, dimension drawings, and more can be found here: [Click Here](http://cn.dl.sipeed.com/shareURL/LICHEE/LicheeRV_Nano)
- [Board Specification](http://cn.dl.sipeed.com/shareURL/LICHEE/LicheeRV_Nano/01_Specification)
- [Board Schematic](http://cn.dl.sipeed.com/shareURL/LICHEE/LicheeRV_Nano/02_Schematic)
- [Board Designator Drawing](http://cn.dl.sipeed.com/shareURL/LICHEE/LicheeRV_Nano/03_Designator_drawing)
- [Board Dimensional Drawing](http://cn.dl.sipeed.com/shareURL/LICHEE/LicheeRV_Nano/04_Mechanical_drawing)
- [3D Model Files](http://cn.dl.sipeed.com/shareURL/LICHEE/LicheeRV_Nano/06_3D_file)
- [Core Board Packaging](http://cn.dl.sipeed.com/shareURL/LICHEE/LicheeRV_Nano/05_PCB_Lib)
- [Board Chip Information](http://cn.dl.sipeed.com/shareURL/LICHEE/LicheeRV_Nano)
- http://cn.dl.sipeed.com/shareURL/LICHEE/LicheeRV_Nano/07_Datasheet)
## Software Resources
- [SDK LicheeRV-Nano-Build](https://github.com/sipeed/LicheeRV-Nano-Build)
## SOPHGO Resources Summary
- [Datasheet](https://github.com/sophgo/sophgo-doc/releases)
- [Compiler Toolchain Download](https://sophon-file.sophon.cn/sophon-prod-s3/drive/23/03/07/16/host-tools.tar.gz)
- [Software SDK Download](https://github.com/sophgo/cvi_mmf_sdk)
- [SDK Development Documentation Summary](https://developer.sophgo.com/thread/471.html)
- [HDK Development Documentation Summary](https://developer.sophgo.com/thread/472.html)
- [TPU SDK Development Resources Summary](https://developer.sophgo.com/thread/473.html)
- [TDL SDK Development Guide: (Provides common AI model algorithms, application packaging based on TPU SDK)](https://doc.sophgo.com/cvitek-develop-docs/master/docs_latest_release/CV180x_CV181x/zh/01.software/TPU/TDL_SDK_Software_Development_Guide/build/TDLSDKSoftwareDevelopmentGuide_zh.pdf)
- [TDL SDK Development Resources Summary](https://developer.sophgo.com/thread/473.html)
- https://developer.sophgo.com/thread/556.html)
- Precautions
- The beta version hardware (70405) NPU only supports operation at 0.5T, running at 1.0T does not guarantee the stability of the board.
- The WIFI of the beta version hardware (70405) has not been fully optimized yet, resulting in lower speeds. We appreciate your understanding.
- If purchasing a camera accessory or the WE version package, screws, soldering pillars, and a screwdriver are included in the package. To avoid burns during soldering, please refer to the [Camera & WE Ethernet Module Installation Guide](https://wiki.sipeed.com/hardware/zh/lichee/RV_Nano/2_unbox.html).
- If purchasing 3-inch, 4-inch, or 10.1-inch screen accessories, a screen adapter board and ribbon cable are included in the package. Please refer to the [Screen Installation Guide](https://wiki.sipeed.com/hardware/zh/lichee/RV_Nano/2_unbox.html)

View File

@@ -0,0 +1,115 @@
---
title: Unbox
keywords: riscv, licheerv,nano
---
## LicheeRV Nano Package Introduction
The LicheeRV Nano is available in four versions based on networking capabilities:
- **Standard Version (B)**: Comes without any networking accessories.
- **Ethernet Version (E)**: Features an onboard 100M Ethernet port for wired network connections.
- **WiFi Version (W)**: Equipped with an onboard WiFi6/BT5.2 module. By default, the BT5.2 functionality is not enabled. To activate Bluetooth capabilities, it's necessary to solder four 0201 resistors in the specified location or use a 2B pencil to create a short circuit in the designated area.
![](./../assets/RV_Nano/unbox/BLE_RES.jpg)
+ The WiFi Ethernet (WE) version features an onboard WiFi 6/BT 5.2 module and comes with an Ethernet module that connects to the development board via standoffs and ribbon cables.
We also offer the following accessory:
- Camera![](./../assets/RV_Nano/unbox/Camera.jpg)
+ The camera (model 3754) features non-short-circuiting screw holes on both sides for secure mounting. It is recommended to fix the standoffs to the fifth pad for optimal stability.
![](./../assets/RV_Nano/unbox/Camera-5.jpg)
+ 3-inch Display Screen
![](./../assets/RV_Nano/unbox/3inch.jpg)
- The display features a resolution of 480*845 and supports touch functionality. The package includes a touch screen adapter board and a ribbon cable for easy integration.
- 5-inch Display Screen
![](./../assets/RV_Nano/unbox/5inch.jpg)
- This display boasts a resolution of 480*845 and does not support touch functionality. The ribbon cable can be directly connected to the LicheeRV Nano 31Pin screen interface for seamless integration.
- 7-inch Display Screen
![](./../assets/RV_Nano/unbox/7inch.jpg)
- The display features a resolution of 800*1280 and supports touch functionality. The ribbon cable can be directly connected to both the LicheeRV Nano 31Pin screen interface and the 6Pin touch interface, ensuring easy setup and integration.
- 10-inch Display Screen
![](./../assets/RV_Nano/unbox/10inch.jpg)
------
- The display features a resolution of 800*1280 and supports touch functionality. The package includes a touch adapter board and a ribbon cable for easy setup. The screen ribbon cable can be directly connected to the LicheeRV Nano 31Pin screen interface, ensuring seamless integration.
- Raspberry Pi Camera Adapter Ribbon Cable (Coming Soon)
![](./../assets/RV_Nano/unbox/1.jpg)
------
- Raspberry Pi Standard 15Pin Camera to LicheeRV 22Pin CSI Camera Interface Adapter
+ 1. Installation Guide
### Installing the WE Module
- Soldering the Ribbon Cable
1. Solder the ribbon cable following the direction shown in the diagram below.
![](./../assets/RV_Nano/unbox/WE1.jpg)
2. Use a Multimeter to Test for Continuity
![](./../assets/RV_Nano/unbox/WE2.jpg)
●Securing the Standoffs
1. To avoid burns while soldering the standoffs, you can first screw them onto the Ethernet module.![](./../assets/RV_Nano/unbox/WE3.jpg)
2.Insert the standoff into the fifth pad. It is advisable to apply solder paste to the pad beforehand to enhance the stability of the standoff after soldering.
![](./../assets/RV_Nano/unbox/WE4.jpg)
3.Use a soldering iron from the bottom side to solder.
![](./../assets/RV_Nano/unbox/WE5.jpg)
+ Assembly
1. Insert the ribbon cable into the FPC connector of the Ethernet module and secure it.
![](./../assets/RV_Nano/unbox/WE6.jpg)
1. Secure the Ethernet module to the standoffs using screws.
![](./../assets/RV_Nano/unbox/WE7.jpg)
### Installing the Camera
- Securing the Standoffs
1. Similar to the method mentioned above: first, screw the standoffs and screws onto the camera module.
![](./../assets/RV_Nano/unbox/CAM1.jpg)
2.Insert the standoff into the fifth pad. To enhance the stability of the standoff after soldering, it is recommended to apply solder paste to the pad beforehand.
![](./../assets/RV_Nano/unbox/CAM2.jpg)
3.Solder from the bottom side using a soldering iron.
![](./../assets/RV_Nano/unbox/CAM3.jpg)
+ Assembly
1. Connect the camera ribbon cable as shown in the diagram below.
![](./../assets/RV_Nano/unbox/CAM4.jpg)
2.Secure with screws.
![](./../assets/RV_Nano/unbox/CAM5.jpg)

View File

@@ -0,0 +1,11 @@
# Image Format
The image is compressed using xz. After decompression, use tools like Rufus, Win32 Disk Imager, or dd to write it to an SD card.
## Images Based on the Official SDK
[Download here](https://github.com/sipeed/LicheeRV-Nano-Build/releases)
## Images Based on the Mainline Buildroot SDK (WORK-IN-PROGRESS)
[Download here](https://github.com/0x754C/sipeed-toolchain/releases)

View File

@@ -0,0 +1,28 @@
---
title: Flashing image
keywords: riscv, licheerv,nano
---
# Image Format
The image is compressed using xz. After decompression, use Rufus, Win32 Disk Imager, or dd to write it to an SD card.
## Linux
```
curl -O https://github.com/sipeed/LicheeRV-Nano-Build/releases/download/20240124/licheervnano-20230124.img.xz
# Replace sdX with your SD card's device node
xzcat https://github.com/sipeed/LicheeRV-Nano-Build/releases/download/20240124/licheervnano-20230124.img.xz | dd of=/dev/sdX conv=sync
```
## Windows
Use 7zip for extraction:
https://www.7-zip.org/download.html
Use Rufus or Win32 Disk Imager to write to the SD card:
https://rufus.ie/
https://sourceforge.net/projects/win32diskimager/

View File

@@ -0,0 +1,253 @@
---
title: Peripheral
keywords: riscv, licheerv,nano
---
# Pinout
![](./../assets/RV_Nano/intro/RV_Nano_3.jpg)
## Connecting to the Board
### UART0
Connect the UART port to the board at:
A17 A16 GND
Then use terminal software to connect to the serial port, with a baud rate of 115200.
### USB CDC ACM Serial Port
When the board's USB Type-C port is connected to a computer, it will provide a USB CDC ACM serial port device (provided by Linux gadget).
Linux:
```
# Replace /dev/ttyACMX with the specific device, depending on your computer
picocom -b 9600 /dev/ttyACMX
```
Windows:
Press Win + R, enter devmgmt.msc, and press Enter.
Find the new device's serial port number under the serial port devices.
Then use PuTTY or HyperTerminal to connect.
### USB RNDIS Network Port
When the board's USB Type-C port is connected to a computer, it will provide a USB RNDIS network card device (provided by Linux gadget).
The PC will automatically obtain an address using DHCP.
Replace the last digit of the automatically obtained IPv4 address with 1 to get the board's IPv4 address:
```
10.44.55.66 PC's IPv4 address
10.44.55.1 Board's IPv4 address
```
Then use ssh to connect: `ssh root@board's IP address`
Username: root
Password: cvitek
### Ethernet Connection
Connect the Ethernet cable to the board; the board will automatically obtain an address using DHCP upon boot.
The board's image defaults to enabling the MDNS service.
Use the command:
```
avahi-browse -art | grep lpirvnano
```
to list devices in the broadcast domain with lpirvnano in their domain names.
Then use:
```
ssh root@lpirvnano-XXXX.local
```
to connect to the board.
## Disabling the Boot Demo of the Image
```
# Clear rc.local
echo '#!/bin/sh' > /etc/rc.local
# Reboot
reboot
```
## Audio
The LicheeRV Nano supports recording and playback. Standard ALSA tools can be used for recording, playback, and other operations.
### Recording
First, set the microphone volume, range: 0-24
```shell
amixer -Dhw:0 cset name='ADC Capture Volume' 24
```
After setting, start recording:
```shell
arecord -Dhw:0,0 -d 3 -r 48000 -f S16_LE -t wav test.wav & > /dev/null &
```
### Playback
```shell
./aplay -D hw:1,0 -f S16_LE test.wav
```
## I2C
I2C1 and I2C3 are brought out on the pin header, and devices can be connected to them.
Before using, you need to correctly set the PINMUX:
```
shell# I2C1
devmem 0x030010D0 32 0x2
devmem 0x030010DC 32 0x2
# I2C3
devmem 0x030010E4 32 0x2
devmem 0x030010E0 32 0x2
```
Then you can use i2c-tools to operate the i2c peripherals. The image is already pre-installed.
## ADC
An ADC route is brought out on the pin header, using ADC1.
First, select the ADC channel, here taking ADC1 as an example:
```shell
echo 1 > /sys/class/cvi-saradc/cvi-saradc0/device/cv_saradc
```
Read the value of ADC1:
```shell
cat /sys/class/cvi-saradc/cvi-saradc0/device/cv_saradc
```
## LCD
Connect the screen's ribbon cable to the board's MIPI interface, paying attention to the wire order.
Edit /opt/fb_load.sh on the board, and uncomment the specific model's initialization command.
Then execute:
```
/opt/fb_load.sh # Initialize the screen driver
devmem # Test color bars
```
If it works, you can add it to the boot script:
```
echo /opt/fb_load.sh >> /etc/rc.local
```
The LCD will provide a framebuffer for user space programs to access.
It is recommended to use QT5, SDL1.2, or LVGL for UI development, or you can write directly to the Framebuffer.
For direct framebuffer writing, refer to /opt/src/vendortest in the board's filesystem.
## Touch Screen
Connect the touchscreen ribbon to the board's touchscreen interface, paying attention to the wire sequence.
Then execute:
```
/opt/touch.sh # Load the touchscreen driver
```
Followed by:
```
echo 2 | evtest
```
Touching the screen will display specific coordinates in the terminal.
For reading coordinates and touch events, refer to the input section in /opt/src/vendortest.
## WIFI
Install the antenna onto the WIFI module's antenna connector.
Then write the AP's SSID and password into the /etc/wpa_supplicant.conf file:
```
network={
ssid="ssid"
psk="password"
}
```
After that, execute:
```
/opt/wifi.sh
```
To verify if the network is available:
```
ping your gateway address
```
If available, you can add it to the boot script:
```
echo '/opt/wifi.sh' >> /etc/rc.local
```
## Camera
Install the camera onto the camera mount, paying attention to the wire sequence.
Then execute:
```
/opt/camera.sh 0
echo "
1
0
1
255" | sensor_test # Capture an image, saved in the current directory
```
## Button
To view button events, use the command:
```
echo 1 | evtest
```
Then press the USER button, and you will see the corresponding event report in the terminal.
## HelloWorld
For information on compiling programs using the vendor's toolchain, visit:
https://github.com/sipeed/LicheeRV-Nano-Build/blob/v4.1.0/build/boards/cv181x/cv1812cp_licheerv_nano_sd/readme.md#compile-program-use-vendors-toolchain

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

View File

@@ -181,6 +181,22 @@ items:
file: lichee/RV/problems.md
- label: Ubuntu Image
file: lichee/RV/ubuntu.md
- label: LicheeRV Nano
items:
- label: Introduction
file: lichee/RV_Nano/1_intro.md
- label: Unboxing Experience
file: lichee/RV_Nano/2_unbox.md
- label: Image Collection
file: lichee/RV_Nano/3_images.md
- label: Flashing the Image
file: lichee/RV_Nano/4_burn_image.md
- label: peripheral
file: lichee/RV_Nano/5_peripheral.md
- label: System Development
file: lichee/RV_Nano/6_develop_mainline.md
- label: test
file: lichee/RV_Nano/7_test_report.md
- label: Lichee Zero
file: lichee/Zero/Zero.md
- label: Lichee Nano

View File

@@ -212,7 +212,7 @@ items:
- label: 外设使用
file: lichee/RV_Nano/5_peripheral.md
- label: 系统开发
file: llichee/RV_Nano/6_develop_mainline.md
file: lichee/RV_Nano/6_develop_mainline.md
- label: 板卡测试
file: lichee/RV_Nano/7_test_report.md
- label: LicheePI Zero