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
Crash in I2S when use ESP_INTR_FLAG_IRAM flag in the driver config (IDFGH-2432) #4545
Comments
Thanks for the problem you found, it may be better to use |
Great. The placement of the I2S interrupt handler in IRAM is necessary to avoid sound distortion during other long-term SPI FLASH operations. |
it would be nice to see it also in the 3.3.x |
I have similar issues. The fix is great, but I haven't been able to run my external codec (WM8731) glitch free when reading a file from spiffs flash and serving the file's content with the http server... |
@phonec Thanks for reporting and updates. We have back ported the fixes to IDF v3.3 and is now under internal review, would update once the fix is available on GitHub. Thanks. |
My issue was in fact related to the http server core id. I configured the httpd to use core 0 and i2s core 1. It was unrelated to flash access. |
@phonec @ctag-fh-kiel The issue has been fixed and fix available on GitHub. Please help try if the issue still happens, feel free to reopen if the issue persists. Thanks. |
Environment
Problem Description
When adding a flag ESP_INTR_FLAG_IRAM to the .intr_alloc_flags configuration of i2s driver leads to a crash, because at runtime not all of the data from the i2s_intr_handler_default() interrupt handler function can be found in IRAM, although the function itself has such an attribute: IRAM_ATTR.
In particular, the array of pointers I2S[] does not have an IRAM_ATTR attribute and may not be available when the cache is disabled during such an interrupt.
Solving
Adding this attribute to the I2S pointer on line 102: esp-idf/components/driver/i2s.c
perhaps it should completely solve this problem, at least it works for me.
Steps to repropduce
Just add this flag to the configuration, for example in the esp-idf/examples/ peripherals/i2s/main/i2s_example_main.c
Debug Logs
The text was updated successfully, but these errors were encountered: