Using ESP32s3 with touch display compile problems

hi
i'm using JC8048W550 and when i compile the hello world on TFT sample i get the following errors and i don't know where to search to get rid of them:

C:\Users\hape\Documents\Arduino\3_3-1_TFT_HelloWorld\HelloWorld\HelloWorld.ino:19:1: error: 'Arduino_ESP32RGBPanel' does not name a type; did you mean 'Arduino_ESP32S2PAR8Q'?
19 | Arduino_ESP32RGBPanel *bus = new Arduino_ESP32RGBPanel(
| ^~~~~~~~~~~~~~~~~~~~~
| Arduino_ESP32S2PAR8Q
C:\Users\hape\Documents\Arduino\3_3-1_TFT_HelloWorld\HelloWorld\HelloWorld.ino:28:2: error: 'Arduino_RPi_DPI_RGBPanel' does not name a type

Code is simple:

/*******************************************************************************
 ******************************************************************************/
#include <Arduino_GFX_Library.h>

#define GFX_BL DF_GFX_BL // default backlight pin, you may replace DF_GFX_BL to actual backlight pin
#define TFT_BL 2
/* More dev device declaration: https://github.com/moononournation/Arduino_GFX/wiki/Dev-Device-Declaration */
#if defined(DISPLAY_DEV_KIT)
Arduino_GFX *gfx = create_default_Arduino_GFX();
#else /* !defined(DISPLAY_DEV_KIT) */

/* More data bus class: https://github.com/moononournation/Arduino_GFX/wiki/Data-Bus-Class */
//Arduino_DataBus *bus = create_default_Arduino_DataBus();

/* More display class: https://github.com/moononournation/Arduino_GFX/wiki/Display-Class */
//Arduino_GFX *gfx = new Arduino_ILI9341(bus, DF_GFX_RST, 0 /* rotation */, false /* IPS */);

Arduino_ESP32RGBPanel *bus = new Arduino_ESP32RGBPanel(
    GFX_NOT_DEFINED /* CS */, GFX_NOT_DEFINED /* SCK */, GFX_NOT_DEFINED /* SDA */,
    40 /* DE */, 41 /* VSYNC */, 39 /* HSYNC */, 42 /* PCLK */,
    45 /* R0 */, 48 /* R1 */, 47 /* R2 */, 21 /* R3 */, 14 /* R4 */,
    5 /* G0 */, 6 /* G1 */, 7 /* G2 */, 15 /* G3 */, 16 /* G4 */, 4 /* G5 */,
    8 /* B0 */, 3 /* B1 */, 46 /* B2 */, 9 /* B3 */, 1 /* B4 */
);
// option 1:
// ST7262 IPS LCD 800x480
 Arduino_RPi_DPI_RGBPanel *gfx = new Arduino_RPi_DPI_RGBPanel(
   bus,
   800 /* width */, 0 /* hsync_polarity */, 8 /* hsync_front_porch */, 4 /* hsync_pulse_width */, 8 /* hsync_back_porch */,
   480 /* height */, 0 /* vsync_polarity */, 8 /* vsync_front_porch */, 4 /* vsync_pulse_width */, 8 /* vsync_back_porch */,
   1 /* pclk_active_neg */, 16000000 /* prefer_speed */, true /* auto_flush */);

#endif /* !defined(DISPLAY_DEV_KIT) */
/*******************************************************************************
 * End of Arduino_GFX setting
 ******************************************************************************/

void setup(void)
{
    gfx->begin();
    gfx->fillScreen(BLACK);

#ifdef TFT_BL
    pinMode(TFT_BL, OUTPUT);
    digitalWrite(TFT_BL, HIGH);
#endif

    gfx->setCursor(10, 10);
    gfx->setTextColor(RED);
    gfx->println("Hello World!");

    delay(5000); // 5 seconds
}

void loop()
{
    gfx->setCursor(random(gfx->width()), random(gfx->height()));
    gfx->setTextColor(random(0xffff), random(0xffff));
    gfx->setTextSize(random(6) /* x scale */, random(6) /* y scale */, random(2) /* pixel_margin */);
    gfx->println("Hello World!");

    delay(2000); // 1 second
}

Does this give any clues?

Apparently it's a tricky one to get to work.

A quick Google suggests there are at least two libraries you could use:

I think the thread linked to above uses the second. Your example seems to be assuming that one as well.

Maybe @cedarlakeinstruments can comment as he has apparently worked with this display controller.

hi rsmls
i will take a look and come back with more problems or with the success story :slight_smile:
thx for the fast help
regards
hape

1 Like

The moononournation one seems to be the more popular. Also checkout the CheapYellowDisplay github project to see if yours is one of those supported. Lots of resources available there.

hi @cedarlakeinstruments
thx a lot for your fast response
with the GFX library you mentioned (1.2.8) i get:

In file included from c:\Users\hape\Documents\Arduino\libraries\GFX_Library_for_Arduino\src/Arduino_GFX_Library.h:4,
from C:\Users\hape\Documents\Arduino\3_3-1_TFT_HelloWorld\HelloWorld\HelloWorld.ino:3:
c:\Users\hape\Documents\Arduino\libraries\GFX_Library_for_Arduino\src/Arduino_DataBus.h:160:13: error: 'i80_device_list' has not been declared
160 | LIST_HEAD(i80_device_list, lcd_panel_io_i80_t)
| ^~~~~~~~~~~~~~~
c:\Users\hape\Documents\Arduino\libraries\GFX_Library_for_Arduino\src/Arduino_DataBus.h:160:3: error: ISO C++ forbids declaration of 'LIST_HEAD' with no type [-fpermissive]
160 | LIST_HEAD(i80_device_list, lcd_panel_io_i80_t)
| ^~~~~~~~~
c:\Users\hape\Documents\Arduino\libraries\GFX_Library_for_Arduino\src/Arduino_DataBus.h:160:48: error: expected ';' at end of member declaration
160 | LIST_HEAD(i80_device_list, lcd_panel_io_i80_t)
| ^
| ;
c:\Users\hape\Documents\Arduino\libraries\GFX_Library_for_Arduino\src/Arduino_DataBus.h:161:3: error: 'device_list' does not name a type
161 | device_list; // Head of i80 device list
| ^~~~~~~~~~~
c:\Users\hape\Documents\Arduino\libraries\GFX_Library_for_Arduino\src/Arduino_DataBus.h:195:3: error: ISO C++ forbids declaration of 'LIST_ENTRY' with no type [-fpermissive]
195 | LIST_ENTRY(lcd_panel_io_i80_t)
| ^~~~~~~~~~
c:\Users\hape\Documents\Arduino\libraries\GFX_Library_for_Arduino\src/Arduino_DataBus.h:195:32: error: expected ';' at end of member declaration
195 | LIST_ENTRY(lcd_panel_io_i80_t)
| ^
| ;
c:\Users\hape\Documents\Arduino\libraries\GFX_Library_for_Arduino\src/Arduino_DataBus.h:196:3: error: 'device_list_entry' does not name a type
196 | device_list_entry; // Entry of i80 device list
| ^~~~~~~~~~~~~~~~~
In file included from c:\Users\hape\Documents\Arduino\libraries\GFX_Library_for_Arduino\src/Arduino_GFX_Library.h:14:
c:\Users\hape\Documents\Arduino\libraries\GFX_Library_for_Arduino\src/databus/Arduino_ESP32RGBPanel.h:43:3: error: 'esp_lcd_rgb_panel_frame_trans_done_cb_t' does not name a type; did you mean 'esp_lcd_panel_io_color_trans_done_cb_t'?
43 | esp_lcd_rgb_panel_frame_trans_done_cb_t on_frame_trans_done; // Callback, invoked after frame trans done
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| esp_lcd_panel_io_color_trans_done_cb_t

exit status 1

Compilation error: exit status 1

instead of the error:

'Arduino_ESP32RGBPanel' does not name a type

so that changed the error in another direction but is not the solution. Any other ideas?

regards
hape

No idea. I just checked one of my projects and I'm also using version 1.2.8 but it all builds fine.
What ESP32 version do you have selected? I'm using platformio on this project with the following config, but as far as I remember, it worked just as well with the Arduino IDE

[env:esp32s3box]
platform = espressif32
board = esp32s3box
framework = arduino
monitor_speed = 115200
lib_deps =
moononournation/GFX Library for Arduino@1.2.8

I edited out some other libraries, but they are not needed for the GFX lib

and your nice suggestion above i think doesn't work because the driver chip is St7262
i take a look in the GitHub and it is not in the list of drivers

[env:esp32s3box]
platform = espressif32
board = esp32s3box
framework = arduino
monitor_speed = 115200
lib_deps =
moononournation/GFX Library for Arduino@1.2.8

i use ESP32S3 Dev Module which is also desccribed as correct in the "User Manual"
and that are the other parameter:
image

so i will take a look at PlatformIO and give this a try

so finally i get this to work if someone gets in the same problem:

1.) use ESP32 v2 Board Manager not the V3 like you need for ESP32-C6
2.) install the latest GFX Library for Arduino (moononournation) - do not use the libraries which are in the rar you can download
3.) take the example PDQgraphicstest.ino
4.) change in Arduino_GFX_dev_device.h the 9th line to "#define ESP32_4827S043" (so uncomment it)
5. comment line 119 to 128 (option 1 for ILI6485)
6. uncomment line 131 to 140 (option 2 for ST7262)
7. choose ESP32S3 as board (with coorect USB port
8. change as mentioned in the "User Manual" the Flash size to 16MB (128 MB) and the PSRAM to "OPI PSRAM"
9. compile and voilà it works

hape

2 Likes

Lovely, thanks for posting back and good to hear you got it to run!

Greetings,
I have one of the 5" esp32-smart display and trying to port the VNC code (GitHub - moononournation/ArduinoVNC: Enhance from https://github.com/Links2004/arduinoVNC.git).
In the process, I overwrote the demo code! It is now showing nothing. It seems that you managed to get this board working.
Haven't done this in 30 plus years, but I am trying to get my grandsons interested. **Any help is appreciated. **

hi

I have one of the 5" esp32-smart display
they are all different which one? (Link pls)
You overwrite the code - ok there seems to be an error
hape

Hi,
It is the ESP32-8048S050 smart display that uses the ST7262 driver chip, a 16 bit parallel interface for 800X480 TFT-LCD.
I followed what you recommended a week ago, except I un-commented
#define ESP32_8048S070 (changed it to ESP32-8048S050 instead). I got errors about type and scope such as:

Compilation error: 'Arduino_ESP32RGBPanel' does not name a type; did you mean 'Arduino_ESP32S2PAR8Q'?

C:\Users\ramez\Documents\Arduino\PDQgraphicstest\Arduino_GFX_dev_device.h:178:1: error: 'Arduino_RGB_Display' does not name a type
  178 | Arduino_RGB_Display *gfx = new Arduino_RGB_Display(
      | ^~~~~~~~~~~~~~~~~~~

C:\Users\ramez\Documents\Arduino\PDQgraphicstest\PDQgraphicstest.ino: In function 'void setup()':
C:\Users\ramez\Documents\Arduino\PDQgraphicstest\PDQgraphicstest.ino:52:8: error: 'gfx' was not declared in this scope
   52 |   if (!gfx->begin())
      |        ^~~

Thanks
RG

you have to use Board Manager V2.x.x not V3.x.x from ESP. It seems to be incompatible. I also use the GFX 8.x.x not 9.x.x.

Hi,
Well, I found something that worked with my current IDE at GitHub - rzeldent/esp32-smartdisplay-demo: Demo project for esp32-smartdisplay
So, the board is doing something! However, it didn't solve my issue of implementing vnc on it.
Thanks
RG

Thanks for the working recipe!
I was very annoyed at how much effort was required to establish that the demo's that are linked to the board from the manufacturer do not work out of the box! If the manufacturer would at least update the product demo, if only!
Anyhow thanks again!

i am facing the same issue here

Hi,
I bought some days ago a nontouch ESP32S3 with 800x480 integrated display which is identified as ESP32-8048S050. I tried to use the examples that the vendor suggests but I was not even able to display "Hello World" and I got several compiling errors probably related to the fact (as outlined by

Then I tried the suggestion derived by the efforts of the forumer

but again in my hands without any result.
Since I am an old(74) newbie at the present I'm stuck with the problem how to modify the Arduino_GFX_dev_device.h contained in the example PDQgraphictest. In fact my board is not included in the list of the supoported ones and I have also tried to define it as a ESP32_8048S043 or a ESP32_8048S070 but it didn't work, In the example clock.ino that is given by the vendor ( and that causes a compiling error) it seems that the board is defined as a RPI_DPI_RGB
Here is the code

   Arduino Watch Lite Version
   You may find full version at: https://github.com/moononournation/ArduinoWatch
*/

/*******************************************************************************

 ******************************************************************************/
#include <Arduino_GFX_Library.h>

#define GFX_BL DF_GFX_BL // default backlight pin, you may replace DF_GFX_BL to actual backlight pin
#define TFT_BL 2
/* More dev device declaration: https://github.com/moononournation/Arduino_GFX/wiki/Dev-Device-Declaration */
#if defined(DISPLAY_DEV_KIT)
Arduino_GFX *gfx = create_default_Arduino_GFX();
#else /* !defined(DISPLAY_DEV_KIT) */

/* More data bus class: https://github.com/moononournation/Arduino_GFX/wiki/Data-Bus-Class */
//Arduino_DataBus *bus = create_default_Arduino_DataBus();

/* More display class: https://github.com/moononournation/Arduino_GFX/wiki/Display-Class */
//Arduino_GFX *gfx = new Arduino_ILI9341(bus, DF_GFX_RST, 0 /* rotation */, false /* IPS */);
Arduino_ESP32RGBPanel *bus = new Arduino_ESP32RGBPanel(
    GFX_NOT_DEFINED /* CS */, GFX_NOT_DEFINED /* SCK */, GFX_NOT_DEFINED /* SDA */,
    40 /* DE */, 41 /* VSYNC */, 39 /* HSYNC */, 42 /* PCLK */,
    45 /* R0 */, 48 /* R1 */, 47 /* R2 */, 21 /* R3 */, 14 /* R4 */,
    5 /* G0 */, 6 /* G1 */, 7 /* G2 */, 15 /* G3 */, 16 /* G4 */, 4 /* G5 */,
    8 /* B0 */, 3 /* B1 */, 46 /* B2 */, 9 /* B3 */, 1 /* B4 */
);
// option 1:
// ST7262 IPS LCD 800x480
 Arduino_RPi_DPI_RGBPanel *gfx = new Arduino_RPi_DPI_RGBPanel(
   bus,
   800 /* width */, 0 /* hsync_polarity */, 8 /* hsync_front_porch */, 4 /* hsync_pulse_width */, 8 /* hsync_back_porch */,
   480 /* height */, 0 /* vsync_polarity */, 8 /* vsync_front_porch */, 4 /* vsync_pulse_width */, 8 /* vsync_back_porch */,
   1 /* pclk_active_neg */, 16000000 /* prefer_speed */, true /* auto_flush */);
  

#endif /* !defined(DISPLAY_DEV_KIT) */
/*******************************************************************************
 * End of Arduino_GFX setting
 ******************************************************************************/

So I'm really finding this situation very confusing and - after two days of useless efforts - I'm asking if someone has succeeded in having this board working and can help me.
One more thing: I've sen in this discussion that a library working with Platform IO and LVGL supports this board but I'd be very grateful if you could suggest me a solution with GFX Arduino library . Thanks for your help.

The trick to adapting these demos (and others) is to make sure the ESP32 is wired to the display according to the Arduino_ESP32RGBPanel definition, or rather, the definition matches the wiring of the hardware you are using.
I can only speak for the PDQgraphicstest demo which verifies the required wiring for my display ESP32_8048S070, which I have used to adapt Elecrow demos, more on that in a minute.
So in in Arduino_GFX_dev_device.h we have
#define ESP32_8048S070
comment this out and make an entry for you 050 board, instead ie #define ESP32_8048S050.
then further down in the file:

#elif defined(ESP32_8048S070)
#define GFX_DEV_DEVICE ESP32_8048S070
#define GFX_BL 2
Arduino_ESP32RGBPanel *rgbpanel = new Arduino_ESP32RGBPanel(
    41 /* DE */, 40 /* VSYNC */, 39 /* HSYNC */, 42 /* PCLK */,
    14 /* R0 */, 21 /* R1 */, 47 /* R2 */, 48 /* R3 */, 45 /* R4 */,
    9 /* G0 */, 46 /* G1 */, 3 /* G2 */, 8 /* G3 */, 16 /* G4 */, 1 /* G5 */,
    15 /* B0 */, 7 /* B1 */, 6 /* B2 */, 5 /* B3 */, 4 /* B4 */,
    0 /* hsync_polarity */, 180 /* hsync_front_porch */, 30 /* hsync_pulse_width */, 16 /* hsync_back_porch */,
    0 /* vsync_polarity */, 12 /* vsync_front_porch */, 13 /* vsync_pulse_width */, 10 /* vsync_back_porch */);
Arduino_RGB_Display *gfx = new Arduino_RGB_Display(
    800 /* width */, 480 /* height */, rgbpanel, 0 /* rotation */, true /* auto_flush */);

Copy and paste this underneath where it is, but change ESP32_8048S070 to ESP32_8048S050.
Download and open the schematics for your board. Notice the comments in the definition identify the display connection (signal name eg "DE", etc.) with the arduino pin number in the definition. If you need extra clarity you can compare the schematic from here http://pan.jczn1688.com/directlink/1/ESP32%20module/7.0inch_ESP32-8048S070.zip (its an unsecured download so your browser will probably flag it as risky, its simply a zip file with various doc's and code like you would have got with your board). Compare the wiring diagram to the above definition, then do the same with your definition, changing any pin numbers as necessary.
I've used this procedure to adapt to the elecrow panel examples which means I was able to follow their youtube tutorials https://www.youtube.com/watch?v=WHfPH-Kr9XU&list=PLwh4PlcPx2Ge-h-Pfsa7juFeWMgXmv8lc&pp=iAQB which has opened up LVGL and Squareline Studio which is lightyears ahead of where I imaged I would get to with this stuff.
I am not young either, and I spent many days trying to progress with this stuff until it finally, gradually yielded, good luck!