-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for ESP32-C2 & ESP32-C6 #4377
Conversation
@@ -29,7 +29,6 @@ | |||
KEY_ESP32, | |||
KEY_SDKCONFIG_OPTIONS, | |||
KEY_VARIANT, | |||
VARIANT_ESP32C3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was un-used, removed it while I was in here.
esphome/components/spi/spi.cpp
Outdated
@@ -76,7 +76,7 @@ void SPIComponent::setup() { | |||
if (spi_bus_num == 0) { | |||
this->hw_spi_ = &SPI; | |||
} else { | |||
#if defined(USE_ESP32_VARIANT_ESP32C3) || defined(USE_ESP32_VARIANT_ESP32S2) || defined(USE_ESP32_VARIANT_ESP32S3) | |||
#if defined(USE_ESP32_VARIANT_ESP32C3) || defined(USE_ESP32_VARIANT_ESP32S2) || defined(USE_ESP32_VARIANT_ESP32S3) || defined(USE_ESP32_VARIANT_ESP32C2) || defined(USE_ESP32_VARIANT_ESP32C6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed ESP32-C2 and ESP32-C6 use FSPI
. This line may have grown too long...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the clang-format test baulked on it.
#if defined(USE_ESP32_VARIANT_ESP32C3) || defined(USE_ESP32_VARIANT_ESP32S2) || defined(USE_ESP32_VARIANT_ESP32S3) || defined(USE_ESP32_VARIANT_ESP32C2) || defined(USE_ESP32_VARIANT_ESP32C6) | |
#if defined(USE_ESP32_VARIANT_ESP32C3) || defined(USE_ESP32_VARIANT_ESP32S2) || defined(USE_ESP32_VARIANT_ESP32S3) || \ | |
defined(USE_ESP32_VARIANT_ESP32C2) || defined(USE_ESP32_VARIANT_ESP32C6) |
@vidplace7 Any chance you would also be willing to look at adding support for ESP32-H2 (ESP32-H2-MINI-1 / ESP32-H2-DevKitM-1) as well? At least on paper, the ESP32-H2 looks to need the same config ESP32-C6 but the ESP32-H2 SoC is without Wi-Fi radio support: https://www.espressif.com/en/products/socs/esp32-h2 https://www.espressif.com/en/news/ESP32_H2 https://media.digikey.com/pdf/Data%20Sheets/Espressif%20PDFs/ESP32-H2_MINI_1_Prelim_v0.2_EN.pdf https://github.com/espressif/esp-idf/search?q=esp32h2 |
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions. |
@vidplace7 any updates on this? |
As per @Hedda in esphome/feature-requests#1397 (comment) Espressif ESP-IDF v5.1 with ESP32-C6 and ESP32-H2 has now been released https://github.com/espressif/esp-idf/releases/tag/v5.1 |
Does my debug+logger-pr #5036 work with this? |
@vidplace7 would you mind updating this PR with stintel/esphome@ec1c4b4 and unmarking it as draft? Alternatively, you could give me access to your repo/branch and let me do it, or close this PR and I open a new one including your commit? I'll be travelling from 12/08 until at least 31/08, and I'd like to open a PR for ESP32-C6 support before that, and this PR is a dependency of my work. Thanks! |
03054ab
to
f751fb5
Compare
Add initial support for GPIO validation on ESP32-C2 and ESP32-C6 ESP32-C2: https://www.espressif.com/sites/default/files/documentation/esp8684_datasheet_en.pdf ESP32-C6: https://www.espressif.com/sites/default/files/documentation/esp32-c6_datasheet_en.pdf [fix conflicts, CI errors] Signed-off-by: Stijn Tintel <[email protected]>
I've been testing this for months on multiple ESP32-C6 devices. Have a few of them in production for a few months, and they've been doing great. I'd say it's time to merge this PR. |
Signed-off-by: Stijn Tintel <[email protected]>
Signed-off-by: Stijn Tintel <[email protected]>
Hey there @esphome/core, mind taking a look at this pull request as it has been labeled with an integration ( |
Un-marked as draft thanks to @stintel's amazing work finishing this off. |
Not really contributing with anything but an apprecation for the implementation and a verfication! No issues flashing my C6 modules with the following config: esp32:
board: esp32-c6-devkitc-1
variant: esp32c6
framework:
type: esp-idf
version: 5.1.0
platform_version: https://github.com/stintel/platform-espressif32#esp32-c6-test |
I am a newcomer with home assistant but I would like to built some projects with the new esp32-c6 using zigbee or thread. If I understood right there is a chance that within a few months this chip can be used in esphome of home assistant? Or I am wrong? I am not so experienced and I would like to use the simple way selecting esp32-c6 as device. Or should I use the esphome beta integration/add on? Thank you. |
@HemmiBZ Please join the Discord server and let's chat there https://discord.com/invite/KhAMKrd |
@HemmiBZ I think that Zigbee and Thread implementations would be completely new features so really separate from ESP32-C6. Neither Zigbee or Thread support exist today in ESPHome and I expect either require quite a lot of work and time to implement. If you are not a developer then recommend checking out the existing feature request like this -> esphome/feature-requests#1397 Anyway, both Zigbee and Thread and really off-topic for this specific pull request. |
The UART component won't compile with the current used clock source ( uart_config_t uart_config;
uart_config.baud_rate = this->baud_rate_;
uart_config.data_bits = data_bits;
uart_config.parity = parity;
uart_config.stop_bits = this->stop_bits_ == 1 ? UART_STOP_BITS_1 : UART_STOP_BITS_2;
uart_config.flow_ctrl = UART_HW_FLOWCTRL_DISABLE;
#if USE_ESP32_VARIANT_ESP32C6
uart_config.source_clk = UART_SCLK_RTC;
#else
uart_config.source_clk = UART_SCLK_APB;
#endif
uart_config.rx_flow_ctrl_thresh = 122; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good. Thanks
Technically this is enough to close esphome/feature-requests#2176 but merging #5289 would auto-close that. Up to you :-) |
What does this implement/fix?
Add initial support for GPIO validation on ESP32-C2 and ESP32-C6
These variants require ESP-IDF 5.x support added via #4364
This PR simply seeks to add variant-specific modifications for GPIO Validation, ADC, Deep Sleep wakeup, SPI, and logging based on espressif's datasheets.
Some additional work still needs to be done inlogger.cpp
andlogger.h
, marking this as a Draft PR until this is completed.Docs I referenced:
ESP32-C2:
https://www.espressif.com/sites/default/files/documentation/esp8684_datasheet_en.pdf
ESP32-C6:
https://www.espressif.com/sites/default/files/documentation/esp32-c6_datasheet_en.pdf
Types of changes
Related issue or feature (if applicable): fixes
Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#
Test Environment
Example entry for
config.yaml
:N/A
Checklist:
tests/
folder).If user exposed functionality or configuration variables are added/changed: