esp32/boards: Change MICROPY_HW_MCU_NAME to add a hyphen after "ESP32".#19136
Merged
dpgeorge merged 2 commits intoMay 15, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19136 +/- ##
=======================================
Coverage 98.47% 98.47%
=======================================
Files 176 176
Lines 22845 22845
=======================================
Hits 22497 22497
Misses 348 348 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Code size report: |
projectgus
approved these changes
May 13, 2026
Contributor
projectgus
left a comment
There was a problem hiding this comment.
I think this is worth the annoyance of the potential (minor) breaking change.
This makes all esp32 boards have a consistent naming scheme used by the MICROPY_HW_MCU_NAME macro, to have a hyphen after "ESP32" (if there's anything following it). This makes it easier to detect the SoC variant, eg "ESP32-S2", which now only requires a single check, rather than supporting strings with and without a hyphen. Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
da805b0 to
334c031
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This makes all esp32 boards have a consistent naming scheme used by the MICROPY_HW_MCU_NAME macro, to have a hyphen after "ESP32" (if there's anything following it).
This makes it easier to detect the SoC variant, eg "ESP32-S2", which now only requires a single check, rather than supporting strings with and without a hyphen.
Testing
Tested on ESP32_GENERIC_C3 firmware. Prior to this change
sys.implementation._machinewasESP32C3 module with ESP32C3. Now that string isESP32C3 module with ESP32-C3.Ran
tests/extmod/machine_spi_rate.pyon that same board, and it correctly detects the MCU variant and passes the test.Trade-offs and Alternatives
This could have gone the other way and removed the hyphen in all MCU names. But the majority of existing boards already had a hyphen in them, so adding it to boards without was a smaller change.
Having a hyphen is also more consistent with Espressif's naming of MCUs.
Generative AI
I did not use generative AI tools when creating this PR.