Hi,
Im trying to get the LVGL V8 Library to work but so far no luck. And since I have spend nearly 3 whole days on research with try and error and I downt know any further… I hope that somebody here can provide me with some new ideas to fix it.
I just wanted to get the example to work on a round GC9A01 Display. But I only get colored pixel noise on the screen.
The Code and Output is as follows:
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_freertos_hooks.h"
#include "freertos/semphr.h"
#include "esp_system.h"
#include "driver/gpio.h"
// Special GC9A01 related Headers
//#include "esp_lcd_gc9a01.h"
#include "lvgl.h"
#include "lvgl_helpers.h"
#include "demos/lv_demos.h"
/*********************
* DEFINES
*********************/
#define TAG "demo"
#define LV_TICK_PERIOD_MS 1
#define LV_MEME_SIZE (50ul * 1024ul)
#define LVGL_LCD_BUF_SIZE 240*8
#define MY_DISP_HOR_RES 240
#define MY_DISP_VER_RES 240
/**********************
* STATIC PROTOTYPES
**********************/
static void lv_tick_task(void *arg);
static void lvglDemoTask(void *pvParameter);
static void create_demo_application(void);
/**********************
* APPLICATION MAIN
**********************/
void app_main() {
/* If you want to use a task to create the graphic, you NEED to create a Pinned task
* Otherwise there can be problem such as memory corruption and so on.
* NOTE: When not using Wi-Fi nor Bluetooth you can pin the guiTask to core 0 */
xTaskCreatePinnedToCore(lvglDemoTask, "gui", 32000, NULL, 0, NULL, 0);
}
/*************************
* Function Definitions
*************************/
static void create_demo_application(void)
{
lv_demo_widgets();
}
static void lv_tick_task(void *arg) {
(void) arg;
lv_tick_inc(LV_TICK_PERIOD_MS);
}
static void lvglDemoTask(void *pvParameter) {
(void) pvParameter;
lv_init();
lvgl_driver_init();
/*A static or global variable to store the buffers*/
static lv_disp_draw_buf_t disp_buf;
/*Static or global buffer(s). The second buffer is optional*/
static lv_color_t buf_1[MY_DISP_HOR_RES * 10];
static lv_color_t buf_2[MY_DISP_VER_RES * 10];
/*Initialize `disp_buf` with the buffer(s). With only one buffer use NULL instead buf_2 */
lv_disp_draw_buf_init(&disp_buf, buf_1, buf_2, MY_DISP_HOR_RES*10);
static lv_disp_drv_t disp_drv; /*A variable to hold the drivers. Must be static or global.*/
lv_disp_drv_init(&disp_drv); /*Basic initialization*/
disp_drv.draw_buf = &disp_buf; /*Set an initialized buffer*/
//disp_drv.flush_cb = my_flush_cb; /*Set a flush callback to draw to the display*/
disp_drv.hor_res = 240; /*Set the horizontal resolution in pixels*/
disp_drv.ver_res = 240; /*Set the vertical resolution in pixels*/
lv_disp_t * disp;
disp = lv_disp_drv_register(&disp_drv); /*Register the driver and save the created display objects*/
/* Create and start a periodic timer interrupt to call lv_tick_inc */
const esp_timer_create_args_t periodic_timer_args = {
.callback = &lv_tick_task,
.name = "periodic_gui"
};
esp_timer_handle_t periodic_timer;
ESP_ERROR_CHECK(esp_timer_create(&periodic_timer_args, &periodic_timer));
ESP_ERROR_CHECK(esp_timer_start_periodic(periodic_timer, LV_TICK_PERIOD_MS * 1000));
create_demo_application();
while (1) {
vTaskDelay(pdMS_TO_TICKS(10));
}
}
--- Terminal on COM4 | 115200 8-N-1
--- Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at https://bit.ly/pio-monitor-filters
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
ets Jul 29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6608
load:0x40078000,len:14788
ho 0 tail 12 room 4
load:0x40080400,len:3792
entry 0x40080694
␛[0;32mI (29) boot: ESP-IDF 4.4.1 2nd stage bootloader␛[0m
␛[0;32mI (29) boot: compile time 09:26:38␛[0m
␛[0;32mI (29) boot: chip revision: 3␛[0m
␛[0;32mI (32) boot_comm: chip revision: 3, min. bootloader chip revision: 0␛[0m
␛[0;32mI (39) boot.esp32: SPI Speed : 40MHz␛[0m
␛[0;32mI (44) boot.esp32: SPI Mode : DIO␛[0m
␛[0;32mI (48) boot.esp32: SPI Flash Size : 16MB␛[0m
␛[0;32mI (53) boot: Enabling RNG early entropy source...␛[0m
␛[0;32mI (58) boot: Partition Table:␛[0m
␛[0;32mI (62) boot: ## Label Usage Type ST Offset Length␛[0m
␛[0;32mI (69) boot: 0 nvs WiFi data 01 02 00009000 00006000␛[0m
␛[0;32mI (76) boot: 1 phy_init RF data 01 01 0000f000 00001000␛[0m
␛[0;32mI (84) boot: 2 factory factory app 00 00 00010000 00100000␛[0m
␛[0;32mI (91) boot: End of partition table␛[0m
␛[0;32mI (96) boot_comm: chip revision: 3, min. application chip revision: 0␛[0m
␛[0;32mI (103) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=23b0ch (146188) map␛[0m
␛[0;32mI (164) esp_image: segment 1: paddr=00033b34 vaddr=3ffb0000 size=026d4h ( 9940) load␛[0m
␛[0;32mI (168) esp_image: segment 2: paddr=00036210 vaddr=40080000 size=09e08h ( 40456) load␛[0m
␛[0;32mI (187) esp_image: segment 3: paddr=00040020 vaddr=400d0020 size=48f34h (298804) map␛[0m
␛[0;32mI (295) esp_image: segment 4: paddr=00088f5c vaddr=40089e08 size=03368h ( 13160) load␛[0m
␛[0;32mI (301) esp_image: segment 5: paddr=0008c2cc vaddr=50000000 size=00010h ( 16) load␛[0m
␛[0;32mI (307) boot: Loaded app from partition at offset 0x10000␛[0m
␛[0;32mI (308) boot: Disabling RNG early entropy source...␛[0m
␛[0;32mI (324) cpu_start: Pro cpu up.␛[0m
␛[0;32mI (325) cpu_start: Starting app cpu, entry point is 0x40082478␛[0m
␛[0;32mI (0) cpu_start: App cpu up.␛[0m
␛[0;32mI (340) cpu_start: Pro cpu start user code␛[0m
␛[0;32mI (340) cpu_start: cpu freq: 160000000␛[0m
␛[0;32mI (340) cpu_start: Application information:␛[0m
␛[0;32mI (345) cpu_start: Project name: BA_Test_lvgl␛[0m
␛[0;32mI (350) cpu_start: App version: 1␛[0m
␛[0;32mI (355) cpu_start: Compile time: Nov 6 2022 09:26:03␛[0m
␛[0;32mI (361) cpu_start: ELF file SHA256: 6749270671493832...␛[0m
␛[0;32mI (367) cpu_start: ESP-IDF: 4.4.1␛[0m
␛[0;32mI (372) heap_init: Initializing. RAM available for dynamic allocation:␛[0m
␛[0;32mI (379) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM␛[0m
␛[0;32mI (385) heap_init: At 3FFD5A98 len 0000A568 (41 KiB): DRAM␛[0m
␛[0;32mI (391) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM␛[0m
␛[0;32mI (397) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM␛[0m
␛[0;32mI (404) heap_init: At 4008D170 len 00012E90 (75 KiB): IRAM␛[0m
␛[0;32mI (411) spi_flash: detected chip: generic␛[0m
␛[0;32mI (415) spi_flash: flash io: dio␛[0m
␛[0;32mI (419) cpu_start: Starting scheduler on PRO CPU.␛[0m
␛[0;32mI (0) cpu_start: Starting scheduler on APP CPU.␛[0m
␛[0;32mI (445) lvgl_helpers: Display buffer size: 9600␛[0m
␛[0;32mI (445) lvgl_helpers: Initializing SPI master for display␛[0m
␛[0;32mI (445) lvgl_helpers: Configuring SPI host SPI3_HOST␛[0m
␛[0;32mI (465) lvgl_helpers: MISO pin: -1, MOSI pin: 23, SCLK pin: 18, IO2/WP pin: -1, IO3/HD pin: -1␛[0m
␛[0;32mI (465) lvgl_helpers: Max transfer size: 19200 (bytes)␛[0m
␛[0;32mI (465) lvgl_helpers: Initializing SPI bus...␛[0m
␛[0;32mI (485) disp_spi: Adding SPI device␛[0m
␛[0;32mI (485) disp_spi: Clock speed: 40000000Hz, mode: 0, CS pin: 5␛[0m
␛[0;32mI (705) GC9A01: Initialization.␛[0m
␛[0;32mI (925) GC9A01: Display orientation: PORTRAIT␛[0m
␛[0;32mI (925) GC9A01: 0x36 command value: 0x08␛[0m
␛[0;32mI (925) disp_backlight: Setting LCD backlight: 100%␛[0m