ESP32-S3 and ESP-IDF don't play well with USB_CDC and need USB_SERIAL_JTAG (#5929)

Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
This commit is contained in:
Clyde Stubbs 2023-12-15 11:24:52 +11:00 committed by GitHub
parent 0a188ad9d2
commit 300343ae24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 177 additions and 7 deletions

View File

@ -172,7 +172,9 @@ CONFIG_SCHEMA = cv.All(
esp8266=UART0, esp8266=UART0,
esp32=UART0, esp32=UART0,
esp32_s2=USB_CDC, esp32_s2=USB_CDC,
esp32_s3=USB_CDC, esp32_s3_idf=USB_SERIAL_JTAG,
esp32_c3_idf=USB_SERIAL_JTAG,
esp32_s3_arduino=USB_CDC,
rp2040=USB_CDC, rp2040=USB_CDC,
bk72xx=DEFAULT, bk72xx=DEFAULT,
rtl87xx=DEFAULT, rtl87xx=DEFAULT,

View File

@ -1541,6 +1541,9 @@ class SplitDefault(Optional):
esp32_s3=vol.UNDEFINED, esp32_s3=vol.UNDEFINED,
esp32_s3_arduino=vol.UNDEFINED, esp32_s3_arduino=vol.UNDEFINED,
esp32_s3_idf=vol.UNDEFINED, esp32_s3_idf=vol.UNDEFINED,
esp32_c3=vol.UNDEFINED,
esp32_c3_arduino=vol.UNDEFINED,
esp32_c3_idf=vol.UNDEFINED,
rp2040=vol.UNDEFINED, rp2040=vol.UNDEFINED,
bk72xx=vol.UNDEFINED, bk72xx=vol.UNDEFINED,
rtl87xx=vol.UNDEFINED, rtl87xx=vol.UNDEFINED,
@ -1549,22 +1552,28 @@ class SplitDefault(Optional):
super().__init__(key) super().__init__(key)
self._esp8266_default = vol.default_factory(esp8266) self._esp8266_default = vol.default_factory(esp8266)
self._esp32_arduino_default = vol.default_factory( self._esp32_arduino_default = vol.default_factory(
_get_priority_default(esp32, esp32_arduino) _get_priority_default(esp32_arduino, esp32)
) )
self._esp32_idf_default = vol.default_factory( self._esp32_idf_default = vol.default_factory(
_get_priority_default(esp32, esp32_idf) _get_priority_default(esp32_idf, esp32)
) )
self._esp32_s2_arduino_default = vol.default_factory( self._esp32_s2_arduino_default = vol.default_factory(
_get_priority_default(esp32_s2, esp32, esp32_s2_arduino, esp32_arduino) _get_priority_default(esp32_s2_arduino, esp32_s2, esp32_arduino, esp32)
) )
self._esp32_s2_idf_default = vol.default_factory( self._esp32_s2_idf_default = vol.default_factory(
_get_priority_default(esp32_s2, esp32, esp32_s2_idf, esp32_idf) _get_priority_default(esp32_s2_idf, esp32_s2, esp32_idf, esp32)
) )
self._esp32_s3_arduino_default = vol.default_factory( self._esp32_s3_arduino_default = vol.default_factory(
_get_priority_default(esp32_s3, esp32, esp32_s3_arduino, esp32_arduino) _get_priority_default(esp32_s3_arduino, esp32_s3, esp32_arduino, esp32)
) )
self._esp32_s3_idf_default = vol.default_factory( self._esp32_s3_idf_default = vol.default_factory(
_get_priority_default(esp32_s3, esp32, esp32_s3_idf, esp32_idf) _get_priority_default(esp32_s3_idf, esp32_s3, esp32_idf, esp32)
)
self._esp32_c3_arduino_default = vol.default_factory(
_get_priority_default(esp32_c3_arduino, esp32_c3, esp32_arduino, esp32)
)
self._esp32_c3_idf_default = vol.default_factory(
_get_priority_default(esp32_c3_idf, esp32_c3, esp32_idf, esp32)
) )
self._rp2040_default = vol.default_factory(rp2040) self._rp2040_default = vol.default_factory(rp2040)
self._bk72xx_default = vol.default_factory(bk72xx) self._bk72xx_default = vol.default_factory(bk72xx)
@ -1580,6 +1589,7 @@ class SplitDefault(Optional):
from esphome.components.esp32.const import ( from esphome.components.esp32.const import (
VARIANT_ESP32S2, VARIANT_ESP32S2,
VARIANT_ESP32S3, VARIANT_ESP32S3,
VARIANT_ESP32C3,
) )
variant = get_esp32_variant() variant = get_esp32_variant()
@ -1593,6 +1603,11 @@ class SplitDefault(Optional):
return self._esp32_s3_arduino_default return self._esp32_s3_arduino_default
if CORE.using_esp_idf: if CORE.using_esp_idf:
return self._esp32_s3_idf_default return self._esp32_s3_idf_default
elif variant == VARIANT_ESP32C3:
if CORE.using_arduino:
return self._esp32_c3_arduino_default
if CORE.using_esp_idf:
return self._esp32_c3_idf_default
else: else:
if CORE.using_arduino: if CORE.using_arduino:
return self._esp32_arduino_default return self._esp32_arduino_default

78
tests/test8.1.yaml Normal file
View File

@ -0,0 +1,78 @@
# Tests for ESP32-S3 boards - IDf
---
wifi:
ssid: "ssid"
network:
enable_ipv6: true
esp32:
board: esp32s3box
variant: ESP32S3
framework:
type: esp-idf
esphome:
name: esp32-s3-test
logger:
debug:
psram:
spi:
- id: spi_id_1
clk_pin:
number: GPIO7
allow_other_uses: false
mosi_pin: GPIO6
interface: any
spi_device:
id: spidev
data_rate: 2MHz
spi_id: spi_id_1
mode: 3
bit_order: lsb_first
display:
- platform: ili9xxx
id: displ8
model: ili9342
cs_pin: GPIO5
dc_pin: GPIO4
reset_pin:
number: GPIO48
allow_other_uses: true
i2c:
scl: GPIO18
sda: GPIO8
touchscreen:
- platform: tt21100
display: displ8
interrupt_pin:
number: GPIO3
ignore_strapping_warning: true
allow_other_uses: false
reset_pin:
number: GPIO48
allow_other_uses: true
binary_sensor:
- platform: tt21100
name: Home Button
index: 1
sensor:
- platform: debug
free:
name: "Heap Free"
block:
name: "Max Block Free"
loop_time:
name: "Loop Time"
psram:
name: "PSRAM Free"

75
tests/test8.2.yaml Normal file
View File

@ -0,0 +1,75 @@
# Tests for ESP32-C3 boards - IDf
---
wifi:
ssid: "ssid"
network:
enable_ipv6: true
esp32:
board: lolin_c3_mini
variant: ESP32C3
framework:
type: esp-idf
esphome:
name: esp32-c3-test
logger:
debug:
psram:
spi:
- id: spi_id_1
clk_pin:
number: GPIO7
allow_other_uses: false
mosi_pin: GPIO6
interface: any
spi_device:
id: spidev
data_rate: 2MHz
spi_id: spi_id_1
mode: 3
bit_order: lsb_first
display:
- platform: ili9xxx
id: displ8
model: ili9342
cs_pin: GPIO5
dc_pin: GPIO4
reset_pin:
number: GPIO21
i2c:
scl: GPIO18
sda: GPIO8
touchscreen:
- platform: tt21100
display: displ8
interrupt_pin:
number: GPIO3
allow_other_uses: false
reset_pin:
number: GPIO20
binary_sensor:
- platform: tt21100
name: Home Button
index: 1
sensor:
- platform: debug
free:
name: "Heap Free"
block:
name: "Max Block Free"
loop_time:
name: "Loop Time"
psram:
name: "PSRAM Free"