I tried setting the "SPI RAM access method" to "Make RAM allocatable using malloc() as well", and reducing "Maximum malloc() size, in bytes, to always put in internal memory" to 32 bytes, but get this crash on startup:
Code: Select all
#0 0x4008dfbc in invoke_abort () at /Users/mark/esp3o/esp-idf/components/esp32/./panic.c:139
#1 0x4008e0b2 in abort () at /Users/mark/esp3o/esp-idf/components/esp32/./panic.c:148
#2 0x4008975e in vPortCPUInitializeMutex (mux=0x3f800238) at /Users/mark/esp3o/esp-idf/components/freertos/./port.c:303
#3 0x400899fc in xQueueGenericReset (xQueue=0x3f8001e8, xNewQueue=1) at /Users/mark/esp3o/esp-idf/components/freertos/./queue.c:270
#4 0x40089a78 in prvInitialiseNewQueue (uxQueueLength=32, uxItemSize=48, pucQueueStorage=0x3f800240 '\376' <repeats 200 times>..., ucQueueType=0 '\000', pxNewQueue=0x3f8001e8)
at /Users/mark/esp3o/esp-idf/components/freertos/./queue.c:441
#5 0x40089ac9 in xQueueGenericCreate (uxQueueLength=32, uxItemSize=48, ucQueueType=0 '\000') at /Users/mark/esp3o/esp-idf/components/freertos/./queue.c:408
#6 0x40162490 in esp_event_loop_init (cb=<optimized out>, ctx=0x3ffb4980 <MyEvents>) at /Users/mark/esp3o/esp-idf/components/esp32/./event_loop.c:103
(gdb) frame 2
#2 0x4008975e in vPortCPUInitializeMutex (mux=0x3f800238) at /Users/mark/esp3o/esp-idf/components/freertos/./port.c:303
303 configASSERT(esp_ptr_internal((const void *) mux));
Anyway, for my application, it would be fine if the C++ new() operator allocated from SPI RAM. If I had a case where I needed that data for a flash write, or DMA access, I'd add a specific malloc to allocate from internal RAM.
Has anybody here done this, or worked with this? I know that the template allocators in C++ have some options for things like this, but none seem to have been provided for SPI RAM in the ESP IDF framework.