Merge branch 'esp8266-native-build-surgery' into esp8266-native-toolchain-plumbing

This commit is contained in:
J. Nick Koston
2026-08-23 13:54:26 -05:00
2 changed files with 15 additions and 2 deletions
+2 -2
View File
@@ -35,7 +35,7 @@ from esphome.platformio.toolchain import copy_ccache_script
from esphome.storage_json import StorageJSON
from esphome.types import ConfigType
from .boards import BOARDS, ESP8266_LD_SCRIPTS
from .boards import BOARDS, ESP8266_LD_SCRIPTS, board_ld_script
from .const import (
CONF_EARLY_PIN_INIT,
CONF_ENABLE_SERIAL,
@@ -412,7 +412,7 @@ async def to_code(config: ConfigType) -> None:
else:
# A per-board override preserves a layout the board shipped
# with (see d1_wroom_02 in boards.py)
ld_script = board_data.get("ldscript", ld_scripts[1])
ld_script = board_ld_script(board_data)
if ld_script is not None:
cg.add_platformio_option("board_build.ldscript", ld_script)
+13
View File
@@ -1,3 +1,5 @@
from .const import KEY_FLASH_SIZE
FLASH_SIZE_1_MB = 2**20
FLASH_SIZE_512_KB = FLASH_SIZE_1_MB // 2
FLASH_SIZE_2_MB = 2 * FLASH_SIZE_1_MB
@@ -182,6 +184,17 @@ for x in platform-espressif8266/boards/*.json; do
done | sort
"""
def board_ld_script(board_data: dict) -> str:
"""The modern (core > 2.4.2) flash linker script for a board: its
shipped-layout override, else the size default (the no-FS layout).
Single source of truth for the PlatformIO pinning in __init__ and the
native generator's fallback, so the per-board rule cannot drift.
"""
return board_data.get("ldscript", ESP8266_LD_SCRIPTS[board_data[KEY_FLASH_SIZE]][1])
BOARDS = {
"agruminolemon": {
"name": "Lifely Agrumino Lemon v4",