ESP32-S3 TFT tutorial ?

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
jimk123
 
Posts: 708
Joined: Sun Dec 26, 2010 7:04 pm

ESP32-S3 TFT tutorial ?

Post by jimk123 »

I recently bought a ESP32-S3 TFT https://www.adafruit.com/product/5483 and trying to do a simple led blink and display something like 'hello world' on the display using Arduino. I saw there was a detailed tutorial for the S2 TFT here: (could not find one for the S3 TFT)

https://learn.adafruit.com/adafruit-esp ... r?view=all

I was trying those examples to blink the led and use the TFT but nothing happens.

as part of testing this I upgraded boards mgr ESP32 to 2.0.4 (it added support for adafruit esp32-s3 tft board). In the IDE I selected 'Adafruit ESP32-S3 TFT Feather'

I saw in the tutorial for the S2 it talked about manually pushing the boot/reset button but my sketch seems to upload ok :

Sketch uses 250189 bytes (19%) of program storage space. Maximum is 1310720 bytes.
Global variables use 21040 bytes (6%) of dynamic memory, leaving 306640 bytes for local variables. Maximum is 327680 bytes.
Forcing reset using 1200bps open/close on port COM18
PORTS {COM14, COM18, } / {COM14, COM18, } => {}
PORTS {COM14, COM18, } / {COM14, COM18, } => {}
PORTS {COM14, COM18, } / {COM14, COM18, } => {}
PORTS {COM14, COM18, } / {COM14, COM18, } => {}
PORTS {COM14, COM18, } / {COM14, COM18, } => {}
PORTS {COM14, COM18, } / {COM14, COM18, } => {}
PORTS {COM14, COM18, } / {COM14, COM18, } => {}
PORTS {COM14, COM18, } / {COM14, COM18, } => {}
PORTS {COM14, COM18, } / {COM14, COM18, } => {}
PORTS {COM14, COM18, } / {COM14, COM18, } => {}
PORTS {COM14, COM18, } / {COM14, COM18, } => {}
PORTS {COM14, COM18, } / {COM14, COM18, } => {}
PORTS {COM14, COM18, } / {COM14, COM18, } => {}
PORTS {COM14, COM18, } / {COM14, COM18, } => {}
PORTS {COM14, COM18, } / {COM14, COM18, } => {}
PORTS {COM14, COM18, } / {COM14, COM18, } => {}
PORTS {COM14, COM18, } / {COM14, COM18, } => {}
PORTS {COM14, COM18, } / {COM14, COM18, } => {}
PORTS {COM14, COM18, } / {COM14, COM18, } => {}
PORTS {COM14, COM18, } / {COM14, COM18, } => {}
Uploading using selected port: COM18
C:\Users\..........\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\3.3.0/esptool.exe --chip esp32s3 --port COM18 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x0 C:\Users\..........\AppData\Local\Temp\arduino_build_605802/esp32-s3-tft.ino.bootloader.bin 0x8000 C:\Users\..........\AppData\Local\Temp\arduino_build_605802/esp32-s3-tft.ino.partitions.bin 0xe000 C:\Users\..........\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.4/tools/partitions/boot_app0.bin 0x10000 C:\Users\..........\AppData\Local\Temp\arduino_build_605802/esp32-s3-tft.ino.bin 0x2d0000 C:\Users\..........\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.4/variants/adafruit_feather_esp32s3_tft/tinyuf2.bin
esptool.py v3.3
Serial port COM18
Connecting...
Chip is ESP32-S3
Features: WiFi, BLE
Crystal is 40MHz
MAC: f4:12:fa:59:d3:c4
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x0004dfff...
Flash will be erased from 0x002d0000 to 0x002fdfff...
Compressed 22784 bytes to 14353...
Writing at 0x00000000... (100 %)
Wrote 22784 bytes (14353 compressed) at 0x00000000 in 0.5 seconds (effective 391.2 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 136...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (136 compressed) at 0x00008000 in 0.1 seconds (effective 441.8 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 571.9 kbit/s)...
Hash of data verified.
Compressed 250576 bytes to 142974...
Writing at 0x00010000... (11 %)
Writing at 0x0001cdb8... (22 %)
Writing at 0x00022c65... (33 %)
Writing at 0x0002836d... (44 %)
Writing at 0x0002d72b... (55 %)
Writing at 0x00032be4... (66 %)
Writing at 0x0003b325... (77 %)
Writing at 0x00043507... (88 %)
Writing at 0x00048d69... (100 %)
Wrote 250576 bytes (142974 compressed) at 0x00010000 in 3.4 seconds (effective 590.6 kbit/s)...
Hash of data verified.
Compressed 185296 bytes to 119262...
Writing at 0x002d0000... (12 %)
Writing at 0x002d78a5... (25 %)
Writing at 0x002de652... (37 %)
Writing at 0x002e5216... (50 %)
Writing at 0x002eadbb... (62 %)
Writing at 0x002f07e2... (75 %)
Writing at 0x002f5817... (87 %)
Writing at 0x002fb80e... (100 %)
Wrote 185296 bytes (119262 compressed) at 0x002d0000 in 2.6 seconds (effective 568.3 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

thanks

User avatar
jimk123
 
Posts: 708
Joined: Sun Dec 26, 2010 7:04 pm

Re: ESP32-S3 TFT tutorial ?

Post by jimk123 »

I closed the IDE and was getting ready to logoff and unplugged the USB cable to the ESP32-S3 TFT and I decided to plug the USB cable back in and the onboard LED started to blink (which was the last sketch I loaded) I re-opened the IDE and uploaded it again and found I have to push the RESET button after uploading. Is this expected ?

Then I added some more code to the example to test the TFT display but still cannot get that to work (see attached code)

Also I noticed after uploading the port number seems to change in the IDE and I have to reselect it to upload again.

thanks

Code: Select all

// tested 8/8/22
// Adafruit ESP32-S3 TFT Feather - 4MB Flash, 2MB PSRAM, STEMMA QT Product ID: 5483
#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
#include <SPI.h>

// Use dedicated hardware SPI pins
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);
// the setup function runs once when you press reset or power the board
void setup() {
  // initialize built in LED pin as an output.
  pinMode(LED_BUILTIN, OUTPUT);
  // initialize USB serial converter so we have a port created
  
  Serial.begin(115200);
  delay(500);
  Serial.print(F("Hello! Feather TFT Test"));

  // turn on backlite
  pinMode(TFT_BACKLITE, OUTPUT);
  digitalWrite(TFT_BACKLITE, HIGH);

  // turn on the TFT / I2C power supply
  pinMode(TFT_I2C_POWER, OUTPUT);
  digitalWrite(TFT_I2C_POWER, HIGH);
  delay(10);

  // initialize TFT
  tft.init(135, 240); // Init ST7789 240x135
  tft.setRotation(3);
  

  Serial.println(F("Initialized"));

  tft.fillScreen(ST77XX_BLACK);
  testdrawtext("hello world ", ST77XX_WHITE);
  delay(1000);
  tftPrintTest();
  delay(4000);
  
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}

void testdrawtext(char *text, uint16_t color) {
  tft.setCursor(0, 0);
  tft.setTextColor(color);
  tft.setTextWrap(true);
  tft.print(text);
}

void tftPrintTest() {
  tft.setTextWrap(false);
  tft.fillScreen(ST77XX_BLACK);
  tft.setCursor(0, 30);
  tft.setTextColor(ST77XX_RED);
  tft.setTextSize(1);
  tft.println("Hello World!");
  tft.setTextColor(ST77XX_YELLOW);
  tft.setTextSize(2);
  tft.println("Hello World!");
  tft.setTextColor(ST77XX_GREEN);
  tft.setTextSize(3);
  tft.println("Hello World!");
  tft.setTextColor(ST77XX_BLUE);
  tft.setTextSize(4);
  tft.print(1234.567);
  delay(1500);
  tft.setCursor(0, 0);
  tft.fillScreen(ST77XX_BLACK);
  tft.setTextColor(ST77XX_WHITE);
  tft.setTextSize(0);
  tft.println("Hello World!");
  tft.setTextSize(1);
  tft.setTextColor(ST77XX_GREEN);
  
}


User avatar
jimk123
 
Posts: 708
Joined: Sun Dec 26, 2010 7:04 pm

Re: ESP32-S3 TFT tutorial ?

Post by jimk123 »

after re-reading the S2 tutorial it says "However, after uploading your Arduino code you MUST press reset to start the sketch" so that answers one of my questions.

Still trying to figure out why the tft display does not work.

User avatar
nemuzzy
 
Posts: 3
Joined: Tue Feb 10, 2015 12:53 pm

Re: ESP32-S3 TFT tutorial ?

Post by nemuzzy »

I am also trying to bring an S3 w/ display (Product ID 5483) to life.

I can get the blink program to life, so I know that I have been able to connect the feather to the computer. Uploaded the graphicstest_feather_esp32s2_tft sketch from the examples folder, and I now have blinky display!

Now I need to try to port the display commands into a sketch where I was using the HUZZAH32 (Product ID 3405) plus the Featherwing OLED display (Product id 4650). I like the built in display and the price is right, but the documentation for the 5483 is a bit obscure!

User avatar
jimk123
 
Posts: 708
Joined: Sun Dec 26, 2010 7:04 pm

Re: ESP32-S3 TFT tutorial ?

Post by jimk123 »

thanks for the post and I feel better I am not the only one having the issue. I used that same sample code for testing also. Curious if when you load the the sketch after a minute or so if you touch the TFT display does it feel slightly warm ? Even though nothing is displayed I took that as a good sign it is getting power.
thanks

User avatar
adafruit_support_carter
 
Posts: 29168
Joined: Tue Nov 29, 2016 2:45 pm

Re: ESP32-S3 TFT tutorial ?

Post by adafruit_support_carter »

Sorry, yah, there's no dedicated guide yet for that specific Feather. This has been noted and one will be written up. The ESP32-S3 TFT Feather is very similar to the ESP32-S2 TFT, so a lot of things should "just work" in the same fashion.

@nemuzzy It sounds like you got things working?

@jimk123 It sounds like maybe you still can't get TFT to work as expected? Try double pressing reset to get into bootloader mode. There should be output on the TFT when in bootloader mode. That'll at least sanity check the TFT output.

User avatar
jimk123
 
Posts: 708
Joined: Sun Dec 26, 2010 7:04 pm

Re: ESP32-S3 TFT tutorial ?

Post by jimk123 »

Hi Carter
I tried the double press on reset, the neopixel is green but nothing else happened.

btw - found this demo code: // https://learn.adafruit.com/adafruit-esp ... ipped-demo for the S2
I compiled and loaded it but same thing, the display is still blank. The display itself is slightly warm to the touch if that means anything ?
thanks

User avatar
nemuzzy
 
Posts: 3
Joined: Tue Feb 10, 2015 12:53 pm

Re: ESP32-S3 TFT tutorial ?

Post by nemuzzy »

I was able to load the file for the S2 and it ran as written.
I do have to manually reset the board after uploading the file.
I am decimating the file now to try to identify the pieces of code that I need to include in my sketch to get my program to work. Perhaps I will post that, as it is a bit easier to understand.

User avatar
jimk123
 
Posts: 708
Joined: Sun Dec 26, 2010 7:04 pm

Re: ESP32-S3 TFT tutorial ?

Post by jimk123 »

as a different test I found a esp32-s2-tft board , and as you said a double press of 'reset' brings up a green/blue screen that says feather TFT. I changed the board type in arduino to s2 tft and was able to load the demo code on the S2 and it runs ok, so it looks like my S3 is not working for some reason ?

when I double click the reset button on the s3 it does open a window in file explorer called FTHRS3BOOT with 5 files in it but the display is blank.

User avatar
jimk123
 
Posts: 708
Joined: Sun Dec 26, 2010 7:04 pm

Re: ESP32-S3 TFT tutorial ?

Post by jimk123 »

I did some digging around and found another another s3-tft board and that one worked !

Maybe the other s3 is bad ? anyway to do a hard factory reset ?

User avatar
adafruit_support_carter
 
Posts: 29168
Joined: Tue Nov 29, 2016 2:45 pm

Re: ESP32-S3 TFT tutorial ?

Post by adafruit_support_carter »

@nemuzzy Yep, sounds like things are working for you and now you're just refining the code specific to your application.

@jimk123 Blank TFT with bootloader mode active sounds suspicious. Can you please post a photo of the Feather ESP32-S3 TFT so we can look for any obvious hardware issues. Ideally, one photo of each side of the Feather.

User avatar
nemuzzy
 
Posts: 3
Joined: Tue Feb 10, 2015 12:53 pm

Re: ESP32-S3 TFT tutorial ?

Post by nemuzzy »

Here is a sketch that I have created to identify some of the basic functions. It might be a bit easier to understand.

Code: Select all

/**************************************************************************
  This is a library for several Adafruit displays based on ST77* drivers.

  Works with the Adafruit ESP32-S3 TFT Feather
    ----> http://www.adafruit.com/products/5483

  Check out the links above for our tutorials and wiring diagrams.

  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.
  MIT license, all text above must be included in any redistribution

  (NEM Modifications for testing)
 **************************************************************************/

#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
#include <SPI.h>

// Use dedicated hardware SPI pins
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);

float p = 3.1415926;

void setup(void) {
  Serial.begin(9600);
  Serial.print(F("Hello! Feather TFT Test"));

  // turn on backlite
  pinMode(TFT_BACKLITE, OUTPUT);
  digitalWrite(TFT_BACKLITE, HIGH);

  // turn on the TFT / I2C power supply
  pinMode(TFT_I2C_POWER, OUTPUT);
  digitalWrite(TFT_I2C_POWER, HIGH);
  delay(10);

  // initialize TFT
  tft.init(135, 240); // Init ST7789 240x135
  tft.setRotation(3);
  tft.fillScreen(ST77XX_BLACK);

  Serial.println(F("Initialized"));

  uint16_t time = millis();
  tft.fillScreen(ST77XX_BLACK);
  time = millis() - time;

  Serial.println(time, DEC);
  delay(500);


  // tft print function!
  tftPrintTest();
  delay(8000);

}

void loop() {
  tft.invertDisplay(true);
  delay(3000);
  //tft.invertDisplay(false);
  //delay(3000);
  tftPrintTest();
  delay(3000);
}

void tftPrintTest() {
  tft.setTextWrap(false);
  tft.fillScreen(ST77XX_BLACK);
  tft.setCursor(0, 20);
  tft.setTextColor(ST77XX_RED);
  tft.setTextSize(1);
  tft.println("Text Size 1 w/ cursor at 0,20");
  tft.setTextColor(ST77XX_YELLOW);
  tft.setTextSize(2);
  tft.println("Text Size 2");
  tft.setTextColor(ST77XX_GREEN);
  tft.setTextSize(3);
  tft.println("Text Size 3");
  tft.setTextColor(ST77XX_BLUE);
  tft.setTextSize(4);
  tft.print("And Size 4");
  tft.setCursor(10,120);
  tft.setTextColor(ST77XX_RED);
  tft.setTextSize(1);
  tft.print("Tomorrow's already the 10th, Dude!");
  delay(3000);
  tft.setCursor(0, 0);
  tft.fillScreen(ST77XX_BLACK);
  tft.setTextColor(ST77XX_WHITE);
  tft.setTextSize(0);
  tft.println("Hello World!");
  tft.setTextSize(1);
  tft.setTextColor(ST77XX_GREEN);
  tft.print(p, 6);
  tft.println(" Want pi?");
  tft.println(" ");
  tft.print(8675309, HEX); // print 8,675,309 out in HEX!
  tft.println(" Print HEX!");
  tft.println(" ");
  tft.setTextColor(ST77XX_YELLOW);
  tft.setTextSize(2);
  tft.println("Jenny?   Jenny?");
  tft.setTextSize(1);
  tft.setTextColor(ST77XX_WHITE);
  tft.println(" ");
  tft.println("Sketch has been");
  tft.println("running for: ");
  tft.setTextColor(ST77XX_MAGENTA);
  tft.print(millis() / 1000);
  tft.setTextColor(ST77XX_WHITE);
  tft.print(" seconds.");
}

