LVGL and SD card update
Hello everyone,
I'm currently using an ESP32 with a 5" display, using LVGL and Arduino for my project.
Everything has worked perfectly so far. Recently I've added a firmware update function
using an SD card. The update process itself works as expected, but I've encountered a
significant problem: as soon as the update process starts, heavy display errors appear
on the screen. It looks like a snowstorm
Has anyone experienced a similar problem or can advise on the possible cause of these
display errors during the firmware update process?
Thanks in advance for any advice!
Comments
Can any one kindly help me to get a sample code to display/load images from sdcard using lvgl library for arudino
Hi ,
Please kindly refer to this website for the lesson:
https://www.elecrow.com/wiki/esp32-display-502727-intelligent-touch-screen-wi-fi26ble-800480-hmi-display.html#video-lessons
and here is the sample code:
https://github.com/Elecrow-RD/CrowPanel-ESP32-Display-Course-File/tree/main/CrowPanel_ESP32_Tutorial/Code
Hi @DerFrickler ,
The "snowstorm" effect on the display during the firmware update process likely stems from resource contention or interference between the SD card operations and the display update process. Here are a few possible causes and solutions:
Causes:
1.SPI Bus Contention:
If both the SD card and the display share the same SPI bus without proper synchronization, they might interfere with each other.
2.Interrupt Conflicts:
The firmware update process could be using interrupts that overlap with those driving the display updates, causing glitches.
3.Buffer Overflows or Timing Issues:
During the update, the ESP32's CPU might not handle display refresh tasks adequately due to the high priority of SD card operations.
4.Insufficient Power Supply:
The combined current draw of the SD card and display during intensive operations might cause voltage drops, leading to instability.
Solutions:
1.Use Separate SPI Buses:
Assign the SD card and the display to separate SPI buses to avoid conflicts. The ESP32 has multiple SPI peripherals (VSPI and HSPI) that can be utilized for this purpose.
2.Disable Display Updates During Firmware Process:
Temporarily stop the LVGL task or display updates during the firmware update. Once the update is complete, reinitialize the display.
lv_disp_drv_t *disp = lv_disp_get_default();
lv_disp_trig_activity(disp); // Trigger display updates
// Pause LVGL task
3.Implement Mutex or Task Synchronization:
Use FreeRTOS mutexes to synchronize access to shared resources like the SPI bus.
4.Power Supply Check:
Ensure the power supply can handle the combined load of the ESP32, display, and SD card. If necessary, add a capacitor near the ESP32 to stabilize the voltage.
5.Optimize SD Card Access:
Minimize SD card operations during the update process to reduce the load on the system.
6.Debugging and Logging:
Use serial debugging to check for any errors or warnings during the update process that could hint at the root cause.
Hi @Jennie
Many thanks for your detailed advice.
I have tested the power supply and have not noticed any voltage drops during the update process.
The SPI bus is only used for the SD card. The display is controlled via RGB 565.
I have deactivated lv_timer_handler during the update, but without success.
I will have to do further research to better understand the SD card and the LVGL/GFX process handling.
Does anyone have an example sketch that works with LVGL and OTA for the DIS07050H display?