-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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: Interrupts with ISRs in flash are not disabled during flash operations #77952
Comments
@sam-golioth, I did spot this and will get it fixed. |
When interrupts are placed in flash, it needs to be disabled when flash operations are called. This is not happening in current v3.7.0 release, causing system to crash whenever flash operations and interrupts happens simultaneously. Fixes zephyrproject-rtos#77952 Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
When interrupts are placed in flash, it needs to be disabled when flash operations are called. This is not happening in current v3.7.0 release, causing system to crash whenever flash operations and interrupts happens simultaneously. Fixes zephyrproject-rtos#77952 Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
@sam-golioth, I submitted a test patch on top of v3.7-branch. I will extend tests to make sure it won't break anything else. Would you be able to test it in your environment as well? |
So far I haven't been able to reproduce the issue with this fix! Of course, I could have just gotten lucky. I'll run more test runs over the next day or so and I'll let you know if anything pops up. Thanks, @sylvioalves! |
When interrupts are placed in flash, it needs to be disabled when flash operations are called. This is not happening in current v3.7.0 release, causing system to crash whenever flash operations and interrupts happens simultaneously. Fixes zephyrproject-rtos#77952 Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
When interrupts are placed in flash, it needs to be disabled when flash operations are called. This is not happening in current v3.7.0 release, causing system to crash whenever flash operations and interrupts happens simultaneously. Fixes zephyrproject-rtos#77952 Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
When interrupts are placed in flash, it needs to be disabled when flash operations are called. This is not happening in current v3.7.0 release, causing system to crash whenever flash operations and interrupts happens simultaneously. Fixes zephyrproject-rtos#77952 Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
When interrupts are placed in flash, it needs to be disabled when flash operations are called. This is not happening in current v3.7.0 release, causing system to crash whenever flash operations and interrupts happens simultaneously. Fixes #77952 Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
#78121 was merged. |
Describe the bug
When writing to SPI flash on the ESP32_DevKitC_WROVER, the device will crash when executing the UART interrupt (e.g. servicing the shell or logging system). The UART interrupt is located in SPI flash, so this is an execute-while-write exception (confirmed when looking at the EXCAUSE register that the reason is "Load Prohibited"). The Espressif HAL has a mechanism to keep track of which interrupts are located in flash when registering interrupts, and then disabling them when performing flash writes. This mechanism works in previous versions of Zephyr, but does not seem to be active in Zephyr 3.7. If I put a breakpoint on
esp_intr_noniram_disable()
in Zephyr 3.6, I can see this being called whenever there is a flash operation. In Zephyr 3.7, this function is never called.Expected behavior
Interrupts with ISRs located in flash should be disabled during flash operations.
Impact
Anything that writes to SPI flash is unusable for Espressif platforms on Zephyr 3.7.
Logs and console output
Backtrace for the crash:
The text was updated successfully, but these errors were encountered: