Introduction
This example runs on a Duo device, using a 240x320 resolution SPI interface display to run the LVGL test program.
You need to prepare the Milk-V Duo development board (or Duo256M), SD card, and an ST7789V chip LCD screen. The full-color 2.4-inch screen used here has a resolution of 240*320 and the interface method is SPI. You can choose different ones as needed. size screen. For screens with different resolutions, please note that the following configurations should be modified accordingly.
Bring up the SPI display
Compile firmware
Get the official SDK: https://github.com/milkv-duo/duo-buildroot-sdk.git
git clone https://github.com/milkv-duo/duo-buildroot-sdk.git
Get Duo LVGL Demo: https://github.com/milkv-duo/duo-lvgl-fb-demo.git
git clone https://github.com/milkv-duo/duo-lvgl-fb-demo.git
Enter the SDK directory and apply a patch to the SDK kernel to support the ST7789V chip (the patch is in the duo-lvgl-fb-demo.git repository above):
cd duo-buildroot-sdk
git apply --reject ../duo-lvgl-fb-demo/duo-kernel-fb_st7789v.patch
Confirm that the kernel configuration has support for turning on FB TFT (the latest Buildroot SDK already supports it by default):
CONFIG_FB=y
CONFIG_FB_TFT=y
CONFIG_FB_TFT_ST7789V=y
The location of the kernel configuration file:
- Duo:
build/boards/cv180x/cv1800b_milkv_duo_sd/linux/cvitek_cv1800b_milkv_duo_sd_defconfig
- Duo256M:
build/boards/cv181x/cv1812cp_milkv_duo256m_sd/linux/cvitek_cv1812cp_milkv_duo256m_sd_defconfig
- DuoS SD:
build/boards/cv181x/cv1813h_milkv_duos_sd/linux/cvitek_cv1813h_milkv_duos_sd_defconfig
- DuoS eMMC:
build/boards/cv181x/cv1813h_milkv_duos_emmc/linux/cvitek_cv1813h_milkv_duos_emmc_defconfig
Compile SD card firmware:
- Duo
./build.sh milkv-duo
- Duo256M
./build.sh milkv-duo256m
- DuoS SD
./build.sh milkv-duos-sd
- DuoS eMMC
./build.sh milkv-duos-emmc
After compilation, burn the corresponding img file in the out directory to the microSD card.
Hardware connection
Next, perform wiring configuration based on the Duo pin position reference. Note that the BL
pin of this display is the backlight enable pin, and the backlight is on when the pin level is high.
Duo and Duo256M
Duo/Duo256M Pin | ST7789V |
---|---|
PIN 38: GND | GND |
PIN 36: 3.3V(OUT) | VCC |
PIN 9: SPI2_SCK | SCL |
PIN 10: SPI2_SDO | SDA |
PIN 21: GP16 | RES |
PIN 22: GP17 | DC |
PIN 12: SPI2_CS_X | CS |
PIN 36: 3.3V(OUT) | BL |
DuoS
DuoS Pin | ST7789V |
---|---|
PIN 25: GND | GND |
PIN 17: 3V3 | VCC |
PIN 23: SPI3_SCK | SCL |
PIN 19: SPI3_SDO | SDA |
PIN 26: A28 | RES |
PIN 22: A18 | DC |
PIN 24: B16 | CS |
PIN 1: 3V3 | BL |