esp32/esp32_common: Make a board's pins.csv configurable for variants. - #19728
Open
UnexpectedMaker wants to merge 1 commit into
Open
UnexpectedMaker wants to merge 1 commit into
UnexpectedMaker wants to merge 1 commit into
Conversation
Allow `mpconfigboard.cmake` or `mpconfigvariant_*.cmake` to specify a
custom `MICROPY_BOARD_PINS` to override `${MICROPY_BOARD_DIR}/pins.csv`.
This lets a single board definition support hardware revisions that have
different pin mappings by using board variants.
This was copied from the existing behavior of the rp2 port.
Signed-off-by: Seon Rozenblum <seon@unexpectedmaker.com>
|
Code size report: |
projectgus
self-requested a review
September 30, 2026 00:07
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
I have new revisions of most of my ESP32 boards that can run off the same MP builds – but they have some external header and/or internal IO mapping changes, so I needed a way to allow the variant build system to support different pins.csv files.
The rp2 port lets a board override its pins file via
MICROPY_BOARD_PINS(1a060e8), so this change brings the same to the esp32 port, so one board folder can use board variants to support hardware revisions with different pin mappings, instead of duplicating the whole board definition.A board's
mpconfigboard.cmakeormpconfigvariant_*.cmakecan now setMICROPY_BOARD_PINS. If it isn't set, the build uses${MICROPY_BOARD_DIR}/pins.csvas before, so existing boards are unaffected.Testing
Built an esp32c6 board (UM_TINYC6) with two variants on ESP-IDF v5.5.5: one pointing
MICROPY_BOARD_PINSatpins.csv, the other atpins_d.csv, and I flashed both board revisions and checked that each build generatedpins.cfrom the correct CSV.Generative AI
I used generative AI tools when creating this PR, but I found the existing rp2 support, directed the AI to add it to the esp32 port, and then personally checked and verified the change, before making builds.
I also created the variant pin files, flashed the boards and tested them myself.
This PR was generated by me, not my AI.
SeonR