ESP IDF GPIO mallocs gpio_isr_func in gpio_install_isr_service, which causes crashes in case of CONFIG_SPIRAM_USE_MALLOC=y (IDFGH-10644) #11876
Labels
Resolution: NA
Issue resolution is unavailable
Status: Done
Issue is done internally
Type: Bug
bugs in IDF
Answers checklist.
IDF version.
v4.4.4
Operating System used.
Windows
How did you build your project?
Command line with Make
If you are using Windows, please specify command line type.
None
Development Kit.
ESP32-wrover-kit
Power Supply used.
USB
What is the expected behavior?
Expect: to have the possibility of running gpio ISR fully in IRAM/DRAM while still having mallocs go into external SPIRAM (which is not accessible in critical sections)
What is the actual behavior?
During cache locks (spi write to file system), and subsequent gpio ISR, the system cannot access anything on the SPI RAM. Hence, all structures and code in the ISR should be IRAM/DRAM
However, the function gpio_install_isr_service mallocs a structure, which is accessed in gpio_intr_service.
When CONFIG_SPIRAM_USE_MALLOC=y is set, with a small minimum size, this creates crashes like on the debuglogs
Steps to reproduce.
Make sure a gpio ISR triggers during a spi filesystem write, and make sure you have CONFIG_SPIRAM_USE_MALLOC=y
The result will be that the structure gpio_isr_func will not be accessible, and one reproduces a crash
Debug Logs.
More Information.
No response
The text was updated successfully, but these errors were encountered: