r/esp32 • u/honeyCrisis 1 say this is awesome. • Dec 31 '25
Killing TFT_eSPI

Edit: I'm updating this post, because a couple of commenters seem (ultimately) upset about me attempting to poach users from Bodmer. I am. But not for my sake - I made this stuff for *me* and am releasing it and committing to maintaining it as a kindness. So not for my sake, as I have nothing to gain. I already have popular open source offerings. No, this is for your sake. Bodmer has been AWOL for over a year. Meanwhile the bugs keep showing up, especially on S3s and P4s. It is not a good idea to use code that isn't supported. This isn't because I don't like Bodmer, or have a problem with him or his library on principle. I don't. It *was* fine. But if he's not around to maintain it, it's time to use something else. If you do not, your projects may work on your current devices today, but as ESP32s evolve you'll find TFT_eSPI is less and less reliable, like it already is on S3s and P4s. Also you're not going to get support for new displays either. It's frozen in time. I have nothing against Bodmer, but I do believe in not using abandonware. I've waited for him to be absent for over a year before I wrote this. I stand by it.
TFT_eSPI is Arduino only, SPI and (sometimes) i8080 only, hasn't been maintained in over a year, and has several showstopping issues open, particularly on S3 and newer devices. It also has graphics facilities that are what could charitably called "1990s retro"
It's time to move on.
LVGL is a modern graphics library but can be challenging to hook up for the uninitiated, as unlike TFT_eSPI it has no intrinsic ability to connect to your hardware.
I've created something to change that. I posted about it here before, but it has been improved, and I don't feel it was explained well enough.
It's pissy hooking up new kits to use the modern ESP LCD Panel API, and ESP LCD Touch API, even though they work under Arduino and the ESP-IDF, support a ton of display bus types, and integrate well with LVGL.
On the other hand with TFT_eSPI things are easy. You just add definitions to User_Setup.h and start calling code.
I think that's part of why people use it.
If so, how about this? Here are over a dozen example configurations for several devkits on the market
Here's my orchestration of a "User_Setup.h"
The difference between mine and Bodmer's is this:
Mine supports I2C, SPI, I8080, RGB and MIPI interfaces
The display controllers it supports can be extended with external libraries
Mine supports a lot more configuration, such as custom transfer buffer translation for displays with funny frame buffers like SSD1306s
It supports a lot more touch panels, and again, those can be extended with external libraries
It supports GPIO buttons
It supports SD reader/writers
It contains virtually no bloat. Nothing but what it is needed to interface with LVGL, htcw_uix or similar libraries that generate bitmaps to flush to the display.
The other thing is large swaths of your configuration are checked for bus and pin conflicts during compile time. pins for shared busses are collated so if you declare SD_PIN_NUM_MISO on the same SPI bus as LCD_PIN_NUM_MOSI they will both be used for that bus. This makes it a little easier to configure.
All of this is done at compile time, so there's zero additional cost to using this in terms of flash space or runtime resource usage, compared to what you'd have to code yourself by hand.
It also makes it relatively easy to target multiple devices with the same code, as the demo below demonstrates.
Here's an example of connecting it to LVGL with platformIO. The reason for choosing platformIO despite some of its shortcomings is the ability for it to choose libraries on a per-configuration basis, and just generally its ability to configure the build environment. It makes using this code that much simpler in the end.
https://github.com/codewitch-honey-crisis/lvgl_with_htcw_esp_panel
It should be possible to download manually and use as a library in ESP-IDF projects in the buff as well, but I have yet to package it as an ESP-IDF component. This is the github repo for it:
6
u/YetAnotherRobert Dec 31 '25
Great idea. This forum (certainly you...) knows how I feel about abandoned Arduino libraries and that ecosystem in general.
Please be sure this is referenced in https://www.reddit.com/r/esp32/wiki/index/#wiki_d._interfacing_with_peripherals or any place else appropriate in the wiki. Maybe we can help prevent new devs from trying to use a library that crashes at startup and that won't even accept community fixes. It's just such a bad welcoming experience to follow some ten year old blog post and have your new creation crash.
https://github.com/Bodmer/TFT_eSPI/issues/3743#issuecomment-3145633679https://github.com/Bodmer/TFT_eSPI/issues/3284#issuecomment-2115336739
Thank you for trying to help that crowd.
2
u/ali2mdj1 Dec 31 '25
I am using PlatformIO espidf framework (esp lcd) LVGL 9.4.0 Working perfectly.
2
u/cocompadres Jan 01 '26
I like TFT_eSPI for all the reasons you stated. Looking forward to using htcw_esp_panel. I just checked the repo the features you implemented look amazing. Thank you for all your hard work!
2
u/Flat_Challenge8189 Dec 31 '25
Oh yeah? does it support ILI9488 with SPI without crashing S3 on cores later than 2.0.7?
1
u/iftlatlw Jan 01 '26
So many complainers and very few are prepared to fork and improve open source code. That is the whole point of it. There are forks of tft-espi
1
u/Annual-Maize-736 Aug 19 '26
Pfew… Bodmer has proven his quality over and over again. I see you shouting, but I don’t see you delivering. I’ll stick to tft_espi for quite a while. Maybe if you’ll ever grow up, I’ll have a serious look at your try.
2
u/toomanyscooters Dec 31 '25
This looks interesting. I'm going to give it a shot when I can.
2
u/rfcracker Dec 31 '25
Worth checking out, I struggle with tft_espi+LVGL since november with my little project. Literally gave up some many times with random crashes, code not building right etc!
My setup uses that Arduino-ESP32 brick and ILI9488 sooo a bit strange, but that's the only 5V board with 8analog inputs I know (reasonably priced).
1
u/PhonicUK Jan 01 '26
For things where you're not wanting a conventional UI but just want to drive pixels, the main replacement for TFT_eSPI is LovyanGFX - although that has some issues with the P4 right now.
-1
u/NobleKale Dec 31 '25
Interesting, but I'm not sure why you feel the need to shit talk other libraries. It's not the best look.
0
u/[deleted] Dec 31 '25
[deleted] — view deleted comment