diff --git a/esphome/build_gen/arduino8266.py b/esphome/build_gen/arduino8266.py index 74d5af07d9..295d894cd3 100644 --- a/esphome/build_gen/arduino8266.py +++ b/esphome/build_gen/arduino8266.py @@ -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", diff --git a/tests/unit_tests/build_gen/test_arduino8266.py b/tests/unit_tests/build_gen/test_arduino8266.py index 9a7f54c9b0..6f2eba4043 100644 --- a/tests/unit_tests/build_gen/test_arduino8266.py +++ b/tests/unit_tests/build_gen/test_arduino8266.py @@ -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)