Files
Carlos ValdesandJonathan Bennett 204f88ddfe fix(nrf54l15): restore the nrf54l15dk build (#11410)
* fix(nrf54l15): restore the nrf54l15dk build

Three unrelated faults stacked up, so the env has not built from a clean
cache for some time. All three were diagnosed in July but never committed.

Pin framework-zephyr to 3.40201.251021 (Zephyr 4.2.1). Seeed's platform
script only maps their own seeed-xiao-* board ids to a package; any other
board -- ours included -- falls back to whatever platform.json declares as
the default, which is now Zephyr 4.4.0. Its west manifest pulls a CMSIS_6
whose cmsis_gcc.h calls the ACLE builtins __sxtb16/__sxtab16, and none of
the GCC ARM toolchains PlatformIO ships (8.2.1/9.2.1/9.3.1) declare them in
arm_acle.h. In C that is only an implicit-declaration warning; in C++ it is
a hard error. So a fresh cache silently breaks the build even though
nothing in the tree changed.

Guard the MMC5983MA case in MagnetometerThread with __has_include. The
switch arm constructs MMC5983MASensor unconditionally, so any env whose
libdeps lack SparkFun_MMC5983MA_Arduino_Library fails with "expected
type-specifier before 'MMC5983MASensor'".

Add Print::availableForWrite() to the nrf54l15 Arduino shim. The shim
declares flush() but not availableForWrite(), which StreamFrameWriter
calls -- so it went unnoticed until that code landed.

Verified: clean build of nrf54l15dk from an empty package cache, SUCCESS in
16:01, FLASH 39.04% (570804 B of 1428 KB), RAM 65.65%. The three had never
been exercised together -- a previous run with only the pin applied got
17:30 in before hitting the other two.

* review: collapse the pin rationale to one repo-local comment

The block was pasted twice, and both copies pointed at a note that does not
exist in this repository. Kept one, and only the part a reader here can act
on: why the fallback happens, and why it is a C++ error rather than the
warning the pure-C Zephyr core gets away with.

---------

Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
2026-08-11 20:15:05 +00:00

88 lines
3.6 KiB
INI

[nrf54l15_base]
platform = https://github.com/Seeed-Studio/platform-seeedboards.git
; Pin the Zephyr package explicitly. Seeed's platform script only maps their
; own "seeed-xiao-*" board ids to a framework-zephyr package; any other board
; -- nrf54l15dk included -- falls back to whatever platform.json declares as
; the default, which is now framework-zephyr-nrf54lm20 (Zephyr 4.4.0). Its
; west manifest pulls a CMSIS_6 whose cmsis_gcc.h calls the ACLE builtins
; __sxtb16/__sxtab16, and none of the GCC ARM toolchains PlatformIO ships
; (8.2.1/9.2.1/9.3.1) declare them in arm_acle.h. In C that is only an
; implicit-declaration warning, so the pure-C Zephyr core never notices; in
; C++ it is a hard error, and any .cpp pulling in zephyr/kernel.h hits it.
; Without the pin a fresh package cache breaks this build with nothing in the
; tree having changed.
platform_packages =
platformio/framework-zephyr-nrf54lm20@https://dl.registry.platformio.org/download/platformio/tool/framework-zephyr/3.40201.251021/framework-zephyr-3.40201.251021.tar.gz
framework = zephyr
extends = arduino_base
build_type = release
build_flags =
${arduino_base.build_flags}
-Isrc/platform/nrf54l15
-DMESHTASTIC_EXCLUDE_AUDIO=1
-DMESHTASTIC_EXCLUDE_GPS=1
-DMESHTASTIC_EXCLUDE_MQTT=1
-DHAS_WIRE=1
-DHAS_SENSOR=1
-DHAS_BUTTON=0
-DHAS_TELEMETRY=1
-DMESHTASTIC_EXCLUDE_PAXCOUNTER=1
-DARDUINO=100
-DMESHTASTIC_EXCLUDE_ACCELEROMETER=1
-DMAX_NUM_NODES=40
-fpermissive
# Libraries that Zephyr LDF misses; add include paths explicitly
-I.pio/libdeps/${PIOENV}/Crypto
-I.pio/libdeps/${PIOENV}/ArduinoThread
-I".pio/libdeps/${PIOENV}/ESP8266 and ESP32 OLED driver for SSD1306 displays/src"
-I.pio/libdeps/${PIOENV}/OneButton/src
-I.pio/libdeps/${PIOENV}/arduino-fsm
-I.pio/libdeps/${PIOENV}/TinyGPSPlus/src
-I.pio/libdeps/${PIOENV}/ErriezCRC32/src
-I.pio/libdeps/${PIOENV}/NonBlockingRTTTL/src
-I.pio/libdeps/${PIOENV}/RadioLib/src
build_src_filter =
${arduino_base.build_src_filter}
-<nimble/>
-<mesh/wifi/>
-<mesh/api/>
-<mesh/http/>
-<modules/esp32>
-<mesh/eth/>
-<mesh/raspihttp>
-<serialization/>
-<mqtt/>
-<motion/>
+<platform/nrf54l15/>
lib_compat_mode = off
lib_deps =
${arduino_base.lib_deps}
${radiolib_base.lib_deps}
# renovate: datasource=git-refs depName=meshtastic/Crypto packageName=https://github.com/meshtastic/Crypto gitBranch=main
https://github.com/meshtastic/Crypto/archive/591ff9a690e8168ccb7a36abde8d7783e448d395.zip
; Cherry-picked sensor libs from environmental_base. The full
; environmental_base pulls Adafruit_SSD1306 / GFX which need Arduino
; pin macros (digitalPinToPort / portOutputRegister) that the Zephyr
; Arduino shim does not implement.
https://github.com/adafruit/Adafruit_BusIO/archive/refs/tags/1.17.4.zip
https://github.com/adafruit/Adafruit_Sensor/archive/refs/tags/1.1.15.zip
https://github.com/adafruit/Adafruit_BMP280_Library/archive/refs/tags/3.0.0.zip
https://github.com/adafruit/Adafruit_BME280_Library/archive/refs/tags/2.3.0.zip
https://github.com/adafruit/Adafruit_INA260/archive/refs/tags/1.5.3.zip
https://github.com/adafruit/Adafruit_INA219/archive/refs/tags/1.2.3.zip
https://github.com/RobTillaart/INA3221_RT/archive/refs/tags/0.4.2.zip
https://github.com/RobTillaart/INA226/archive/refs/tags/0.6.6.zip
; SHTXXSensor gates on __has_include(<SHTSensor.h>), a header shipped by
; Sensirion/arduino-sht. Adafruit_SHT4X ships Adafruit_SHT4X.h instead and
; has no consumer in src/, so it left the SHT40 driver out of the build.
https://github.com/Sensirion/arduino-sht/archive/refs/tags/v1.2.6.zip
lib_ignore =
BluetoothOTA
lvgl
Adafruit_nRFCrypto