Lvgl chart bug
Posted: Sat May 31, 2025 12:44 pm
In my project i receive data via nimble and showing data on LCD by using LVGl . My data reception rate is 40 millisecond . My problem is when the chart start to update the value the screen moves up and down like the screen is not stable , LCD doesn't crash or tear just screen moves up and down. i provide the gift of my problem .
this is the part of my code that i sort the data for showing on LCD (
static void process_received_data(uint8_t *data , uint16_t length)
{
switch (data[0])
{
case 0x5A:
if (length >= 11) {
ESP_LOGI(TAG, "ECG Data Packet");
gui_chart_update_t *gui_chart_data = malloc(sizeof(gui_chart_update_t));
if (gui_chart_data == NULL) {
ESP_LOGE(TAG , "Failed to allocated GUI chart data");
return;
}
memcpy(gui_chart_data->Ecg , data , Ecg_size);
gui_chart_data -> Ecg_len = Ecg_size;
gui_chart_data -> update_ecg = true;
lv_async_call(update_chart_gui , gui_chart_data);
}
break;
)
/**********************************************************************************************/
this is my code for updating the chart (
static void update_chart_gui(void *arg)
{
gui_chart_update_t *chart_data = (gui_chart_update_t *)arg;
if (chart_data->update_ecg) {
for(size_t i =0; i < chart_data->Ecg_len ; i++) {
//Update Chart graph
lv_chart_set_next_value(ui_Ecg_Waveform , ui_Ecg_Waveform_series_1 , chart_data->Ecg);
}
}
free(chart_data);
}
).
even i use array and "lv_chart_set_ext_y_array" function but still doesn't work . My board is Waveshare ESP32S3 7-inch LCD 800 * 480.
I don't how i must config and set the lvgl to have high refresh rate without get crashing . i would be grateful if you could help me solve this problem .
this is the part of my code that i sort the data for showing on LCD (
static void process_received_data(uint8_t *data , uint16_t length)
{
switch (data[0])
{
case 0x5A:
if (length >= 11) {
ESP_LOGI(TAG, "ECG Data Packet");
gui_chart_update_t *gui_chart_data = malloc(sizeof(gui_chart_update_t));
if (gui_chart_data == NULL) {
ESP_LOGE(TAG , "Failed to allocated GUI chart data");
return;
}
memcpy(gui_chart_data->Ecg , data , Ecg_size);
gui_chart_data -> Ecg_len = Ecg_size;
gui_chart_data -> update_ecg = true;
lv_async_call(update_chart_gui , gui_chart_data);
}
break;
)
/**********************************************************************************************/
this is my code for updating the chart (
static void update_chart_gui(void *arg)
{
gui_chart_update_t *chart_data = (gui_chart_update_t *)arg;
if (chart_data->update_ecg) {
for(size_t i =0; i < chart_data->Ecg_len ; i++) {
//Update Chart graph
lv_chart_set_next_value(ui_Ecg_Waveform , ui_Ecg_Waveform_series_1 , chart_data->Ecg);
}
}
free(chart_data);
}
).
even i use array and "lv_chart_set_ext_y_array" function but still doesn't work . My board is Waveshare ESP32S3 7-inch LCD 800 * 480.
I don't how i must config and set the lvgl to have high refresh rate without get crashing . i would be grateful if you could help me solve this problem .