Repository navigation
feat(buildfs): build ESP8266 filesystem images from the eagle.flash linker script (#1358) - #1800
Merged
Merged
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
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.
fbuild buildfsbuilds filesystem images for ESP32 (partition CSV) and RP2040(arduino-pico
flashmenu). An ESP8266 project hit the "ESP32 and RP2040 only"refusal even though it has a perfectly well-defined volume — this adds the third
platform, closing the ESP8266 half of #1358.
Where the region comes from
An ESP8266 module has no partition table. The flash layout is chosen by the
eesz"Flash Size" menu option in arduino-esp8266'sboards.txt, which names alinker script:
generic.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ldThat script is the authority, not the duplicated
build.spiffs_start/build.spiffs_endcopies inboards.txt: the firmware links against thescript's
_FS_start,_FS_end,_FS_pageand_FS_blocksymbols. Sobuildfs_esp8266parses the script itself and takes the region and thefilesystem geometry from it, exactly the invariant
plan_imagealready givesESP32 (partition CSV) and RP2040 (
fs_start/fs_end).The menu option is resolved through the same loader the RP2040 half uses
(
fbuild_build::arduino_props::load_board_props_with_menu_overrides), soboard_build.eeszselects the script andboard_build.flash_ldpins oneoutright.
Why the geometry moved into its own type
An image formatted with different block/page sizes than the firmware mounts with
does not mount, even at exactly the right length.
FsGeometry(
buildfs_geometry.rs) now carries block/page/metadata per volume: ESP32 stays4096/256, an ESP8266 volume takes
_FS_block/_FS_pagefrom its linker script(8192/256 for a 4 MB layout). The size estimate and the
mklittlefs/mkspiffsargv both come from that one value, so the estimate can't be computed under one
geometry and the image written under another. ESP32/RP2040 behaviour is
unchanged (same constants, same argv).
Refusals are named rather than guessed:
_FS_start/_FS_endin the script → error namingboard_build.eesz;_FS_start == _FS_end→ "reserves no filesystem space";_FS_block/_FS_pagemissing, zero, or not page-aligned → error, instead ofsilently formatting 4096/256;
build.flash_ld→ error naming the Flash Size knob.LittleFS is the default (SPIFFS is deprecated upstream);
--filesystem spiffsstill builds a SPIFFS image. Flashing remains ESP32-only — an ESP8266 write
offset is this address minus the
0x40200000mapping, anduploadfsdoes nothave that transport.
Verification
Real end-to-end with the installed arduino-esp8266 3.30102.0 framework and
PlatformIO's
mklittlefs, on a fixture project (board = nodemcuv2,board_build.eesz = 4M2M,data/= one text file + a 70,000-byte blob):Unpacking the image round-trips the blob byte-identically (same sha256). The
region matches
eagle.flash.4m2m.ld(_FS_start0x40400000, 2,072,576 bytes)and the geometry is the script's 8192/256, not the ESP32's 4096/256.
Gates run locally: 39
buildfsunit tests pass (14 new ESP8266 ones), workspaceclippy --all-targets -D warningsclean,run_dylint --package fbuild-cliclean, platform-boundary 44/43, test-layout clean,
soldr cargo fmt --checkclean,
bash test4020 passed / 0 failed / 107 ignored (rc 0).