ESP32 C6 LCD+Touch screen

Hello,

I am trying to setup a ESP32 C6 Board with built in screen and touch: ESP32 C6 Development board 1.9 inch LCD display 1.9inch Screen 172×320 With SD slot RGB LED QMI8658 6-Axis-Sensor ST7789 CST816

Tried running a hello world:

esphome:
  name: esphome-web-ae7814
  friendly_name: Air Quality C6
  min_version: 2025.9.0
  name_add_mac_suffix: false

esp32:
  variant: esp32c6
  framework:
    type: esp-idf

# Enable logging
logger:

# Enable Home Assistant API
api:

# Allow Over-The-Air updates
ota:
- platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password


font:
  - file: "gfonts://Roboto"
    id: roboto
    size: 20

spi:
  id: spi2_bus
  clk_pin: 5      # PIN_NUM_CLK
  mosi_pin: 4
  miso_pin: 19    # PIN_NUM_MISO (optional, used for SD card)
  # Note: CS is usually configured per-device (see display/sd card below)

# Example device using that bus (adjust platform to your panel driver)
display:
  - platform: st7789v          # replace with actual supported driver (sh8601 not native in ESPHome)
    spi_id: spi2_bus
    model: Waveshare 1.47in 172X320
    cs_pin: 7                 # PIN_NUM_CS
    dc_pin: 6                 # PIN_NUM_DC
    reset_pin: 14             # PIN_NUM_RST
    backlight_pin: 15 
    lambda: |-
      it.print(0, 0, id(roboto), "Hello World!");

But the screen will not turn on at all. I went through their examples here and they do work when flashing the board, so there is no hardware issue. I am puzzled because i use the same PIN numbers as per the example code.

Any help is greatly appreciated. Could it be that the variant is somehow messing up the pin mappings?

What is the “example here”?
What do you get on logs?

Did a bit of copilot help.
Small update, got the hello world to work:
Looks like there is some mismatch with the Backlight pin. I tried

backlight_pin: no

and it seems to have fixed the issue!

Now sadly when going to the next step of installing LVGL i get memory allocation error :frowning:

This is the working code:

esphome:
  name: esphome-web-ae7814
  friendly_name: Air Quality C6
  min_version: 2025.9.0
  name_add_mac_suffix: false

esp32:
  variant: esp32c6
  framework:
    type: esp-idf

# Enable logging
logger:
  level: VERBOSE

# Enable Home Assistant API
api:

# Allow Over-The-Air updates
ota:
- platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password


font:
  - file: "gfonts://Roboto"
    id: roboto
    size: 20

spi:
  id: spi2_bus
  clk_pin: GPIO05     
  mosi_pin: GPIO4
  miso_pin: GPIO19   



display:
  - platform: st7789v         
    spi_id: spi2_bus
    model: Waveshare 1.47in 172X320
    cs_pin: GPIO07                 # PIN_NUM_CS
    dc_pin: GPIO06                 # PIN_NUM_DC
    reset_pin: GPIO14             # PIN_NUM_RST
    backlight_pin: no
    lambda: |-
      it.print(0, 0, id(roboto), "Hello World!");

Update: did some more testing, looks like GPIO15 is correct for LCD backlight but the polarity is inverted compared to what the st7789v library is expecting, so it was turning it off at boot.