From 287c5e21cf2867477cfe94fd6c5afc905fd11526 Mon Sep 17 00:00:00 2001 From: Will MacGregor Date: Wed, 4 Nov 2026 09:46:27 -0500 Subject: [PATCH] Enable simple_room_server on the STM32 platform The room server gated its filesystem paths on NRF52_PLATFORM only, so an STM32 build fell through to the ESP32 branch and failed to compile: MyMesh.cpp:147: no matching function for call to 'Adafruit_LittleFS::open(const char*&, const char [2], bool)' main.cpp:69: 'store' was not declared in this scope STM32 uses the same InternalFS / Adafruit_LittleFS API as nRF52, including append semantics (FILE_O_WRITE opens LFS_O_RDWR|LFS_O_CREAT and then seeks to the end), so the nRF52 branch is already correct for it. Add STM32_PLATFORM alongside NRF52_PLATFORM in the four remaining gates; saveIdentity() already did this. This unblocks the room_server example on the existing STM32WL boards (wio-e5-mini, wio-e5-dev, rak3x72, tiny_relay) as well as new ones. Co-Authored-By: Claude Opus 5 (1M context) --- examples/simple_room_server/MyMesh.cpp | 4 ++-- examples/simple_room_server/MyMesh.h | 2 +- examples/simple_room_server/main.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/simple_room_server/MyMesh.cpp b/examples/simple_room_server/MyMesh.cpp index 935fd7f9..b1a88dd8 100644 --- a/examples/simple_room_server/MyMesh.cpp +++ b/examples/simple_room_server/MyMesh.cpp @@ -140,7 +140,7 @@ mesh::Packet *MyMesh::createSelfAdvert() { } File MyMesh::openAppend(const char *fname) { -#if defined(NRF52_PLATFORM) +#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM) return _fs->open(fname, FILE_O_WRITE); #elif defined(RP2040_PLATFORM) return _fs->open(fname, "a"); @@ -782,7 +782,7 @@ void MyMesh::applyTempRadioParams(float freq, float bw, uint8_t sf, uint8_t cr, } bool MyMesh::formatFileSystem() { -#if defined(NRF52_PLATFORM) +#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM) return InternalFS.format(); #elif defined(RP2040_PLATFORM) return LittleFS.format(); diff --git a/examples/simple_room_server/MyMesh.h b/examples/simple_room_server/MyMesh.h index 4dee8bdb..974e633a 100644 --- a/examples/simple_room_server/MyMesh.h +++ b/examples/simple_room_server/MyMesh.h @@ -3,7 +3,7 @@ #include // needed for PlatformIO #include -#if defined(NRF52_PLATFORM) +#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM) #include #elif defined(RP2040_PLATFORM) #include diff --git a/examples/simple_room_server/main.cpp b/examples/simple_room_server/main.cpp index 65fc55ef..4bfad4e5 100644 --- a/examples/simple_room_server/main.cpp +++ b/examples/simple_room_server/main.cpp @@ -50,7 +50,7 @@ void setup() { fast_rng.begin(radio_driver.getRngSeed()); FILESYSTEM* fs; -#if defined(NRF52_PLATFORM) +#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM) InternalFS.begin(); fs = &InternalFS; IdentityStore store(InternalFS, "");