When setting an effect script in the ARTI-FX editor with "Save and Run", the controller sometimes crashes (after the first .
is printed to the "Compile and Run Log") and ends up in a boot loop. To fix it, I need to reflash and reconfigure WLED.
It seems to depend on the number of (global?) variables and/or the number of conditions, but I wasn't able to exactly pinpoint. Here's a simple repro:
program CrashRepro
{
fr01 = 0
fr02 = 0
fr03 = 0
fr04 = 0
fr05 = 0
fr06 = 0
fr07 = 0
fr08 = 0
fr09 = 0
fr10 = 0
fr11 = 0
fr12 = 0
fr13 = 0
fr14 = 0
fr15 = 0
fr16 = 0
fr17 = 0
fr18 = 0
fr19 = 0
fr20 = 0
fr21 = 0
fr22 = 0
fr23 = 0
fr24 = 0
fr25 = 0
fr26 = 0
fr27 = 0
fr28 = 0
fr29 = 0
fr30 = 0
fr31 = 0
fr32 = 0
function renderFrame()
{
}
}
No bricking, i.e., graceful error handling.
ets Jul 29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DOUT, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1084
load:0x40078000,len:11220
load:0x40080400,len:5360
entry 0x4008067c
---WLED 0.14.0-b27.31 2309170 INIT---
WLEDMM_0.14.0-b27.31 esp32_4MB_M, build 2309170.
CPU: ESP32-D0WDQ5 rev.3, 2 core(s), 240MHz.
CPU Restart due to power-on event (code 1). Core#0 power-on (1); Core#1 restart (14).
FLASH: 4MB, Mode 3, speed 40MHz.
Mount FS
done Mounting FS
Successfully inited strip 0 (len 30) with type 22 and pin 16 (itype 21)
Usermods setup ...
AR: sound input driver initialized successfully.
Ada
GPIO | Assigned to | Info
--------|-----------------------|------------
i/o 0 Button
i/o 1 ./. Serial TX
i/o 2 ./.
i/o 3 ./. Serial RX
i/o 4 ./.
i/o 5 ./. (default) Rotary CLK pin
i/o 12 ./.
i/o 13 ./.
i/o 14 AudioReactive (UM)
i/o 15 AudioReactive (UM)
i/o 16 LEDs (digital) (default) LED pin
i/o 17 ./.
i/o 18 Temperature (UM) (default) Rotary DT pin
i/o 19 ./. (default) Rotary SW pin
i/o 20 ./.
i/o 21 ./. (default) DHT temperature pin
i/o 22 ./.
i/o 23 ./.
i/o 25 ./.
i/o 26 ./.
i/o 27 ./.
i/o 32 AudioReactive (UM)
i/o 33 ./.
in 34 ./.
in 35 ./.
in 36 ./.
in 37 ./.
in 38 ./.
in 39 ./.
WLED initialization done.
Ada
Connecting to UPC1306744 / ************ ...
Connected! IP address: <removed>
ArduinoOTA: wled-ea4bc0
mDNS started: wled-ea4bc0.local
Client request done
File uploaded: /presets.json
File uploaded: /cfg.json
WLED RESTART
ets Jul 29 2019 12:21:46
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DOUT, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1084
load:0x40078000,len:11220
load:0x40080400,len:5360
entry 0x4008067c
---WLED 0.14.0-b27.31 2309170 INIT---
WLEDMM_0.14.0-b27.31 esp32_4MB_M, build 2309170.
CPU: ESP32-D0WDQ5 rev.3, 2 core(s), 240MHz.
CPU Software restart via esp_restart() (code 3). Core#0 SW restart (12); Core#1 SW restart (12).
FLASH: 4MB, Mode 3, speed 40MHz.
Mount FS
done Mounting FS
Successfully inited strip 0 (len 26) with type 22 and pin 16 (itype 21)
Usermods setup ...
AR: sound input driver initialized successfully.
Ada
GPIO | Assigned to | Info
--------|-----------------------|------------
i/o 0 Button
i/o 1 ./. Serial TX
i/o 2 ./.
i/o 3 ./. Serial RX
i/o 4 ./.
i/o 5 AudioReactive (UM) (default) Rotary CLK pin
i/o 12 ./.
i/o 13 ./.
i/o 14 ./.
i/o 15 ./.
i/o 16 LEDs (digital) (default) LED pin
i/o 17 ./.
i/o 18 Temperature (UM) (default) Rotary DT pin
i/o 19 ./. (default) Rotary SW pin
i/o 20 ./.
i/o 21 AudioReactive (UM) (default) DHT temperature pin
i/o 22 ./.
i/o 23 ./.
i/o 25 ./.
i/o 26 AudioReactive (UM)
i/o 27 ./.
i/o 32 ./.
i/o 33 ./.
in 34 ./.
in 35 ./.
in 36 ./.
in 37 ./.
in 38 ./.
in 39 ./.
WLED initialization done.
Ada
Connecting to UPC1306744 / ************ ...
Connected! IP address: <removed>
ArduinoOTA: wled-ea4bc0
mDNS started: wled-ea4bc0.local
Client request done
File uploaded: /wledv033.json
File uploaded: /body.wled
closing Arti 110344
closed Arti 110344 โ
Destruct ARTI
Error: parseTree should be array or object null (9)
Error: parseTree should be array or object null (9)
Error: parseTree should be array or object null (9)
Error: parseTree should be array or object null (9)
Error: parseTree should be array or object null (9)
Error: parseTree should be array or object null (9)
Error: parseTree should be array or object null (9)
...repeated 1875 times!
File uploaded: /body.wled
closing Arti 65616
Destruct ScopedSymbolTable renderFrame (65852)
Destruct Symbol selectedBinIndex (66072)
Destruct Symbol selectedBinValue (66144)
Destruct Symbol lastMillis (66212)
Destruct Symbol millisSinceLastFrame (66284)
Destruct Symbol bassLuminance (66348)
Destruct Symbol bassColorIndex (66420)
Destruct Symbol bassAverage (66484)
Destruct Symbol bassAverageSampleCount (66552)
Destruct Symbol maxBpm (66620)
Destruct Symbol minBeatDuration (66688)
Destruct Symbol beatDetectState (66756)
Destruct Symbol beatDetectStateTime (66824)
Destruct Symbol beatDetectAttackDuration (66892)
Destruct Symbol fr01 (66960)
Destruct Symbol fr02 (67028)
Destruct Symbol fr03 (67100)
Destruct Symbol fr04 (67164)
Destruct Symbol fr05 (67232)
Destruct Symbol fr06 (67300)
Destruct Symbol fr07 (67368)
Destruct Symbol fr08 (67436)
Destruct Symbol fr09 (67504)
Destruct Symbol fr10 (67572)
Destruct Symbol fr11 (67640)
Destruct Symbol fr12 (67708)
Destruct Symbol fr13 (67776)
Destruct Symbol fr14 (67844)
Destruct Symbol fr15 (67912)
Destruct Symbol fr16 (67980)
Destruct Symbol renderFrame (68048)
Destruct ScopedSymbolTable SpotV1 (68120)
definitionJson 5154 / 62% (26 0 6)
parseTree 5882 / 17% (1 0 13)
closed Arti 109444 โ
Destruct ARTI
abort() was called at PC 0x4008fac0 on core 1
ELF file SHA256: 0000000000000000
Backtrace: 0x4008a818:0x3ffb1da0 0x4008ab75:0x3ffb1dc0 0x4008fac0:0x3ffb1de0 0x4008fd39:0x3ffb1e00 0x40170c1b:0x3ffb1e20 0x40170c6d:0x3ffb1e60 0x40132a3f:0x3ffb1ea0 0x40132d00:0x3ffb1f50 0x401335c7:0x3ffb1f90 0x4015711d:0x3ffb1fb0 0x4008c5fe:0x3ffb1fd0
Rebooting...
ets Jul 29 2019 12:21:46
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DOUT, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1084
load:0x40078000,len:11220
load:0x40080400,len:5360
entry 0x4008067c
---WLED 0.14.0-b27.31 2309170 INIT---
WLEDMM_0.14.0-b27.31 esp32_4MB_M, build 2309170.
CPU: ESP32-D0WDQ5 rev.3, 2 core(s), 240MHz.
CPU Software reset due to panic or unhandled exception (SW error) (code 4). Core#0 SW restart (12); Core#1 SW restart (12).
FLASH: 4MB, Mode 3, speed 40MHz.
Mount FS
done Mounting FS
Successfully inited strip 0 (len 26) with type 22 and pin 16 (itype 21)
Usermods setup ...
AR: sound input driver initialized successfully.
Ada
GPIO | Assigned to | Info
--------|-----------------------|------------
i/o 0 Button
i/o 1 ./. Serial TX
i/o 2 ./.
i/o 3 ./. Serial RX
i/o 4 ./.
i/o 5 AudioReactive (UM) (default) Rotary CLK pin
i/o 12 ./.
i/o 13 ./.
i/o 14 ./.
i/o 15 ./.
i/o 16 LEDs (digital) (default) LED pin
i/o 17 ./.
i/o 18 Temperature (UM) (default) Rotary DT pin
i/o 19 ./. (default) Rotary SW pin
i/o 20 ./.
i/o 21 AudioReactive (UM) (default) DHT temperature pin
i/o 22 ./.
i/o 23 ./.
i/o 25 ./.
i/o 26 AudioReactive (UM)
i/o 27 ./.
i/o 32 ./.
i/o 33 ./.
in 34 ./.
in 35 ./.
in 36 ./.
in 37 ./.
in 38 ./.
in 39 ./.
WLED initialization done.
Ada
Connecting to UPC1306744 / ************ ...
CORRUPT HEAP: Bad head at 0x3ffdf214. Expected 0xabba1234 got 0x4b7d0002
abort() was called at PC 0x4008fc79 on core 1
ELF file SHA256: 0000000000000000
Backtrace: 0x4008a818:0x3ffb1dd0 0x4008ab75:0x3ffb1df0 0x4008fc79:0x3ffb1e10 0x40085fca:0x3ffb1e30 0x40086395:0x3ffb1e50 0x4000bec7:0x3ffb1e70 0x401d307d:0x3ffb1e90 0x4012caad:0x3ffb1eb0 0x4012efe1:0x3ffb1ee0 0x400ede77:0x3ffb1f30 0x40133032:0x3ffb1f50 0x401335c7:0x3ffb1f90 0x4015711d:0x3ffb1fb0 0x4008c5fe:0x3ffb1fd0
Rebooting...
ets Jul 29 2019 12:21:46
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DOUT, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1084
load:0x40078000,len:11220
load:0x40080400,len:5360
entry 0x4008067c
---WLED 0.14.0-b27.31 2309170 INIT---
[...loop continues...]