Skip to content

cpu/esp32: fix esp_wifi stability problem by placing wdt_hal_* functions in IRAM#21980

Merged
benpicco merged 1 commit intoRIOT-OS:masterfrom
gschorcht:cpu/esp32/fix_place_wdt_hal_in_iram
Jan 12, 2026
Merged

cpu/esp32: fix esp_wifi stability problem by placing wdt_hal_* functions in IRAM#21980
benpicco merged 1 commit intoRIOT-OS:masterfrom
gschorcht:cpu/esp32/fix_place_wdt_hal_in_iram

Conversation

@gschorcht
Copy link
Copy Markdown
Contributor

@gschorcht gschorcht commented Jan 12, 2026

Contribution description

The PR fixes an issue caused by missing entries for wdt_hal_* functions in sections.ld files for ESP32-S3, ESP32-C6 and ESP32-H2.

wdt_hal_* functions of the IDF have to be placed in IRAM to avoid crashes when wdt_hal_* functions are used while SPI Flash Cache is disabled. For ESP32-S3, ESP32-C6 and ESP32-H2, these functions were placed in IROM due to missing entries in sections.ld files. Especially on ESP32-S3, this led to crashes while connecting to a WiFi AP.

The issue was found while investigating issue #21923.

Testing procedure

Use any ESP32-S3 board and flash the GNRC networking example with enabled esp_wifi module, for example

CFLAGS='-DWIFI_SSID=\"ssid\" -DWIFI_PASS=\"pass\"' USEMODULE='esp_wifi' \
BOARD=esp32s3-devkit make -j8 -C examples/networking/gnrc/networking flash term

Without this PR, the ESP32-S3 board mostly hangs after reset while connecting to the WiFi AP. With the PR connecting to the WiFi AP should work stable.

Issues/PRs references

@github-actions github-actions bot added Platform: ESP Platform: This PR/issue effects ESP-based platforms Area: cpu Area: CPU/MCU ports labels Jan 12, 2026
@gschorcht gschorcht added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jan 12, 2026
@gschorcht gschorcht requested a review from benpicco January 12, 2026 16:09
@benpicco benpicco enabled auto-merge January 12, 2026 16:56
@riot-ci
Copy link
Copy Markdown

riot-ci commented Jan 12, 2026

Murdock results

✔️ PASSED

2a67c32 cpu/esp32: place wdt_hal_* functions in IRAM

Success Failures Total Runtime
10984 0 10984 11m:48s

Artifacts

@benpicco benpicco added this pull request to the merge queue Jan 12, 2026
Merged via the queue into RIOT-OS:master with commit 5bf5469 Jan 12, 2026
28 checks passed
@leandrolanzieri leandrolanzieri added this to the Release 2026.01 milestone Jan 13, 2026
@gschorcht gschorcht deleted the cpu/esp32/fix_place_wdt_hal_in_iram branch January 13, 2026 17:34
@gschorcht
Copy link
Copy Markdown
Contributor Author

@benpicco Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ESP Platform: This PR/issue effects ESP-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants