diff --git a/platformio.ini b/platformio.ini index 9793c32d25..105186e9c2 100644 --- a/platformio.ini +++ b/platformio.ini @@ -82,13 +82,19 @@ extends = arduino_base platform = nordicnrf52 platform_packages = ; fork that includes patch to ble stack to prevent firmware lockup during rapid connect/disconnect (PRs #1177, #1295) - ; plus LittleFS v1.7.2 upgrade - framework-arduinoadafruitnrf52 @ https://github.com/weebl2000/Adafruit_nRF52_Arduino.git#724e00a76e74132a8e30097e96ad4e27c4547b12 ; 1.10700.1 + ; plus LittleFS v1.7.2 upgrade, plus #ifndef guard so LOOP_STACK_SZ (below) is overridable + ; (PR weebl2000/Adafruit_nRF52_Arduino#1 -- repin to weebl2000 once merged & tagged) + framework-arduinoadafruitnrf52 @ https://github.com/disq/Adafruit_nRF52_Arduino.git#f019297fa2c09a3484b482b144e7b187f4226044 extra_scripts = create-uf2.py 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