diff --git a/components/esp_system/esp_async_memcpy.c b/components/esp_system/esp_async_memcpy.c index dc19267be7..8e74268796 100644 --- a/components/esp_system/esp_async_memcpy.c +++ b/components/esp_system/esp_async_memcpy.c @@ -70,7 +70,7 @@ esp_err_t esp_async_memcpy_install(const async_memcpy_config_t *config, async_me // context memory size + stream pool size size_t total_malloc_size = sizeof(async_memcpy_context_t) + sizeof(async_memcpy_stream_t) * config->backlog * 2; // to work when cache is disabled, the driver handle should located in SRAM - mcp_hdl = heap_caps_calloc(1, total_malloc_size, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT); + mcp_hdl = heap_caps_calloc(1, total_malloc_size, MALLOC_CAP_8BIT | MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL); ASMCP_CHECK(mcp_hdl, "allocate context memory failed", err, ESP_ERR_NO_MEM); int int_flags = ESP_INTR_FLAG_IRAM; // interrupt can still work when cache is disabled diff --git a/components/esp_system/test/test_async_memcpy.c b/components/esp_system/test/test_async_memcpy.c index 6b250e16cd..3896104092 100644 --- a/components/esp_system/test/test_async_memcpy.c +++ b/components/esp_system/test/test_async_memcpy.c @@ -22,8 +22,8 @@ static void async_memcpy_setup_testbench(uint32_t seed, uint32_t *buffer_size, u srand(seed); printf("allocating memory buffer...\r\n"); // memory copy from/to PSRAM is not allowed - *src_buf = heap_caps_malloc(*buffer_size, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT); - *dst_buf = heap_caps_calloc(1, *buffer_size, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT); + *src_buf = heap_caps_malloc(*buffer_size, MALLOC_CAP_8BIT | MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL); + *dst_buf = heap_caps_calloc(1, *buffer_size, MALLOC_CAP_8BIT | MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL); TEST_ASSERT_NOT_NULL_MESSAGE(*src_buf, "allocate source buffer failed"); TEST_ASSERT_NOT_NULL_MESSAGE(*dst_buf, "allocate destination buffer failed");