esp-arduino-libs / ESP32_Display_Panel

Arduino library of driving display panel for the ESP SoCs
Apache License 2.0
72 stars 16 forks source link

Arduino RGB example error for ESP32 S3 to run ST7262 display #52

Closed eagl1 closed 3 months ago

eagl1 commented 3 months ago

Hello,

I installed this library and I solved first library requirement which is esp_io_expander.h

Then I got this error, where esp_memory_utils.h is located in esp-idf-master.

In file included from E:\Programs_Files\Arduino\libraries\ESP32_Display_Panel-master\src/ESP_PanelLog.h:9,
                 from E:\Programs_Files\Arduino\libraries\ESP32_Display_Panel-master\src\lcd\ESP_PanelLcd.cpp:8:
E:\Programs_Files\Arduino\libraries\ESP32_Display_Panel-master\src/ESP_Panel_Conf_Internal.h:51:35: error: operator '!' has no right operand
 #if !ESP_PANEL_CONF_INCLUDE_INSIDE
                                   ^
E:\Programs_Files\Arduino\libraries\ESP32_Display_Panel-master\src\lcd\ESP_PanelLcd.cpp:13:10: fatal error: esp_memory_utils.h: No such file or directory
 #include "esp_memory_utils.h"
          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Error compiling for board ESP32S3 Dev Module.

So how to solve these two errors ?

eagl1 commented 3 months ago

OK, I solved esp_memory_utils.h problem by including the full file path.

But still the second error:

In file included from E:\Programs_Files\Arduino\libraries\ESP32_Display_Panel-master\src/ESP_Panel_Library.h:9,
                 from E:\Programs_Files\Arduino\libraries\ESP32_Display_Panel-master\examples\LCD\RGB\RGB.ino:42:
E:\Programs_Files\Arduino\libraries\ESP32_Display_Panel-master\src/ESP_Panel_Conf_Internal.h:51:35: error: operator '!' has no right operand
 #if !ESP_PANEL_CONF_INCLUDE_INSIDE
                                   ^
exit status 1
Error compiling for board ESP32S3 Dev Module.
Lzw655 commented 3 months ago

Hi @eagl1,

Sorry, it was a bug in the library. And I fixed it in the newest version, please update it.

BTW, if you don't want to update, it can also be resolved by copying the ESP_Panel_Conf.h into the project.

Lzw655 commented 3 months ago

The library depends on arduino-esp v3.0.x SDK. For more details, please check the docs.

eagl1 commented 3 months ago

OK, the code complied with no issues.

I uploaded the code but nothing shows on the display.

I'm using the esp32-8048S043C with the esp32 s3 and 16-bit ST7262.

I faced the same problem with GFX_Library_for_Arduino-1.4.7 library.

But the programs I upload with platformio works.

eagl1 commented 3 months ago

This is the working .json configuration from the platformio project.