I do have to manually reset the S3 after uploading the code.

User avatar
jimk123
 
Posts: 708
Joined: Sun Dec 26, 2010 7:04 pm

Re: ESP32-S3 TFT tutorial ?

Post by jimk123 »

not sure if this a valid since this is a S3 but I tried a factory reset based on some doc I found here:
https://learn.adafruit.com/adafruit-esp ... tory-reset

and dragged the .uf2 file onto the drive and did a reset but the screen is still blank and a double click of the reset button still does not display a screen. I read there is a bootloader repair but is sounds pretty technical and wanted to hold off until the adafruit tech folks commented. may just need to get a replacement board ?
thanks

User avatar
jimk123
 
Posts: 708
Joined: Sun Dec 26, 2010 7:04 pm

Re: ESP32-S3 TFT tutorial ?

Post by jimk123 »

adafruit - here are the pics of the s3 front and back
IMG_3804.jpg
IMG_3804.jpg (692 KiB) Viewed 133 times
IMG_3803.jpg
IMG_3803.jpg (807.22 KiB) Viewed 133 times
since one of my S3 TFT works and the other does not, possible hardware defect ?
thanks

User avatar
adafruit_support_carter
 
Posts: 29168
Joined: Tue Nov 29, 2016 2:45 pm

Re: ESP32-S3 TFT tutorial ?

Post by adafruit_support_carter »

@jimk123 Thanks for the photos. Nothing obvious. And sounds like you have a second one that works as expected. Let's just replace the problematic Feather.

Send an email to [email protected] with a link to this thread and your order number and they can send you a replacement Feather ESP32-S3 TFT.

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”