Please help on esp32_s3-ili9488-touch

Hello,

I've been 2 weeks in the project and i've been stil in the part to connect a esp32_s3-n16R8 to a ili9488 with a XPT2046 touchdriver.

The lib's i'm using are;
bodmer/TFT_eSPI@^2.5.1
paulstoffregen/XPT2046_Touchscreen

and the pins for communication are:
#define TFT_MOSI 11
#define TFT_SCLK 12
#define TFT_CS 5
#define TFT_DC 4
#define TFT_RST -1
#define TFT_MISO 13
#define TOUCH_CS 15
#define TOUCH_IRQ 16

For the code i try to startup as simple as possible in platform.io

//user_setup
#define USER_SETUP_INFO "Custom Setup for ILI9488 on ESP32-S3 with T_IRQ on 14"
#define ILI9488_DRIVER
#define TFT_MOSI  11
#define TFT_SCLK  12
#define TFT_CS    5
#define TFT_DC    4
#define TFT_RST   -1
#define TFT_MISO  13
#define TOUCH_CS  15
#define TOUCH_IRQ 16
#define TFT_WIDTH  480
#define TFT_HEIGHT 320
#define SPI_FREQUENCY       20000000  // Reduced from 40000000 for stability
#define SPI_READ_FREQUENCY  0         // Disable reads if not supported
#define SPI_TOUCH_FREQUENCY 2500000
#define LOAD_GLCD
#define LOAD_FONT4
#define USER_SETUP_LOADED 1
//main
#include <Arduino.h>
#include <TFT_eSPI.h>
#include <XPT2046_Touchscreen.h>

TFT_eSPI tft = TFT_eSPI();
#define TOUCH_CS  15
#define TOUCH_IRQ 16
XPT2046_Touchscreen ts(TOUCH_CS, TOUCH_IRQ);

void setup() {
  Serial.begin(115200);
  delay(500);
  Serial.println("Starting setup...");

  Serial.println("Before tft.init()");
  tft.init();
  delay(100);  // Add delay after init as suggested
  Serial.println("After tft.init()");
  tft.setRotation(0);
  Serial.println("After setRotation()");
  tft.fillScreen(TFT_BLACK);
  Serial.println("After fillScreen()");
  tft.setTextColor(TFT_WHITE);
  tft.setTextSize(2);
  tft.setCursor(10, 10);
  tft.println("TFT OK");
  Serial.println("TFT OK printed");

  Serial.println("Before ts.begin()");
  ts.begin();
  Serial.println("After ts.begin()");
}

void loop() {
  if (ts.touched()) {
    TS_Point p = ts.getPoint();
    Serial.printf("Touch: x=%d y=%d\n", p.x, p.y);
    tft.fillCircle(p.x, p.y, 4, TFT_RED);
    delay(200);
  } else {
    delay(50);
  }
}
//platform.ini
[env:esp32-s3]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
monitor_speed = 115200
lib_deps = 
    bodmer/TFT_eSPI@^2.5.0
    paulstoffregen/XPT2046_Touchscreen@^1.3
build_flags = 
    -DARDUINO_USB_CDC_ON_BOOT=1
    -Wl,-Map=output.map
    -DCONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
    -DCONFIG_ESP_TASK_WDT_TIMEOUT=10

I comment evry driver out of the user_setup_select file.

The only thing after compiling is this in repeat:

Rebooting...
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x42022c26
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x4bc
load:0x403c9700,len:0xbd8
load:0x403cc700,len:0x2a0c
entry 0x403c98d0
Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.

Core 1 register dump:
PC : 0x42001d51 PS : 0x00060830 A0 : 0x82001f09 A1 : 0x3fcebbd0
A2 : 0x3fc95468 A3 : 0x00000001 A4 : 0x60004000 A5 : 0x00000010
A6 : 0x3fc9690c A7 : 0x00000000 A8 : 0x08000000 A9 : 0x3fcebba0
A10 : 0x3fc9690c A11 : 0x00000001 A12 : 0xffffffff A13 : 0x00000010
A14 : 0x00000000 A15 : 0x3fc93a08 SAR : 0x0000001c EXCCAUSE: 0x0000001d
EXCVADDR: 0x00000010 LBEG : 0x42014000 LEND : 0x42014064 LCOUNT : 0x00000002

Backtrace: 0x42001d4e:0x3fcebbd0 0x42001f06:0x3fcebc00 0x420017b3:0x3fcebc30 0x4200384a:0x3fcebc50

ELF file SHA256: e99c734e52221776

The esp is this one:
Esp32

And the display is this one;
display

Is there a problem to let these 2 products work together?

Kind regards Bas

Please edit your post and add code tags to the code.
You will also need to provide a wiring diagram. It can be as simple as a photo of a hand drawn diagram.

Also wrap the Serial log in code tags.
Code tags reduce scrolling and prevent html wrong interpretation.

Try changing this:

to:
XPT2046_Touchscreen ts(TOUCH_CS);

This will show if the interrupt is causing the crash. You do not actually need interrupts and can use polling instead.

Also look at this: Platformio Release Outdated · Issue #50 · PaulStoffregen/XPT2046_Touchscreen · GitHub to see if the parameters you are using are appropriate for the version of XPT2046_Touchscreen available on PlatformIO.

I moved your topic to a more appropriate forum category @basdelouw78.

The Nano Family > Nano ESP32 category you chose is only used for discussions directly related to the Arduino Nano ESP32 board.

In the future, when creating a topic please take the time to pick the forum category that best suits the subject of your question. There is an "About the _____ category" topic at the top of each category that explains its purpose.

Thanks in advance for your cooperation.

Hello, recently we have discussed similar issues with TFT displays on ESP32-C3/S3 boards. The final conclusion of all of them is that the TFT_eSPI library does not work with the esp-board package Version later than 2.0.14. Look in your IDE in the Boardmanager (where the processor board is selected) which Version you have installed in the IDE.

1 Like

This is the discussion @galacticobmg is referring to:

@basdelouw78 you will likely find some useful information if you read through that. You can start at post #13 in that thread as the preceding posts are irrelevant.

1 Like

Thanks for your answer. In the 2.0.14 i get UnknownBoard: Unknown board ID 'esp32-s3-devkitc-1'.

Hi @basdelouw78. The reason for the error is Arduino IDE remembers the board configuration you had from the previous version of the "esp32" boards platform, but that configuration is not available in the 2.0.14 version of the platform.

Select Tools > Board > esp32 > ESP32S3 Dev Module from the Arduino IDE menus and then try compiling or uploading again. The "Unknown board ID" error should no longer occur.

Ok, managed to fix and go further on the project.

1 Like

This will only affect if larger but those need to be on separate spi buses as one of the ili9488s data lines miso or mosi dont Chang state with cs.

Sorry it later not it larger (autocorrect wars)