-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
fix: Added platform_packages for esp32s2, c3, s3 #4830
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
Conversation
WalkthroughAdded platform_packages = ${esp32.platform_packages} to the [esp32s2], [esp32c3], and [esp32s3] environments in platformio.ini to mirror the base ESP32 platform packages. No other settings were changed. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
@@ -296,6 +296,7 @@ board_build.partitions = ${esp32.default_partitions} ;; default partioning for | |||
[esp32s2] | |||
;; generic definitions for all ESP32-S2 boards | |||
platform = ${esp32_idf_V4.platform} | |||
platform_packages = ${esp32.platform_packages} |
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.
💡 Verification agent
🧩 Analysis chain
Potentially incompatible framework override for ESP32-S2
This forces the Arduino-ESP32 1.x framework (${esp32.platform_packages} → 1.0.6.x) onto an IDF v4-based platform (${esp32_idf_V4.platform}), which is likely incompatible (USB stack and S2 support rely on 2.x). Prefer omitting platform_packages here to let the selected platform supply the correct framework, or explicitly point to an IDF v4/Arduino 2.0.9-compatible framework if you must override.
Run to confirm whether any env actually consumes this new key and to assess impact:
Suggested safe change (omit the override):
- platform_packages = ${esp32.platform_packages}
+ ; platform_packages intentionally omitted to use the framework packaged with ${esp32_idf_V4.platform}
🏁 Script executed:
#!/bin/bash
set -e
echo "All platform_packages occurrences:"
rg -n -A1 -B1 '^\s*platform_packages\s*=' platformio.ini
echo
echo "Envs extending esp32s2/esp32c3/esp32s3 (to inherit section keys):"
rg -n '^\s*extends\s*=\s*(esp32s2|esp32c3|esp32s3)\b' platformio.ini
echo
echo "Envs referencing esp32s2.* keys (do they pull platform_packages?):"
rg -n '\$\{esp32s2\.[^}]+\}' platformio.ini
Length of output: 2994
🏁 Script executed:
#!/bin/bash
# Show lines 285-310 with line numbers to identify environment sections
sed -n '285,310p' platformio.ini | nl -ba
Length of output: 134
Remove incompatible Arduino-ESP32 1.x overrides from IDF v4 environments
The three environments targeting ${esp32_idf_V4.platform}
currently force the old Arduino-ESP32 1.x framework (IDF v3) via platform_packages = ${esp32.platform_packages}
, which will break USB/S2/S3 support. You should let the IDF v4-based platform supply its matching Arduino-ESP32 2.x framework by removing these overrides (or, if you really need a custom override, point to a known 2.x release).
Locations to fix in platformio.ini:
- Line 299
- Line 319
- Line 339
Apply the same change in each section:
[env:…]
- platform_packages = ${esp32.platform_packages}
+ ; platform_packages omitted so ${esp32_idf_V4.platform} uses its bundled Arduino-ESP32 2.x framework
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
platform_packages = ${esp32.platform_packages} | |
; platform_packages omitted so ${esp32_idf_V4.platform} uses its bundled Arduino-ESP32 2.x framework |
🤖 Prompt for AI Agents
platformio.ini lines 299, 319 and 339: the three environments that use
${esp32_idf_V4.platform} are forcing the old Arduino-ESP32 1.x framework via
"platform_packages = ${esp32.platform_packages}", which is incompatible with IDF
v4; remove that "platform_packages = ${esp32.platform_packages}" line from each
of those three environment sections so the IDF v4 platform can supply the
correct Arduino-ESP32 2.x framework (or if you must override, replace it with an
explicit known Arduino-ESP32 2.x package reference).
@@ -315,6 +316,7 @@ board_build.partitions = ${esp32.default_partitions} ;; default partioning for | |||
[esp32c3] | |||
;; generic definitions for all ESP32-C3 boards | |||
platform = ${esp32_idf_V4.platform} | |||
platform_packages = ${esp32.platform_packages} |
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.
🛠️ Refactor suggestion
ESP32-C3 likely needs Arduino-ESP32 2.x; avoid overriding with 1.x
Using ${esp32.platform_packages} here pulls in arduino-esp32 1.0.6.x, which is not suitable for C3 on IDF v4. This can cause build or runtime issues (USB CDC, target configs).
Either remove the override or introduce an IDF v4-compatible package reference (e.g., 2.0.9) that matches ${esp32_idf_V4.platform}. If you want consistency, define a dedicated variable (e.g., esp32_idf_V4.platform_packages) and reference that here.
- platform_packages = ${esp32.platform_packages}
+ ; platform_packages intentionally omitted (use defaults from ${esp32_idf_V4.platform})
+ ; or: platform_packages = framework-arduinoespressif32 @ ~2.0.9 ; ensure compatibility with chosen platform
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
platform_packages = ${esp32.platform_packages} | |
; platform_packages intentionally omitted (use defaults from ${esp32_idf_V4.platform}) | |
; or: platform_packages = framework-arduinoespressif32 @ ~2.0.9 ; ensure compatibility with chosen platform |
🤖 Prompt for AI Agents
In platformio.ini around line 319, the line setting platform_packages =
${esp32.platform_packages} forces arduino-esp32 1.x which is incompatible with
ESP32-C3 on IDF v4; update the project to either remove this override so the
correct package is inherited, or add an IDF v4–compatible package variable
(e.g., define esp32_idf_V4.platform_packages referencing arduino-esp32 2.0.9 or
a specific compatible version) and set platform_packages =
${esp32_idf_V4.platform_packages} here so the arduino-esp32 package matches
${esp32_idf_V4.platform}.
@@ -334,6 +336,7 @@ board_build.flash_mode = qio | |||
[esp32s3] | |||
;; generic definitions for all ESP32-S3 boards | |||
platform = ${esp32_idf_V4.platform} | |||
platform_packages = ${esp32.platform_packages} |
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.
💡 Verification agent
🧩 Analysis chain
ESP32-S3 framework mismatch risk
Same concern: ${esp32.platform_packages} points to Arduino-ESP32 1.0.6.x, which doesn’t properly support S3 features and doesn’t align with the Tasmota IDF v4 platform in use. This override can silently downgrade framework components and break USB/config macros.
The summary claims this will “mirror the base ESP32 platform packages” and affect those builds; however, most S3 environments here do not extend [esp32s3] and don’t reference ${esp32s3.platform_packages}, so this change may be a no-op for them. Please verify inheritance/usage.
Recommended change:
- platform_packages = ${esp32.platform_packages}
+ ; platform_packages intentionally omitted to use framework bundled with ${esp32_idf_V4.platform}
🏁 Script executed:
#!/bin/bash
set -e
echo "Do S3 envs consume esp32s3.platform_packages?"
rg -n '\$\{esp32s3\.platform_packages\}' platformio.ini || true
echo
echo "Which S3 envs set platform directly?"
rg -n '^\[env:esp32s3' -n platformio.ini
rg -n -A3 '^\[env:esp32s3' platformio.ini
echo
echo "List platform for these envs:"
rg -n '^\s*platform\s*=' platformio.ini | rg 'esp32s3' -n
Length of output: 1498
🏁 Script executed:
#!/bin/bash
set -e
echo "Showing lines 330–350 around the platform_packages override in platformio.ini:"
sed -n '330,350p' platformio.ini
Length of output: 1010
Remove the unused platform_packages
override in [esp32s3]
The line
platform_packages = ${esp32.platform_packages}
in the [esp32s3]
section isn’t picked up by any env:esp32s3*
environments (no one references ${esp32s3.platform_packages}
), so it has no effect. You can safely remove it to avoid confusion.
• File: platformio.ini (around line 339)
• Section: [esp32s3]
Suggested diff:
[esp32s3]
- platform_packages = ${esp32.platform_packages}
🤖 Prompt for AI Agents
platformio.ini around line 339 in the [esp32s3] section: the override
"platform_packages = ${esp32.platform_packages}" is unused because no
env:esp32s3* environments reference ${esp32s3.platform_packages}; remove that
line from the [esp32s3] section to avoid confusion and dead configuration.
the rabbit may be on to something. did you test this with IDF V4? |
Yeah I agree @DedeHai this doesn't look right If also a little odd that the PR has no description only a title @localhostgokul |
Summary by CodeRabbit