You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "fdcavalcanti (via GitHub)" <gi...@apache.org> on 2026/04/10 15:44:44 UTC
[PR] Bugfix/esp wifi fix irq [nuttx]
fdcavalcanti opened a new pull request, #18709:
URL: https://github.com/apache/nuttx/pull/18709
## Summary
Wi-Fi interrupt setup in the ESP32/ESP32-S2/ESP32-S3 (Xtensa) and ESP32-C3/C6 (RISC-V) Wi-Fi adapters now uses the HAL’s global vector descriptor (`get_desc_for_int`) instead of a separately allocated `vector_desc`, and registers each line as **not** in IRAM via `esp_intr_set_in_iram(handle, false)`. That aligns Wi-Fi IRQs with `esp_intr_noniram_disable()` so they are masked while SPI flash operations hold the cache disabled, reducing risk of Wi-Fi ISRs running from flash in that window.
- `3405a94f29` arch/risc-v: register Wi-Fi IRQs in non_iram mask for SPI flash
- `909177e5b7` arch/xtensa: register Wi-Fi IRQs in non_iram mask for SPI flash
This PR fixes an issue where SPI Flash and Wi-Fi would crash when used together. The reason was that Wi-Fi interrupts were accessing cached functions while it was disabled. The correct operation here is to disable Wi-Fi interrupts while cache is off.
## Impact
Impact on user: **YES** — Wi-Fi stability on Espressif boards when SPI flash holds the cache disabled; no public API change.
Impact on build: **NO**
Impact on hardware: **YES** — ESP32, ESP32-S2, ESP32-S3, ESP32-C3, ESP32-C6 (Wi-Fi + SPI flash coexistence).
Impact on documentation: **NO**
Impact on security: **NO**
Impact on compatibility: **NO**
## Testing
### Building
- `./tools/configure.sh esp32c6-devkitc`
- `make` (with usual parallelism)
- Flash the board with your usual method for this defconfig
### Running
- `wapi psk wlan0 <password> 3 2`
- `wapi essid wlan0 <ssid> 1`
- `renew wlan0`
- `wapi save_config wlan0`
### Results
Before the changes, `wapi save_config` would simply crash with no warning or backtrace. Now it works properly.
```
nsh> wapi psk wlan0 espmint123 3 2
nsh> wapi essid wlan0 Nuttx-IOT 1
nsh> renew wlan0
nsh> wapi save_config wlan0
nsh> echo $?
0
nsh> cat /data/wapi.conf
{"wlan0":{"mode":2,"auth":4,"cmode":8,"alg":3,"ssid":"Nuttx-IOT","bssid":"e0:1c:fc:00:??:??","psk":"espmint123"}}nsh>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] espressif: fix Wi-Fi IRQ issue during SPI Flash operations [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on code in PR #18709:
URL: https://github.com/apache/nuttx/pull/18709#discussion_r3065460147
##########
arch/risc-v/src/esp32c3/esp_wifi_adapter.c:
##########
@@ -85,6 +86,10 @@ struct vector_desc_t
vector_desc_t *next;
};
+/* esp_hw_support/intr_alloc.c */
Review Comment:
Please improve this comment, please explain the purpose of this get_desc_for_int()
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] espressif: fix Wi-Fi IRQ issue during SPI Flash operations [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #18709:
URL: https://github.com/apache/nuttx/pull/18709#issuecomment-4225156798
@fdcavalcanti I opened an Issue about this wapi.conf keeping the password in plain text:
https://github.com/apache/nuttx/issues/18710
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] espressif: fix Wi-Fi IRQ issue during SPI Flash operations [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #18709:
URL: https://github.com/apache/nuttx/pull/18709
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org