I am trying to allocate some memory from spiram, but heap_caps_malloc() is returning null.
What's the problem ?
In chip esp32-s3 is possible allocate dma memory from spiram !!!
chip: esp32-s3
chip revision: 0
ESP-ROM:esp32s3-20210327
idf version: v4.4-dev-3675-g35b20cadce
menuconfig: make ram allocatable using heap_caps_malloc(..., MALLOC_CAP_SPIRAM)
board: * ESP32-S3-DevKitC-1
* esp32-s3-wroom-1 D2N8R8
Code: Select all
uint16_t* p_buffer_a = (uint16_t*) heap_caps_malloc( 307200, MALLOC_CAP_8BIT | MALLOC_CAP_DMA | MALLOC_CAP_SPIRAM );
uint16_t* p_buffer_b = (uint16_t*) heap_caps_malloc( 307200, MALLOC_CAP_8BIT | MALLOC_CAP_DMA | MALLOC_CAP_SPIRAM );
if( p_buffer_a == NULL || p_buffer_b == NULL )
{
if( p_buffer_a == NULL ) ESP_LOGI("TAG", "p_buffer_a == NULL");
if( p_buffer_b == NULL ) ESP_LOGI("TAG", "p_buffer_b == NULL");
}