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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]