{
  "build": {
    "arduino": {
      "ldscript": "esp32s3_out.ld",
      "partitions": "default_16MB.csv",
      "memory_type": "qio_opi"
    },
    "core": "esp32",
    "extra_flags": [
      "'-D ARDUINO_ESP32S3_DEV'",
      "'-D BOARD_HAS_PSRAM'",
      "'-D ARDUINO_USB_MODE=1'",
      "'-D ARDUINO_RUNNING_CORE=1'",
      "'-D ARDUINO_EVENT_RUNNING_CORE=1'",
      "'-D ARDUINO_USB_CDC_ON_BOOT=0'",
      "'-D ESP32_8048S043C'",
      "'-D DISPLAY_WIDTH=800'",
      "'-D DISPLAY_HEIGHT=480'",
      "'-D LVGL_BUFFER_PIXELS=(DISPLAY_WIDTH*DISPLAY_HEIGHT)'",
      "'-D LVGL_BUFFER_MALLOC_FLAGS=(MALLOC_CAP_SPIRAM|MALLOC_CAP_8BIT)'",
      "'-D GPIO_BCKL=2'",
      "'-D DISPLAY_ST7262_PAR'",
      "'-D ST7262_PANEL_CONFIG_CLK_SRC=LCD_CLK_SRC_PLL160M'",
      "'-D ST7262_PANEL_CONFIG_TIMINGS_PCLK_HZ=(12.5*1000000)'",
      "'-D ST7262_PANEL_CONFIG_TIMINGS_H_RES=DISPLAY_WIDTH'",
      "'-D ST7262_PANEL_CONFIG_TIMINGS_V_RES=DISPLAY_HEIGHT'",
      "'-D ST7262_PANEL_CONFIG_TIMINGS_HSYNC_PULSE_WIDTH=4'",
      "'-D ST7262_PANEL_CONFIG_TIMINGS_HSYNC_BACK_PORCH=8'",
      "'-D ST7262_PANEL_CONFIG_TIMINGS_HSYNC_FRONT_PORCH=8'",
      "'-D ST7262_PANEL_CONFIG_TIMINGS_VSYNC_PULSE_WIDTH=4'",
      "'-D ST7262_PANEL_CONFIG_TIMINGS_VSYNC_BACK_PORCH=8'",
      "'-D ST7262_PANEL_CONFIG_TIMINGS_VSYNC_FRONT_PORCH=8'",
      "'-D ST7262_PANEL_CONFIG_TIMINGS_FLAGS_HSYNC_IDLE_LOW=false'",
      "'-D ST7262_PANEL_CONFIG_TIMINGS_FLAGS_VSYNC_IDLE_LOW=false'",
      "'-D ST7262_PANEL_CONFIG_TIMINGS_FLAGS_DE_IDLE_HIGH=false'",
      "'-D ST7262_PANEL_CONFIG_TIMINGS_FLAGS_PCLK_ACTIVE_NEG=true'",
      "'-D ST7262_PANEL_CONFIG_TIMINGS_FLAGS_PCLK_IDLE_HIGH=false'",
      "'-D ST7262_PANEL_CONFIG_DATA_WIDTH=16'",
      "'-D ST7262_PANEL_CONFIG_SRAM_TRANS_ALIGN=4'",
      "'-D ST7262_PANEL_CONFIG_PSRAM_TRANS_ALIGN=64'",
      "'-D ST7262_PANEL_CONFIG_HSYNC_GPIO_NUM=39'",
      "'-D ST7262_PANEL_CONFIG_VSYNC_GPIO_NUM=41'",
      "'-D ST7262_PANEL_CONFIG_DE_GPIO_NUM=40'",
      "'-D ST7262_PANEL_CONFIG_PCLK_GPIO_NUM=42'",
      "'-D ST7262_PANEL_CONFIG_DATA_GPIO_R0=8'",
      "'-D ST7262_PANEL_CONFIG_DATA_GPIO_R1=3'",
      "'-D ST7262_PANEL_CONFIG_DATA_GPIO_R2=46'",
      "'-D ST7262_PANEL_CONFIG_DATA_GPIO_R3=9'",
      "'-D ST7262_PANEL_CONFIG_DATA_GPIO_R4=1'",
      "'-D ST7262_PANEL_CONFIG_DATA_GPIO_G0=5'",
      "'-D ST7262_PANEL_CONFIG_DATA_GPIO_G1=6'",
      "'-D ST7262_PANEL_CONFIG_DATA_GPIO_G2=7'",
      "'-D ST7262_PANEL_CONFIG_DATA_GPIO_G3=15'",
      "'-D ST7262_PANEL_CONFIG_DATA_GPIO_G4=16'",
      "'-D ST7262_PANEL_CONFIG_DATA_GPIO_G5=4'",
      "'-D ST7262_PANEL_CONFIG_DATA_GPIO_B0=45'",
      "'-D ST7262_PANEL_CONFIG_DATA_GPIO_B1=48'",
      "'-D ST7262_PANEL_CONFIG_DATA_GPIO_B2=47'",
      "'-D ST7262_PANEL_CONFIG_DATA_GPIO_B3=21'",
      "'-D ST7262_PANEL_CONFIG_DATA_GPIO_B4=14'",
      "'-D ST7262_PANEL_CONFIG_DISP_GPIO_NUM=GPIO_NUM_NC'",
      "'-D ST7262_PANEL_CONFIG_FLAGS_DISP_ACTIVE_LOW=false'",
      "'-D ST7262_PANEL_CONFIG_FLAGS_RELAX_ON_IDLE=false'",
      "'-D ST7262_PANEL_CONFIG_FLAGS_FB_IN_PSRAM=true'",
      "'-D DISPLAY_SWAP_XY=false'",
      "'-D DISPLAY_MIRROR_X=false'",
      "'-D DISPLAY_MIRROR_Y=false'",
      "'-D BOARD_HAS_TOUCH'",
      "'-D CONFIG_ESP_LCD_TOUCH_MAX_POINTS=1'",
      "'-D CONFIG_ESP_LCD_TOUCH_MAX_BUTTONS=0'",
      "'-D TOUCH_GT911_I2C'",
      "'-D GT911_I2C_HOST=I2C_NUM_0'",
      "'-D GT911_I2C_CONFIG_SDA_IO_NUM=19'",
      "'-D GT911_I2C_CONFIG_SCL_IO_NUM=20'",
      "'-D GT911_I2C_CONFIG_SDA_PULLUP_EN=GPIO_PULLUP_DISABLE'",
      "'-D GT911_I2C_CONFIG_SCL_PULLUP_EN=GPIO_PULLUP_DISABLE'",
      "'-D GT911_I2C_CONFIG_MASTER_CLK_SPEED=400000'",
      "'-D GT911_I2C_CONFIG_CLK_FLAGS=I2C_SCLK_SRC_FLAG_FOR_NOMAL'",
      "'-D GT911_IO_I2C_CONFIG_DEV_ADDR=GT911_IO_I2C_CONFIG_DEV_ADDRESS_5D'",
      "'-D GT911_IO_I2C_CONFIG_CONTROL_PHASE_BYTES=1'",
      "'-D GT911_IO_I2C_CONFIG_DC_BIT_OFFSET=0'",
      "'-D GT911_IO_I2C_CONFIG_LCD_CMD_BITS=16'",
      "'-D GT911_IO_I2C_CONFIG_LCD_PARAM_BITS=0'",
      "'-D GT911_IO_I2C_CONFIG_FLAGS_DC_LOW_ON_DATA=false'",
      "'-D GT911_IO_I2C_CONFIG_FLAGS_DISABLE_CONTROL_PHASE=true'",
      "'-D GT911_TOUCH_CONFIG_X_MAX=DISPLAY_WIDTH'",
      "'-D GT911_TOUCH_CONFIG_Y_MAX=DISPLAY_HEIGHT'",
      "'-D GT911_TOUCH_CONFIG_RST_GPIO_NUM=38'",
      "'-D GT911_TOUCH_CONFIG_INT_GPIO_NUM=18'",
      "'-D GT911_TOUCH_CONFIG_LEVELS_RESET=0'",
      "'-D GT911_TOUCH_CONFIG_LEVELS_INTERRUPT=0'",
      "'-D TOUCH_SWAP_XY=false'",
      "'-D TOUCH_MIRROR_X=false'",
      "'-D TOUCH_MIRROR_Y=false'",
      "'-D BOARD_HAS_TF'",
      "'-D TF_CS=10'",
      "'-D TF_SPI_MOSI=11'",
      "'-D TF_SPI_SCLK=12'",
      "'-D TF_SPI_MISO=13'"
    ],
    "f_cpu": "240000000L",
    "f_flash": "80000000L",
    "flash_mode": "qio",
    "hwids": [
      [
        "0x303A",
        "0x1001"
      ]
    ],
    "mcu": "esp32s3",
    "variant": "esp32s3"
  },
  "connectivity": [
    "wifi"
  ],
  "debug": {
    "openocd_target": "esp32s3.cfg"
  },
  "frameworks": [
    "arduino",
    "espidf"
  ],
  "name": "esp32-8048S043C",
  "upload": {
    "flash_size": "16MB",
    "maximum_ram_size": 327680,
    "maximum_size": 16777216,
    "use_1200bps_touch": true,
    "wait_for_upload_port": true,
    "require_upload_port": true,
    "speed": 460800
  },
  "url": "https://www.aliexpress.com/item/1005006110360174.html",
  "vendor": "Sunton"
}

So I edited the pin arrangement to the one in your arduino RGB sketch and it still not working, I'm sure there's still something missing in the code.

eagl1 commented 3 months ago

The serial monitor is continuously trying to initialize the display. This is the serial output:

image

eagl1 commented 3 months ago

OK, I checked the supported boards.

I think I have to do add a new file for the display I have esp32-8048S043C.

Lzw655 commented 3 months ago

The serial monitor is continuously trying to initialize the display. This is the serial output:

image

When using RGB LCD, ESP32-S3 needs to enable PSRAM. There are some recommended configurations in Arduino IDE.

image

Lzw655 commented 3 months ago

Sorry, I am not familiar with the Arduino_GFX library.

eagl1 commented 3 months ago

No, I'm sorry my mistake. I'm working on both libraries + platformio projects.

I did the PSRAM enable but still the same problem.

Lzw655 commented 3 months ago

Okay... That's a little strange. Could you set the Core Debug Level to Debug and check the log again? It will show the PSRAM status.

image

eagl1 commented 3 months ago

OK, I think it worked.

This is the RGB example:

image

I have another question, if I wanted to add ST7262 source code to another arduino C++ library, how to copy the init data ? because I want to add this display to TFT_eSPI library because it helps me using GUIslice software and support our college projects.

Thanks,

Lzw655 commented 3 months ago

Nice! However, I have no idea how to add this display to the TFT_eSPI library.