-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ILI9341 Display mirrored #234
Comments
what IDF version are you using? https://forum.lvgl.io/t/why-are-text-and-widgets-mirrored/13453 (Something todo with MADCTL settings) I'm using the exact same hardware, with the same issue have not manged to implement a fix yet. |
Oke I found it, display looks oke now. in from:
to
How? I just brute forced the problem: I knew this was the register causing the issue so I just started changing the value: PS I used this project for testing: https://github.com/limpens/esp32-2432S028 |
@littleboot - Thank you so much for your reply. With a bit of messing I've got it working now! I'm using IDF4.4, I had issues with 5 and will be doing a clean install at some point to understand them. Meantime I have managed to sort the issue by following your method. I changed a value in the ili9341_set_orientation function in lvgl_esp32_drivers\lvgl_tft\ili9341.c from: To: The project used for testing was 'Sunton-esp32-2.8-LVGL_Full_Test' which was downloaded from a google drive folder https://drive.google.com/drive/folders/1WE6-deYVILK3k2NOrxQnq73NqyO18ksO provided with the board |
@dpwlt Hi today I looked into the display board code again. I manged to get it all working and compile it with IDF 5.1. I discovered someone (hiruna) already updated the lv_port_esp32, he even made a pull request no idea why it is still not accepted and merged with the official repo. He also fixed all the lvgl_esp32_drivers and updated the LVGL library version. When you clone this repo you will be able to compile it with IDF V5.1 To fix the display inversion / orientation problem and also incorrect color problem (orange color instead of blue): use this buffer configuration: The color problem can be fixed by changing the BGR_RGBBGROrder bit. I determined these bytes by reading:
You can set the orientation using the sdkconfig menu, these are my sdkconfig defaults (to use it, save it in project root as "sdkconfig.defaults" and delete the original sdkconfig file)
I attached my ili9341.c file, just for reference, changing only the data buffer definition is sufficient, you already managed to do so :P. But I hope this will explain it if you are interested. Next on my list is to make a template project for this hardware in squareline studio, if you are interested let me know I will share it if and when I get it to work. |
@littleboot - Thanks for sharing, I'm always interested in trying to understand the why of a fix :) I've had a bit of a play around with Squareline studio but as I was having issues with the display orientation I moved onto something else, I'll be coming back to this project once I've got my Galagino arcade build completed. I ended up buying a few of these boards so yes I'm definitely interested in seeing how this works in Squareline for the next project, the LVGL UI is very pretty compared to what I made myself. I really appreciate you coming back to share this insight. Have a great weekend! |
@dpwlt Got it all working, forked the repositories from hiruna and added the Sunton ESP32-2432S028 board to the predefined displays. I also updated the readme with some instructions. You can find it here: |
HW: ESP32-2432S028R
Touch: XPT2046
TFT: ILI9341
I've managed to build and flash the LVGL demo to the device but the display is mirrored, text is backwards. The touch works correctly and the touch is shown on the correct part of the interface even though the actual touch is on the opposite side of the display.
I've attempted to find the cause of the issue and it appears that there is a setting for ML (Vertical refresh bit) which can be set. The command is in the data sheet of ILI9341: 8.2.29. Memory Access Control (36h). I am unsure how to set this in the config. Could you help please?
The text was updated successfully, but these errors were encountered: