Skip to content

turn off CONFIG_ESP_SYSTEM_HW_STACK_GUARD for all relevant Espressif builds - #9748

Merged
dhalbert merged 2 commits into
adafruit:mainfrom
dhalbert:disable-c3-c6-stack-guard
Oct 23, 2024
Merged

dhalbert merged 2 commits into
adafruit:mainfrom
dhalbert:disable-c3-c6-stack-guard

Conversation

@dhalbert

@dhalbert dhalbert commented Oct 23, 2024 •

Copy link
Copy Markdown
Collaborator

Fixes #9749.

The MicroPython folks discovered this ESP-IDF bug: espressif/esp-idf#14456, which can be worked around by doing CONFIG_ESP_SYSTEM_HW_STACK_GUARD=n on both ESP32-C3 and ESP32-C6. See
espressif/esp-idf#14456
micropython#15667
micropython#15771
micropython#15997
I saw this initially and kept in mind. It sounded similar to #9749: a crash after a few minutes on C3 when using wifi.

I tested on a C3. With this fix the test program in #9749 ran for hours before I manually stopped it. Without it, it usually got a hard fault within a few minutes.

@dhalbert
dhalbert requested review from jepler and tannewt October 23, 2024 03:10
@dhalbert dhalbert changed the title d for ESP32-C3 and ESP32-C6 CONFIG_ESP_SYSTEM_HW_STACK_GUARD=n for ESP32-C3 and ESP32-C6 Oct 23, 2024

@tannewt tannewt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please match the generated style for disable so that when it gets auto-changed it is consistent. Yes, kconfig is weird using comments in a disable.

Comment thread ports/espressif/esp-idf-config/sdkconfig-esp32c3.defaults Outdated
Comment thread ports/espressif/esp-idf-config/sdkconfig-esp32c6.defaults Outdated
Comment thread ports/espressif/esp-idf-config/sdkconfig-esp32c3.defaults Outdated
@dhalbert

dhalbert commented Oct 23, 2024 •

Copy link
Copy Markdown
Collaborator Author

CONFIG_ESP_SYSTEM_HW_STACK_GUARD is enabled when SOC_ASSIST_DEBUG_SUPPORTED is defined, which is true for ESP32-C2, C3, C6, P4, and will eventually be true for C5 and C61, according to comments in ESP-IDF. So I just turned it off with not set in sdkconfig.defaults.`

@dhalbert dhalbert changed the title CONFIG_ESP_SYSTEM_HW_STACK_GUARD=n for ESP32-C3 and ESP32-C6 turn off CONFIG_ESP_SYSTEM_HW_STACK_GUARD for all relevant Espressif builds Oct 23, 2024

@tannewt tannewt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@dhalbert
dhalbert merged commit aa28570 into adafruit:main Oct 23, 2024
@dhalbert
dhalbert deleted the disable-c3-c6-stack-guard branch October 23, 2024 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hard fault crash when using HTTPServer: ESP32-C3

2 participants