-
-
Notifications
You must be signed in to change notification settings - Fork 174
Add esp32-c5 support #202
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
base: main
Are you sure you want to change the base?
Add esp32-c5 support #202
Changes from 5 commits
a017ee1
d24ebf7
5534847
b3ea958
b4522ac
557c652
2c2160b
c20e241
fce8246
6648e60
1419819
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -365,6 +365,19 @@ build_flags = | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| For a complete example, see the `esp32_heltec_915` environment in [example/OOK_Receiver/platformio.ini](example/OOK_Receiver/platformio.ini#L163). | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| ## ESP32 Platform Support | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| ### Single-Core ESP32 Variants (ESP32-C3, ESP32-C5, ESP32-S2) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| The library automatically detects and supports single-core ESP32 variants such as the ESP32-C3/5 and ESP32-S2. The decoder task's CPU core assignment and priority are automatically adjusted based on the `CONFIG_FREERTOS_UNICORE` configuration: | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| * **Single-core processors** (ESP32-C3, ESP32-S2): Decoder task runs on core 0 with priority 3 | ||||||||||||||||||||||||||||||||||
| * **Multi-core processors** (ESP32, ESP32-S3): Decoder task runs on core 1 with priority 2 | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| This configuration ensures compatibility with single-core ESP32 variants that only have core 0 available, preventing boot crashes that would occur if the task were pinned to the non-existent core 1. | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+370
to
+377
|
||||||||||||||||||||||||||||||||||
| ### Single-Core ESP32 Variants (ESP32-C3, ESP32-C5, ESP32-S2) | |
| The library automatically detects and supports single-core ESP32 variants such as the ESP32-C3/5 and ESP32-S2. The decoder task's CPU core assignment and priority are automatically adjusted based on the `CONFIG_FREERTOS_UNICORE` configuration: | |
| * **Single-core processors** (ESP32-C3, ESP32-S2): Decoder task runs on core 0 with priority 3 | |
| * **Multi-core processors** (ESP32, ESP32-S3): Decoder task runs on core 1 with priority 2 | |
| This configuration ensures compatibility with single-core ESP32 variants that only have core 0 available, preventing boot crashes that would occur if the task were pinned to the non-existent core 1. | |
| ### Single-Core ESP32 Variants (ESP32-C3, ESP32-S2) | |
| The library automatically detects and supports single-core ESP32 variants such as the ESP32-C3 and ESP32-S2. The decoder task's CPU core assignment and priority are automatically adjusted based on the `CONFIG_FREERTOS_UNICORE` configuration: | |
| * **Single-core processors** (ESP32-C3, ESP32-S2): Decoder task runs on core 0 with priority 3 | |
| * **Multi-core processors** (ESP32, ESP32-C5, ESP32-S3): Decoder task runs on core 1 with priority 2 | |
| This configuration ensures compatibility with single-core ESP32 variants that only have core 0 available, preventing boot crashes that would occur if the task were pinned to the non-existent core 1. Dual-core variants such as ESP32-C5 are handled as multi-core devices. |
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.
@copilot Pls review the details on the C5 Chip from expressif here - https://www.espressif.com/en/products/socs/esp32-c5
It is single core
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -28,6 +28,7 @@ framework = arduino | |||||
| monitor_filters = esp32_exception_decoder | ||||||
| ;platform = espressif32@3.5.0 | ||||||
| platform = espressif32@6.1.0 | ||||||
| extra_scripts = pre:update_link_flags.py | ||||||
|
||||||
| lib_ldf_mode = chain+ | ||||||
| lib_deps = | ||||||
| ${libraries.arduinolog} | ||||||
|
|
@@ -75,6 +76,53 @@ build_flags = | |||||
| upload_protocol = esptool | ||||||
| monitor_speed = 921600 | ||||||
|
|
||||||
| [env:esp32c5_cc1101] | ||||||
|
NorthernMan54 marked this conversation as resolved.
|
||||||
| platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip | ||||||
|
NorthernMan54 marked this conversation as resolved.
|
||||||
| board = esp32-c5-devkitc-1 | ||||||
| framework = arduino | ||||||
| build_flags = | ||||||
| '-DCONFIG_ESP_CONSOLE_UART=1' ; settings for esp32c3 without uart | ||||||
|
NorthernMan54 marked this conversation as resolved.
Outdated
|
||||||
| '-DARDUINO_USB_MODE=1' | ||||||
| '-DARDUINO_USB_CDC_ON_BOOT=1' | ||||||
| '-DLOG_LEVEL=LOG_LEVEL_TRACE' | ||||||
| '-DONBOARD_LED=27' ; LED_D4 | ||||||
| ; *** rtl_433_ESP Options *** | ||||||
| ; '-DRF_MODULE_FREQUENCY=915.00' | ||||||
| '-DOOK_MODULATION=true' ; False is FSK, True is OOK | ||||||
| '-DRTL_DEBUG=1' ; rtl_433 verbose mode | ||||||
| ; '-DRTL_VERBOSE=58' ; LaCrosse TX141-Bv2, TX141TH-Bv2, TX141-Bv3, TX141W, TX145wsdth sensor | ||||||
| ; '-DRAW_SIGNAL_DEBUG=true' ; display raw received messages | ||||||
| ; '-DMEMORY_DEBUG=true' ; display memory usage information | ||||||
| '-DDEMOD_DEBUG=true' ; display signal debug info | ||||||
| #'-DMY_DEVICES=true' ; subset of devices | ||||||
|
||||||
| #'-DMY_DEVICES=true' ; subset of devices | |
| ;'-DMY_DEVICES=true' ; subset of devices |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,11 @@ | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
Copilot
AI
Feb 20, 2026
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.
The compiler flags -Wno-implicit-function-declaration, -Wno-error=implicit-function-declaration, and -Wno-int-conversion suppress important warnings that could indicate real bugs (e.g., missing function declarations, incorrect type conversions). These flags are being applied globally to the build. Consider fixing the underlying issues in the code rather than suppressing these warnings, or at minimum, document why these suppressions are necessary for ESP32-C5 support specifically.
| # General options that are passed to the C and C++ compilers | |
| env.Append(CCFLAGS=["-Wno-implicit-function-declaration", "-Wno-error=implicit-function-declaration","-Wno-int-conversion"]) | |
| # General options that are passed to the C and C++ compilers. | |
| # NOTE: The following warning-suppression flags are only applied for ESP32-C5 | |
| # builds. Some ESP32-C5 toolchain/SDK code triggers implicit-function-declaration | |
| # and int-conversion warnings, which would otherwise break the build when treated | |
| # as errors. Restricting these flags to ESP32-C5 avoids globally masking real | |
| # issues in other environments. | |
| board_config = env.BoardConfig() | |
| mcu = board_config.get("build.mcu", "") | |
| if mcu == "esp32c5": | |
| env.Append( | |
| CCFLAGS=[ | |
| "-Wno-implicit-function-declaration", | |
| "-Wno-error=implicit-function-declaration", | |
| "-Wno-int-conversion", | |
| ] | |
| ) |
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -32,7 +32,7 @@ | |||||||||
| #if defined(RF_MODULE_SCK) && defined(RF_MODULE_MISO) && \ | ||||||||||
| defined(RF_MODULE_MOSI) && defined(RF_MODULE_CS) | ||||||||||
| # include <SPI.h> | ||||||||||
| # if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 | ||||||||||
| # if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C5 | ||||||||||
|
||||||||||
| # if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C5 | |
| // Use FSPI only on ESP32-C3 and ESP32-S3. ESP32-C5 is not grouped here | |
| // because its SPI peripheral configuration may differ and must be verified. | |
| # if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -41,8 +41,13 @@ | |||||||||||||||||||||||||
| # endif | ||||||||||||||||||||||||||
| #endif | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| #define rtl_433_Decoder_Priority 2 | ||||||||||||||||||||||||||
| #define rtl_433_Decoder_Core 1 | ||||||||||||||||||||||||||
| #ifdef CONFIG_FREERTOS_UNICORE | ||||||||||||||||||||||||||
| # define rtl_433_Decoder_Core 0 | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
| # define rtl_433_Decoder_Core 0 | |
| # define rtl_433_Decoder_Core 0 | |
| /* | |
| * On single-core ESP32 builds we run the rtl_433 decoder task at priority 3 | |
| * instead of 2 to reduce the risk of losing samples when the CPU is shared | |
| * with WiFi/Arduino and other medium-priority tasks on the same core. | |
| * | |
| * This was chosen empirically to keep decoding reliable under load. A higher | |
| * priority means the decoder may preempt lower-priority work more often, so | |
| * integrators who run additional critical tasks should review their task | |
| * priorities and adjust if necessary. | |
| */ |
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.
In the “Single-core processors” bullet list, ESP32-C5 is mentioned in the heading/paragraph but not included in the actual single-core list. This is inconsistent and may confuse readers about whether C5 is covered; add ESP32-C5 to the single-core bullet (or adjust the heading/text to match).