Skip to content

Commit 83f8644

Browse files
committed
[Stack] Move Arduino 'cont' stack into user RAM
As suggested [here](letscontrolit#1858 (comment)) the previous used flag may also enable WPS. So I used [this suggestion](esp8266/Arduino#5148 (comment)) to only re-allocate the stack at link time.
1 parent eee337d commit 83f8644

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

platformio.ini

+3
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ monitor_speed = 115200
107107
; NO_EXTRA_4K_HEAP - this forces the default NONOS-SDK user's heap location
108108
; Default currently overlaps cont stack (Arduino) with sys stack (System)
109109
; to save up-to 4 kB of heap. (starting core_2.4.2)
110+
; ESP8266_DISABLE_EXTRA4K - Calls disable_extra4k_at_link_time() from setup
111+
; to force the linker keep user's stack in user ram.
110112
; CONT_STACKSIZE to set the 'cont' (Arduino) stack size. Default = 4096
111113

112114
[common]
@@ -218,6 +220,7 @@ debug_tool = ftdi
218220
monitor_speed = ${common.monitor_speed}
219221
board_build.partitions = esp32_partition_app1810k_spiffs316k.csv
220222
board_upload.maximum_size = 1900544
223+
debug_extra_cmds = break Misc.ino:3011
221224

222225

223226
[env:esp32dev]

src/ESPEasy.ino

+3
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ int firstEnabledBlynkController() {
106106
\*********************************************************************************************/
107107
void setup()
108108
{
109+
#ifdef ESP8266_DISABLE_EXTRA4K
110+
disable_extra4k_at_link_time();
111+
#endif
109112
WiFi.persistent(false); // Do not use SDK storage of SSID/WPA parameters
110113
WiFi.setAutoReconnect(false);
111114
setWifiMode(WIFI_OFF);

0 commit comments

Comments
 (0)