0

I have a strange problem. I have working code which I have used for a long time and did some refactoring moving to use the ArduinoJson library on an ESP32.

My problem now is that by (sometimes) adding any code the ESP32 seems to crash as soon as it boots:

16:06:18.253 -> rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
16:06:18.253 -> configsip: 0, SPIWP:0xee
16:06:18.253 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
16:06:18.253 -> mode:DIO, clock div:1
16:06:18.253 -> load:0x3fff0030,len:1184
16:06:18.253 -> load:0x40078000,len:13260
16:06:18.253 -> load:0x40080400,len:3028
16:06:18.253 -> entry 0x400805e4
16:06:18.681 -> ets Jul 29 2019 12:21:46

The code added could be a Serial.print("TEST");

I am at the end of my memory, but have been there a long time and at one point was even closer.

Sketch uses 1305157 bytes (99%) of program storage space. Maximum is 1310720 bytes.
Global variables use 56812 bytes (17%) of dynamic memory, leaving 270868 bytes for local variables. Maximum is 327680 bytes.

What could the cause be? I have no idea, but it now grinds the project to a halt and it doesn't seem to be the code as no code seems to be executed.

1
  • From Arduino IDE Menu, Choose Tools -> Partition Scheme to pick a scheme for bigger APP memory. Commented Jan 10, 2024 at 13:07

1 Answer 1

0

I have exactly the same issue on my ESP32 DevBoard (Arduino IDE 1.8.19)…

Sketch uses 1306737 bytes (99%) of program storage space. Maximum is 1310720 bytes. Global variables use 55672 bytes (16%) of dynamic memory, leaving 272008 bytes for local variables. Maximum is 327680 bytes.

Which causes my ESP32 to repeatedly crash on boot, with the repeated message:

rst:0x3 (SW_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:DIO, clock div:1 load:0x3fff0030,len:1344 load:0x40078000,len:13836 load:0x40080400,len:3608 entry 0x400805f0

The fix was simply to change the Arduino “Partition Scheme” setting from “1.2MB App” to “1.9MB App” (ie. so one does NOT use the top 1% of “program storage space”), so the IDE instead reports:

Sketch uses 1306737 bytes (66%) of program storage space. Maximum is 1966080 bytes. Global variables use 55672 bytes (16%) of dynamic memory, leaving 272008 bytes for local variables. Maximum is 327680 bytes.

I suspect that this may be because there is some memory at the very top (approx top 1%) of the “program storage space” which shouldn’t be overwritten, and if it is overwritten causes constantly repeated ESP crashes on boot.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.