diff --git a/platformio.ini b/platformio.ini index db933030eb..ed0d3b9a3c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -89,6 +89,11 @@ build_flags = ${arduino_base.build_flags} -D NRF52_PLATFORM -D LFS_NO_ASSERT=1 -D EXTRAFS=1 + ; Enlarge the Arduino loop_task stack (framework default 4KB / 1024 words is too + ; small for LittleFS file opens from loop(), which overflow it and corrupt adjacent + ; heap). 2048 words = 8KB. Requires the framework's LOOP_STACK_SZ #define to be + ; #ifndef-guarded (Adafruit_nRF52_Arduino) so this override is honoured. + -D LOOP_STACK_SZ=2048 lib_deps = ${arduino_base.lib_deps} https://github.com/oltaco/CustomLFS#0.2.2