-
Notifications
You must be signed in to change notification settings - Fork 109
Description
Owing to this site, I was able to run some of the get started examples available in lvgl 9.4 site.
Informations about low-level drivers for Sunton Cheap Yellow displays as mine: ESP32-4827S043N and lv_conf.h considerations have been very useful to start with lvgl matter (which seems to be very rich). My lv_conf.h file corresponds with the V9.3.0 lvgl version and I only modified the #0 in #1 at the top of file in order to enable the file to be included.
Now i intend to cutomize my first configuration which consists in updating a label with a lv_label_set_text_fmt command inserte in loop().
Up to now, the label display (lv_label_display_test function within setup(up) section) is correctly executed, whereas the lv_label_set_text_fmt command located in loop() seems to stop run time (the following Serial.print is not executed).
My work environment is:
VSCode:
Version: 1.103.0
Commit: e3550cfac4b63ca4eafca7b601f0d2885817fd1f
Date: 2025-08-06T21:40:10.271Z
Electron: 37.2.3
ElectronBuildId: 12035395
Chromium: 138.0.7204.100
Node.js: 22.17.0
V8: 13.8.500258-electron.0
OS: Linux x64 6.15.9-201.fc42.x86_64
platformIO version:
$ pio system info
*****************************************************************************
Obsolete PIO Core v6.1.17 is used (previous was 6.1.18)
Please remove multiple PIO Cores from a system:
https://docs.platformio.org/en/latest/core/installation/troubleshooting.html
-------------------------- --------------------------------------------------
PlatformIO Core 6.1.17
Python 3.13.5-final.0
System Type linux_x86_64
Platform Linux-6.15.9-201.fc42.x86_64-x86_64-with-glibc2.41
File System Encoding utf-8
Locale Encoding UTF-8
PlatformIO Core Directory /home/admin/.platformio
PlatformIO Core Executable /usr/bin/platformio
Python Executable /usr/bin/python3
Global Libraries 0
Development Platforms 3
Tools & Toolchains 15
I use the Arduino platform within PLatformIO, not ESP-IDF.
Here is my PlatformIO.ini file:
; PlatformIO Project Configuration File
;
; Build options: build flags, source filterlv_label_dispay_test
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:esp32-4827S043N]
platform = espressif32
board = esp32-4827S043N
framework = arduino
monitor_speed = 115200
monitor_rts = 0
monitor_dtr = 0
monitor_filters = esp32_exception_decoder
build_flags =
-Ofast
-Wall
'-D LV_CONF_PATH="${platformio.include_dir}/lv_conf.h"'
'-D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE'
'-D ESP_LCD_PANEL_IO_ADDITIONS_VER_MAJOR=1'
'-D ESP_LCD_PANEL_IO_ADDITIONS_VER_MINOR=0'
'-D ESP_LCD_PANEL_IO_ADDITIONS_VER_PATCH=1'
lib_deps =
rzeldent/esp32_smartdisplay@^2.1.1
${platformio.include_dir}
and main.cpp:
#include <Arduino.h>
#include <esp32_smartdisplay.h>
#include "../.pio/libdeps/esp32-4827S043N/lvgl/examples/lv_examples.h"
float cnt = 1.00;
lv_obj_t * label;
// callback function (tick management)
// elapsedtime since startup
static uint32_t my_tick_get_cb(void) { return millis(); }
void update_display()
{
lv_label_set_text_fmt(label, "counter: %f ", cnt);
}
void lv_label_dispay_test(void)
{
lv_obj_t * obj1;
obj1 = lv_obj_create(lv_screen_active());
lv_obj_set_size(obj1, 100, 100);
lv_obj_align(obj1, LV_ALIGN_CENTER, -30, 0);
lv_obj_t * label = lv_label_create(obj1);
lv_label_set_text(label, "counter");
}
void setup()
{
smartdisplay_init();
lv_init();
lv_tick_set_cb(my_tick_get_cb); // Set the tick callback function
auto display = lv_display_get_default(); //
// lv_display_set_rotation(display, LV_DISPLAY_ROTATION_90);
// lv_display_set_rotation(display, LV_DISPLAY_ROTATION_180);
// lv_display_set_rotation(display, LV_DISPLAY_ROTATION_270);
smartdisplay_lcd_set_backlight(0.5);
// 0 pas de retroeclairage
// 0.5 50%
// 1 eclairage 100%
lv_label_dispay_test();
}
void loop()
{
// Update the UI
lv_timer_handler();
update_display();
Serial.print("counter: ");
Serial.println(cnt);
cnt=cnt+1;
delay(2000);
}
I don't know how to investigate with this issue and would appreciate any advice about it.
Kind regards.
Philippe.