Enable USB CDC to log "hello world" to ESP32-S3 dev board for ESPHome

Hello there! I am a total newbie for ESPHome.

Problem

I am trying to log “hello world” to my dev board via the command line option esphome run hello.yaml, but I have been unsuccessful.

Versions and board

  1. macOS Monterey 12.6
  2. Python: 3.10.6
  3. pip3 version: 22.2.2
  4. esphome version: 2022.8.3
  5. ESP32-S3-DevKitC-1-N8R2, the official dev board from Espressif
  6. Arduino ESP32 package install 2.0.4

What works

I successfully uploaded a simple hello world to the board ESP32-S3-DevKitC-1 via the Arduino IDE with ESP32 Arduino 2.0.4.

I have also successfully compiled and uploaded to the board the following complete YAML file:

esphome:
  name: hello

esp32:
  board: esp32dev
  variant: ESP32S3
  framework:
    type: arduino

logger:
  level: DEBUG
  baud_rate: 0

The final terminal output lines are:

Hard resetting via RTS pin...
INFO Successfully uploaded program.
INFO UART logging is disabled (baud_rate=0). Not starting UART logs.

What does not work

But, when I try to log it gives an error. The YAML file is:

esphome:
  name: hello

  on_boot:
    then:
      - logger.log: "Hello World"

esp32:
  board: esp32dev
  variant: ESP32S3
  framework:
    type: arduino

logger:
  level: DEBUG
  baud_rate: 115200

The final terminal output is:

Leaving...
Hard resetting via RTS pin...
INFO Successfully uploaded program.
INFO Starting log output from /dev/cu.usbmodem14101 with baud rate 115200
[17:16:52]Saved PC:0x40378ae8
[17:16:52]SPIWP:0xee
[17:16:52]mode:DIO, clock div:1
[17:16:52]load:0x3fce3808,len:0x43c
[17:16:52]load:0x403c9700,len:0xbec
[17:16:52]load:0x20747261,len:0x26203d3c
[17:16:52]Invalid image block, can't boot.
[17:16:52]ets_main.c 329
[17:16:54]ESP-ROM:esp32s3-20210327
[17:16:54]Build:Mar 27 2021
[17:16:54]rst:0x7 (TG0WDT_SYS_RST),boot:0x28 (SPI_FAST_FLASH_BOOT)

I have also tried tweaking the board details as suggested in another forum thread with the YAML file:

esphome:
  name: hello

  on_boot:
    then:
      - logger.log: "Hello World"

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: esp-idf
    platform_version: 4.4.0
  variant: esp32s3

logger:
  level: DEBUG
  baud_rate: 115200

The final terminal output is:

HARDWARE: ESP32S3 240MHz, 320KB RAM, 4MB Flash
 - framework-espidf @ 3.40302.0 (4.3.2)
 - tool-cmake @ 3.16.4
 - tool-ninja @ 1.9.0
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch3
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch3
Error: This board doesn't support espidf framework!
====================================== [FAILED] Took 0.58 seconds ======================================

Hunches

I don’t know whether esptool is having a problem. Another suspicion on enabling USB CDC on boot, which I had to do when uploading to this board via the Arduino IDE. Either could be completely wrong.

Please help! Thanks!