Skip to content

esp32/boards: Change MICROPY_HW_MCU_NAME to add a hyphen after "ESP32".#19136

Merged
dpgeorge merged 2 commits into
micropython:masterfrom
dpgeorge:esp32-rename-mcu-to-include-hyphen
May 15, 2026
Merged

esp32/boards: Change MICROPY_HW_MCU_NAME to add a hyphen after "ESP32".#19136
dpgeorge merged 2 commits into
micropython:masterfrom
dpgeorge:esp32-rename-mcu-to-include-hyphen

Conversation

@dpgeorge
Copy link
Copy Markdown
Member

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._machine was ESP32C3 module with ESP32C3. Now that string is ESP32C3 module with ESP32-C3.

Ran tests/extmod/machine_spi_rate.py on 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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.47%. Comparing base (5555847) to head (334c031).
⚠️ Report is 2 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2026

Code size report:

Reference:  esp32/espnow: Clear the recv_cb & arg on deinit. [5555847]
Comparison: tests: Update ESP32-Cx detection to match standard name. [merge of 334c031]
  mpy-cross:    +0 +0.000% 
   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
      esp32:    +0 +0.000% ESP32_GENERIC
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@dpgeorge dpgeorge requested a review from projectgus May 13, 2026 00:49
Copy link
Copy Markdown
Contributor

@projectgus projectgus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is worth the annoyance of the potential (minor) breaking change.

@projectgus projectgus added this to the release-1.29.0 milestone May 13, 2026
dpgeorge added 2 commits May 15, 2026 13:07
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>
@dpgeorge dpgeorge force-pushed the esp32-rename-mcu-to-include-hyphen branch from da805b0 to 334c031 Compare May 15, 2026 03:12
@dpgeorge dpgeorge merged commit 334c031 into micropython:master May 15, 2026
44 checks passed
@dpgeorge dpgeorge deleted the esp32-rename-mcu-to-include-hyphen branch May 15, 2026 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants