Hello
I’m new to ESP32 and to LVGL so please have some patient with me when I’m missing some information. My experience is based on STM32 controllers with almost no external libaries or RTOS.
I want to create a touch interface which is connected via MQTT. For this I got a ESP32-S3-Touch-LCD-4.3 demo board.
For development I use VS code as mentioned in the examples. So far, my code is very simple as close to the exmaples I found. So far the following parts are implemented:
- Initialize RGB display
- Initialize I2C touch
- Initialize Wifi Station
- Initialize MQTT client
On the screen the following things are displayed:
- Push Button as in example 1 which counts up on touch
- Triangle, drawn with line function (top left, top right, bottom right)
I use the triangle to detect a shifted screen.
In general everything is working but after a reset it can happen that the screen is shifted to the right and the overlapping content is filling the missing part at the left. The triangle looks like a sawtooth signal. The screen is stable so I don’t think it’s a timing issue related to the display. Touch is still at the original position When this happens the log contains a wifi related error message:
W (1687) phy_init: saving new calibration data because of checksum failure, mode(0)
The LCD is initalized before WIFI. Also the content is drawn before WIFI gets initialized.
I was not able to provoke the issue when wifi is disabled. Therefore I assume that the wifi part requires more ressources when redoing the calibration and causes LVGL to react wrong. It must be related to somthing that happens in the LVGL task and not during LVGL initialization.
As I don’t know which code part is relevant I pushed the project to GitHub - katagia/interface: ESP32 MQTT Interface
interface/main/lcd.c at main · katagia/interface · GitHub contains the LCD relevant code, interface/main/wifi.c at main · katagia/interface · GitHub the WIFI code.
Everything is new and I feel lost at the moment. It would be nice if someone could give me a bump into the right direction.
Thank you very much.
/Edit:
I think I found something. I added a variable for settings to NVS (non volatile storage). Everytime the variable is saved, the content of the screen is shifted a little bit more to the right. How can I detect if the problem is memory handling in lvgl or something else?