Use new section for dynamic arrays

Use a custom linker section to hold dynamic arrays such as the
usermod list.  This provides an extensible solution for wider use
in the future (such as FX or Bus drivers), as well as IDF v5
compatibility.
This commit is contained in:
Will Miles
2025-11-28 09:23:49 -05:00
parent 26d2cc971a
commit b97b46ae12
7 changed files with 28 additions and 4 deletions

12
pio-scripts/dynarray.py Normal file
View File

@@ -0,0 +1,12 @@
# Add a section to the linker script to store our dynamic arrays
# This is implemented as a pio post-script to ensure that our extra linker
# script fragments are processed last, after the base platform scripts have
# been loaded and all sections defined.
Import("env")
if env.get("PIOPLATFORM") == "espressif8266":
# Use a shim on this platform so we can share the same output blocks
# names as used by later platforms (ESP32)
env.Append(LINKFLAGS=["-Ttools/esp8266_rodata.ld"])
env.Append(LINKFLAGS=["-Ttools/dynarray.ld"])