Pin the board-table equality, note the flash_freq audit

write_project rejects a board missing from either table, so a new test
asserts the two stay exactly equal (the subset check is how d1_wroom_02
went missing). The hardcoded --flash_freq 40 carries the audit note:
all 45 supported boards ship 40 MHz, and a platform bump adding one
that does not must revisit it.
This commit is contained in:
J. Nick Koston
2026-08-21 18:55:52 -05:00
parent 6b56def2bf
commit 69f558d83d
2 changed files with 13 additions and 0 deletions
+4
View File
@@ -771,6 +771,10 @@ def write_project(paths: InstalledPaths) -> bool:
" rspfile_content = $in_newline",
" description = LINK $out",
"rule elf2bin",
# --flash_freq 40: upstream derives this from the board JSON's
# f_flash, but all 45 supported boards ship 40 MHz (audited against
# platform-espressif8266); re-check if a future platform bump adds
# a board with a different f_flash
f" command = $python {_q(framework / 'tools' / 'elf2bin.py')} --eboot {_q(framework / 'bootloaders' / 'eboot' / 'eboot.elf')} --app $in --flash_mode {esp8266_data[KEY_FLASH_MODE]} --flash_freq 40 --flash_size {_flash_size_str(BOARDS[board][KEY_FLASH_SIZE])} --path {_q(toolchain_bin)} --out $out",
" description = BIN $out",
"rule copy",
@@ -1208,3 +1208,12 @@ def test_generate_ld_scripts_unreadable_header_forces_regeneration(
) as mock_run:
_run_generate_ld_scripts(paths)
mock_run.assert_called_once()
def test_board_tables_are_equal() -> None:
"""write_project rejects a board missing from either table, so the two
must stay exactly in sync (the build-surgery test only checks the
subset direction, which is how d1_wroom_02 went missing)."""
from esphome.components.esp8266.boards import BOARDS
assert set(BOARDS) == set(ESP8266_BOARD_BUILD)