Skip to content

Expand Espressif non-usb firmware partitions #10424

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

Merged
merged 2 commits into from
Jun 16, 2025

Conversation

dhalbert
Copy link
Collaborator

This PR expands the space available for the circuitpython firmware on non-USB Espressif boards: ESP32, ESP32-C2, C3, C6, and H2.

Non-USB boards that used to have CIRCUITPY_LEGACY_4MB_FLASH_LAYOUT = 1 no longer have that set. Their ota_0andota_1partitions are now combined into a singleota_0partition at the same location. Theiruser_fs` partition does not move.

Conversely, non-USB boards that did not have CIRCUITPY_LEGACY_4MB_FLASH_LAYOUT set now have CIRCUITPY_4MB_FLASH_LARGE_USER_FS_LAYOUT = 1 set. Note the difference in the two names. This preserves the larger user_fs (almost 2MB in size) on those boards at the same location.

So in both cases for these non-USB boards, the location of the user_fs is not moved, and its size is not changed. So the user filesystem will not be damaged when loading new firmware.

Because these boards are loaded only using a .bin that rewrites the partition table, there is no UF2 bootloader with an updated partition table to worry about.

This PR does not adjust the features available to these boards as set in mpconfigport.mk. I started to do this, but it caused some rather tortured logic due to the overlap with ESP32-S2 and ESP32-S3 USB-capable boards, which await #10265. When #10265 is merged, the features available will be adjusted for all boards as appropriate. CIRCUITPY_LEGACY_4MB_FLASH_LAYOUT is still mentioned in mpconfigport.mk, but it is obsolete.

A few small adjustments were made in mpconfigboard.mk to allow new features on boards where those features will now fit.

…2-C6 boards

This combines ota_0 and ota_1 into ota_0, but leaves the user filesystem in the same place.
dualbank is already turned off on these boards.
Also restores some modules that were turned off for space reasons.
@dhalbert dhalbert force-pushed the expand-non-usb-partitions branch from ea03ba5 to 871dcb1 Compare June 15, 2025 19:49
@dhalbert dhalbert force-pushed the expand-non-usb-partitions branch from 871dcb1 to 9c10fce Compare June 15, 2025 21:50
@dhalbert dhalbert requested review from FoamyGuy and eightycc June 15, 2025 22:36
Copy link
Collaborator

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

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

Looks good to me. Did not test, not certain if I have any of these devices

Copy link
Collaborator

@eightycc eightycc left a comment

Choose a reason for hiding this comment

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

These look fine.

@eightycc eightycc merged commit a634a47 into adafruit:main Jun 16, 2025
243 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants