Skip to content

Commit a966ec3

Browse files
Merge pull request #256 from Lzw655/bsp/update_s3-lcd-ev-board
bsp: update s3-lcd-ev-board
2 parents c92774c + 6697926 commit a966ec3

File tree

19 files changed

+491
-201
lines changed

19 files changed

+491
-201
lines changed

SquareLine/boards/esp32_s3_lcd_ev_board/main/idf_component.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ description: ESP-BSP SquareLine LVGL Example
22
targets:
33
- esp32s3
44
dependencies:
5-
idf: ">=4.4"
65
esp32_s3_lcd_ev_board: "*"

SquareLine/boards/esp32_s3_lcd_ev_board/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name":"ESP32-S3-LCD-EV-BOARD",
3-
"version":"1.0.0",
3+
"version":"2.0.0",
44
"mcu":"ESP32S3",
55

66
"screen_width":"800",
77
"screen_height":"480",
88
"screen_color_swap":false,
99

1010
"short_description":"ESP32-S3-LCD-EV-BOARD is a development board for evaluating and verifying ESP32-S3 screen interactive applications. It has the functions of touch screen interaction and voice interaction.",
11-
"long_description":"ESP32-S3-LCD-EV-BOARD has an ESP32-S3-WROOM-1 module with built-in 16 MB Flash and 8 MB PSRAM. It features onboard audio codec + audio amplifier and onboard dual microphone pickup. It uses USB type-C interface for download and debugging. ESP32-S3-LCD-EV-BOARD can be used with different screen sub boards with various screen sizes and resolutions, and supports RGB, 8080, SPI, I2C interface screens.",
11+
"long_description":"ESP32-S3-LCD-EV-BOARD has an ESP32-S3-WROOM-1 module with built-in 16 MB Flash and 8/16 MB PSRAM. It features onboard audio codec + audio amplifier and onboard dual microphone pickup. It uses USB type-C interface for download and debugging. ESP32-S3-LCD-EV-BOARD can be used with different screen sub boards with various screen sizes and resolutions, and supports RGB, 8080, SPI, I2C interface screens.",
1212

1313
"placeholders":
1414
{

SquareLine/boards/esp32_s3_lcd_ev_board/sdkconfig.defaults

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,23 @@
22
# Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration
33
#
44
CONFIG_IDF_TARGET="esp32s3"
5-
CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF=y
65
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
76
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
87
CONFIG_PARTITION_TABLE_CUSTOM=y
8+
CONFIG_COMPILER_OPTIMIZATION_PERF=y
99
CONFIG_SPIRAM=y
1010
CONFIG_SPIRAM_MODE_OCT=y
1111
CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y
1212
CONFIG_SPIRAM_RODATA=y
1313
CONFIG_SPIRAM_SPEED_80M=y
1414
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
15-
CONFIG_ESP32S3_DATA_CACHE_64KB=y
15+
CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y
1616
CONFIG_FREERTOS_HZ=1000
17+
CONFIG_BSP_LCD_RGB_BUFFER_NUMS=2
18+
CONFIG_BSP_LCD_RGB_BOUNCE_BUFFER_MODE=y
19+
CONFIG_BSP_DISPLAY_LVGL_AVOID_TEAR=y
20+
CONFIG_BSP_DISPLAY_LVGL_DIRECT_MODE=y
1721
CONFIG_LV_MEM_CUSTOM=y
1822
CONFIG_LV_MEMCPY_MEMSET_STD=y
19-
CONFIG_LV_USE_PERF_MONITOR=y
23+
CONFIG_LV_USE_PERF_MONITOR=y
24+
CONFIG_LV_ATTRIBUTE_FAST_MEM_USE_IRAM=y

bsp/esp32_s3_lcd_ev_board/CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,24 @@
3131
* Add new APIs for touch in `bsp/touch.h`
3232
* Add new APIs for spiffs, audio in `bsp/esp32_s3_lcd_ev_board.h`
3333
* Add new APIs for ADC in `bsp/esp32_s3_lcd_ev_board.h`
34+
35+
## v3.0.0 - 2023-12-02
36+
37+
### Bugfix
38+
39+
* Use `on_bounce_frame_finish` instead of `on_vsync` when enabling RGB bounce buffer mode.
40+
* Fix some issues when enabling anti-tearing and rotation
41+
42+
### Features
43+
44+
* Configurations:
45+
* Support to set the pinned core for LVGL task
46+
* Implementations:
47+
* Support ESP32-S3-WROOM-1-N16R16V module
48+
* Add warning for compiling and running when using `ESP-IDF` version `<5.1.2`
49+
50+
### Dependencies
51+
52+
* Update the version of `ESP-IDF` to `>5.0.1`
53+
* Use `esp_lcd_gc9503` version `^1` when using `ESP-IDF` version `<5.1.2`
54+
* Use `esp_lcd_gc9503` version `^3` when using `ESP-IDF` version `>=5.1.2`

bsp/esp32_s3_lcd_ev_board/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ idf_component_register(
55
INCLUDE_DIRS "include"
66
PRIV_INCLUDE_DIRS "priv_include"
77
REQUIRES driver esp_lcd esp_adc
8-
PRIV_REQUIRES esp_timer spiffs
8+
PRIV_REQUIRES esp_timer spiffs esp_psram
99
)

bsp/esp32_s3_lcd_ev_board/Kconfig

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,21 @@ menu "Board Support Package"
124124
help
125125
The Board Support Package will create a task that will periodically handle LVGL operation in lv_timer_handler().
126126

127+
config BSP_DISPLAY_LVGL_TASK_CORE_ID
128+
int "LVGL task pinned core ID"
129+
default -1
130+
range -1 1
131+
help
132+
Core to pin LVGL task. -1 means no pinning.
133+
127134
config BSP_DISPLAY_LVGL_TASK_DELAY
128135
int "LVGL task minimum delay time (ms)"
129136
default 10
130137
range 1 100
131138
help
132139
Minimum delay time for LVGL task. It should be larger if the task watchdog is triggered frequently.
133140

134-
config BSP_DISPLAY_LVGL_TASK_STACK_SIZE
141+
config BSP_DISPLAY_LVGL_TASK_STACK_SIZE_KB
135142
int "LVGL task stack size (KB)"
136143
default 4
137144
help

bsp/esp32_s3_lcd_ev_board/README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
ESP32-S3-LCD-EV-Board is a development board for evaluating and verifying ESP32-S3 screen interactive applications. It has the functions of touch screen interaction and voice interaction. The development board has the following characteristics:
1212

13-
* Onboard ESP32-S3-WROOM-1 module, with built-in 16 MB Flash + 8 MB PSRAM
13+
* Onboard ESP32-S3-WROOM-1 module, with built-in 16 MB Flash + 8/16 MB PSRAM
1414
* Onboard audio codec + audio amplifier
1515
* Onboard dual microphone pickup
1616
* USB type-C interface download and debugging
@@ -30,7 +30,7 @@ Here are some useful configurations in menuconfig that can be customed by user:
3030
* `BSP_LCD_RGB_REFRESH_MODE`: Choose the refresh mode for the RGB LCD.
3131
* `BSP_LCD_RGB_REFRESH_AUTO`: Use the most common method to refresh the LCD.
3232
* `BSP_LCD_RGB_REFRESH_MANUALLY`: Refresh the LCD within a dedicated task. This can help manage PSRAM bandwidth.
33-
* `BSP_LCD_RGB_BOUNCE_BUFFER_MODE`: Enabling bounce buffer mode can lead to a higher PCLK frequency at the expense of increased CPU consumption. **This mode is particularly useful when dealing with screen drift, especially in scenarios involving Wi-Fi usage or writing to Flash memory. For more detailed information, refer to the documentation [here](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/peripherals/lcd.html#bounce-buffer-with-single-psram-frame-buffer).** This feature should be used in conjunction with `ESP32S3_DATA_CACHE_LINE_64B` configuration.
33+
* `BSP_LCD_RGB_BOUNCE_BUFFER_MODE`: Enabling bounce buffer mode can lead to a higher PCLK frequency at the expense of increased CPU consumption. **This mode is particularly useful when dealing with [screen drift](https://docs.espressif.com/projects/esp-faq/en/latest/software-framework/peripherals/lcd.html#why-do-i-get-drift-overall-drift-of-the-display-when-esp32-s3-is-driving-an-rgb-lcd-screen), especially in scenarios involving Wi-Fi usage or writing to Flash memory.** This feature should be used in conjunction with `ESP32S3_DATA_CACHE_LINE_64B` configuration. For more detailed information, refer to the [documentation](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/peripherals/lcd.html#bounce-buffer-with-single-psram-frame-buffer).
3434
* `BSP_DISPLAY_LVGL_BUF_CAPS`: Select the memory type for the LVGL buffer. Internal memory offers better performance.
3535
* `BSP_DISPLAY_LVGL_BUF_HEIGHT`: Set the height of the LVGL buffer, with its width aligning with the LCD's width. The default value is 100, decreasing it can lower memory consumption.
3636
* `BSP_DISPLAY_LVGL_AVOID_TEAR`: Avoid tearing effect by using multiple buffers. This requires setting `BSP_LCD_RGB_BUFFER_NUMS` to a value greater than 1.
@@ -42,3 +42,15 @@ Here are some useful configurations in menuconfig that can be customed by user:
4242
* `BSP_DISPLAY_LVGL_ROTATION_90`: 90-degree rotation.
4343
* `BSP_DISPLAY_LVGL_ROTATION_180`: 180-degree rotation.
4444
* `BSP_DISPLAY_LVGL_ROTATION_270`: 270-degree rotation.
45+
46+
Based on the above configurations, there are three different anti-tearing modes can be used:
47+
48+
* RGB double-buffer + LVGL full-refresh mode:
49+
* Set `BSP_LCD_RGB_BUFFER_NUMS` to `2`
50+
* Enable `BSP_DISPLAY_LVGL_AVOID_TEAR` and `BSP_DISPLAY_LVGL_FULL_REFRESH`
51+
* RGB double-buffer + LVGL direct-mode:
52+
* Set `BSP_LCD_RGB_BUFFER_NUMS` to `2`
53+
* Enable `BSP_DISPLAY_LVGL_AVOID_TEAR` and `BSP_DISPLAY_LVGL_DIRECT_MODE`
54+
* RGB triple-buffer + LVGL full-refresh mode:
55+
* Set `BSP_LCD_RGB_BUFFER_NUMS` to `3`
56+
* Enable `BSP_DISPLAY_LVGL_AVOID_TEAR` and `BSP_DISPLAY_LVGL_FULL_REFRESH`

bsp/esp32_s3_lcd_ev_board/idf_component.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
version: "2.0.0~2"
1+
version: "2.1.0"
22
description: Board Support Package for ESP32-S3-LCD-EV-Board
33
url: https://github.com/espressif/esp-bsp/tree/master/bsp/esp32_s3_lcd_ev_board
44

55
targets:
66
- esp32s3
77

88
dependencies:
9-
idf: ">=5.0"
9+
idf: ">=5.0.1"
1010

1111
esp_lcd_touch_gt1151:
1212
version: "^1"
@@ -29,7 +29,11 @@ dependencies:
2929
public: true
3030

3131
esp_lcd_gc9503:
32-
version: "^1"
32+
matches:
33+
- if: "idf_version <5.1.2"
34+
version: "^1"
35+
- if: "idf_version >=5.1.2"
36+
version: "^3"
3337
public: true
3438

3539
esp_codec_dev:

bsp/esp32_s3_lcd_ev_board/include/bsp/esp32_s3_lcd_ev_board.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
#define BSP_I2C_SCL (GPIO_NUM_18)
3232
#define BSP_I2C_SDA (GPIO_NUM_8)
3333

34+
// Pins for board using ESP32-S3-WROOM-1-N16R16V
35+
#define BSP_I2C_SCL_R16 (GPIO_NUM_48)
36+
#define BSP_I2C_SDA_R16 (GPIO_NUM_47)
37+
3438
/* Audio */
3539
#define BSP_I2S_SCLK (GPIO_NUM_16)
3640
#define BSP_I2S_MCLK (GPIO_NUM_5)
@@ -62,6 +66,10 @@
6266
#define BSP_LCD_SUB_BOARD_2_3_DATA14 (GPIO_NUM_2)
6367
#define BSP_LCD_SUB_BOARD_2_3_DATA15 (GPIO_NUM_1)
6468

69+
// Pins for board using ESP32-S3-WROOM-1-N16R16V
70+
#define BSP_LCD_SUB_BOARD_2_3_DATA6_R16 (GPIO_NUM_8)
71+
#define BSP_LCD_SUB_BOARD_2_3_DATA7_R16 (GPIO_NUM_18)
72+
6573
#define BSP_LCD_SUB_BOARD_2_SPI_CS (IO_EXPANDER_PIN_NUM_1)
6674
#define BSP_LCD_SUB_BOARD_2_SPI_SCK (IO_EXPANDER_PIN_NUM_2)
6775
#define BSP_LCD_SUB_BOARD_2_SPI_SDO (IO_EXPANDER_PIN_NUM_3)
@@ -282,7 +290,8 @@ esp_err_t bsp_audio_poweramp_enable(bool enable);
282290
#define BSP_LCD_SUB_BOARD_2_H_RES (480)
283291
#define BSP_LCD_SUB_BOARD_2_V_RES (480)
284292

285-
#define SUB_BOARD2_800_480_PANEL_60HZ_RGB_TIMING() GC9503_480_480_PANEL_60HZ_RGB_TIMING()
293+
#define SUB_BOARD2_480_480_PANEL_60HZ_RGB_TIMING() GC9503_480_480_PANEL_60HZ_RGB_TIMING()
294+
#define SUB_BOARD2_480_480_PANEL_SCL_ACTIVE_EDGE (0) // Rising edge, 1: Falling edge
286295

287296
#define BSP_LCD_SUB_BOARD_3_H_RES (800)
288297
#define BSP_LCD_SUB_BOARD_3_V_RES (480)

bsp/esp32_s3_lcd_ev_board/priv_include/bsp_lvgl_port.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,36 @@
1717
extern "C" {
1818
#endif
1919

20+
/**
21+
* @brief Initialize LVGL port
22+
*
23+
* @param[in] lcd: LCD panel handle
24+
* @param[in] tp: Touch handle
25+
* @param[out] disp: LVGL display device
26+
* @param[out] indev: LVGL input device
27+
*
28+
* @return
29+
* - ESP_OK: Success
30+
* - ESP_ERR_INVALID_ARG: Invalid argument
31+
* - Others: Fail
32+
*/
2033
esp_err_t bsp_lvgl_port_init(esp_lcd_panel_handle_t lcd, esp_lcd_touch_handle_t tp, lv_disp_t **disp, lv_indev_t **indev);
2134

35+
/**
36+
* @brief Take LVGL mutex
37+
*
38+
* @param[in] timeout_ms: Timeout in [ms]. 0 will block indefinitely.
39+
*
40+
* @return
41+
* - true: Mutex was taken
42+
* - false: Mutex was NOT taken
43+
*/
2244
bool bsp_lvgl_port_lock(uint32_t timeout_ms);
2345

46+
/**
47+
* @brief Give LVGL mutex
48+
*
49+
*/
2450
void bsp_lvgl_port_unlock(void);
2551

2652
#ifdef __cplusplus

0 commit comments

Comments
 (0)