It appears that if I enable BLE and then do some flash operations (SPIFFS file write or read) I get Illegal Instruction exception:
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Register dump:
PC : 0x400d2eb2 PS : 0x00060b31 A0 : 0x8000beb2 A1 : 0x3ffc04e0
0x400d2eb2: pvPortMalloc at /Users/Kon/Armada/GitHub/armada-firmware/esp-idf/components/esp32/./heap_alloc_caps.c:305
esp-idf documentation says that accessing instructions from flash is disabled when spi flash operation is in progress. However, an ISR can potentially read from flash, which I suspect BLE stack is doing.
If I don't enable BLE, all flash operations work just fine. If I don't do flash, BLE works just fine. Thoughts?
BLE and SPI Flash Crash
Re: BLE and SPI Flash Crash
Seems like pvPortMalloc ends up being placed into cached region, which should definitely not happen (it should be in IRAM). Will take a look.
Re: BLE and SPI Flash Crash
Adding IRAM_ATTR to pvPortMalloc() and pvPortMallocCaps() fixed the crash. Not sure if this is the proper way but I'm assuming espressif will put out a formal fix. Thanks.
Who is online
Users browsing this forum: No registered users and 117 guests