Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32 code can be compiled with global static arrays that cause FreeRTOS crash at runtime. (IDFGH-814) #3211

Open
marcmerlin opened this issue Mar 20, 2019 · 2 comments
Labels
Status: Selected for Development Issue is selected for development

Comments

@marcmerlin
Copy link

As referenced by @projectgus in espressif/arduino-esp32#2567
"the (apparently new) case of arrays fitting at compile time but taking enough space that FreeRTOS crashes at startup? (assert on malloc fail as you pointed out)."

Compile output:
Global variables use 110860 bytes (33%) of dynamic memory, leaving 216820 bytes for local variables. Maximum is 327680 bytes.

crash before changing to malloc:
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
0x40088960: invoke_abort at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/panic.c line 140
0x40088b63: abort at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/panic.c line 149
0x40082b72: start_cpu0_default at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/cpu_start.c line 381
0x40082d04: call_start_cpu0 at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/cpu_start.c line 213

If the array is too big, the compiler catches that and says it won't fit.
If it's a bit smaller, the compiler/linker succeeds, but freertos crashes at runtime before arduino setup() can be run.

@github-actions github-actions bot changed the title ESP32 code can be compiled with global static arrays that cause FreeRTOS crash at runtime. ESP32 code can be compiled with global static arrays that cause FreeRTOS crash at runtime. (IDFGH-814) Mar 20, 2019
@marcmerlin
Copy link
Author

@projectgus did you have someone you wanted to assign this to?

@projectgus projectgus self-assigned this Apr 8, 2019
@projectgus
Copy link
Contributor

Hi @marcmerlin ,

The internal ticket that tracks this one is assigned to me. Will update here once we have any progress.

Angus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Selected for Development Issue is selected for development
Projects
None yet
Development

No branches or pull requests

4 participants