r/esp32 • 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

https://pastebin.com/EaP0ivAi

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:

https://github.com/codewitch-honey-crisis/htcw_esp_panel

32 Upvotes

52 comments sorted by

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.

3

u/honeyCrisis Jan 01 '26

I added a reference to this post to the wiki.

2

u/YetAnotherRobert Jan 01 '26

Excellent. Thank you for helping keep this community valuable. 

2

u/ali2mdj1 Dec 31 '25

I am using PlatformIO espidf framework (esp lcd) LVGL 9.4.0 Working perfectly.

1

u/honeyCrisis Dec 31 '25

sweet!

4

u/ali2mdj1 Dec 31 '25
Comment Image

Working on bike meter 🙈

→ More replies (4)

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!

1

u/honeyCrisis Jan 01 '26

You like it for being out of support and unmaintained? I appreciate your interest, in any case.

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?

2

u/honeyCrisis Dec 31 '25

It absolutely should. It uses the ESP LCD Panel API under the covers to interface with the display. Unless there's some kind of bug with the esp_lcd_panel_il9488 component in the espressif registry it will work fine. In fact, I've done it before with the Matouch ESP Display Parallel 3.5, but that was over i8080. I haven't tried it on SPI just because I don't have that setup, but I'm pretty confident, as the crashing stuff I believe had to do with the way TFT_eSPI was using the ESP HAL registers from Arduino. I might be mistaken though since I haven't followed its issues that closely.

In general though, the inner workings of TFT_eSPI and this code are entirely different, so adjust expectations accordingly.

1

u/Flat_Challenge8189 Dec 31 '25

Oh dang nice, i'll check it out then!

→ More replies (2)

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/honeyCrisis Jan 01 '26

TFT_eSPI itself is already a fork of AdafruitGFX which has since caught up with TFT_eSPI in performance, and surpassed it in device support. There is also ArduinoGFX and LovyanGFX.

I've already added those facts to the wiki for this subreddit some time ago.

The issue is that people keep using TFT_eSPI despite it not being maintained, and having issues on newer ESP32s.

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.

1

u/honeyCrisis Aug 19 '26

This thread is almost 9 months old. I don't care what you use. I offered many suggestions in lieu of TFT_eSPI because it was not being maintained for at least a year.

Since then, Bodmer has returned, and begun maintaining, including closing show stopping issues that this post was about which were occurring on the S3.

So you're a bit late to the party.

I don't care if you use my libs or not. I really don't. I didn't write them for you. I wrote them for me. If other people use them, great. If not, fine.

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.

3

u/honeyCrisis Dec 31 '25

For the most part I pointed out facts. Software needs to be maintained. Once it's not it, it becomes problematic to use.

3

u/its-darsh Dec 31 '25

You're totally right, if a person's library is good, trash talking other's won't make it even better.

2

u/honeyCrisis Dec 31 '25

What did I say specifically that was trash talking and not simply stating a fact?

Your friend couldn't come up with anything. Calling his graphics 1990s retro? Is that why you're taking the time to comment?

→ More replies (7)
→ More replies (8)

2

u/honeyCrisis Dec 31 '25

Adding, if Bodmer cared about what other people were saying about his library, he'd maintain it and close his open issues.

He clearly doesn't. You've expressed more concern over his project than he has in over a year. Maybe reflect on that.

→ More replies (4)

0

u/[deleted] Dec 31 '25

3

u/honeyCrisis Dec 31 '25

Well, firstly this lib already has a configured P4 panel - the Waveshare P4 Smart86Box with a 720x720 MIPI display, so it should work.

As far as platformio dropping support, I've heard that too, and yet the ESP-IDF updates keep coming, a little behind the latest release as usual, but updating. Rock and roll is dead. Long live rock and roll.

As far as long term plans, this will build in other environments, I simply haven't packaged it up as an Arduino** library or ESP-IDF component yet. You should still be able to download it and include the files in your project manually in those cases and it will build. I'm not really focused on Arduino support because it's such an inferior platform on the ESP32, but I have an eye toward it, and with enough insistence I could be prodded into providing full support for it.

** Arduino and the ESP-IDF, while running concurrently, are not quite compatible in how they communicate over MMC, SPI and I2C. Ergo, if you use SD, SPI. or I2C devices and this lib with arduino, they will have to be esp-idf components if they share a bus with one of the configured devices in panels.h or custom_panel.h. It also exposes the SD functionality through C stdio and C POSIX calls, which I've set LVGL for in the example project, but is incompatible with Arduino libs that expect a File object. If I do support Arduino, I will wrap a File object around POSIX FS calls so you can use this more completely with Arduino.

→ More replies (2)
→ More replies (1)