From ad90373a69db39ccdd39a83129591c0f3e781af1 Mon Sep 17 00:00:00 2001 From: "Michael (XIAO Xufeng)" Date: Sat, 27 Nov 2021 15:02:17 +0000 Subject: [PATCH] sdio_slave: fixed the issue DMA desc not capable --- components/driver/sdio_slave.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/driver/sdio_slave.c b/components/driver/sdio_slave.c index 7c7fc7f205..db0913dc72 100644 --- a/components/driver/sdio_slave.c +++ b/components/driver/sdio_slave.c @@ -236,7 +236,7 @@ static esp_err_t init_context(const sdio_slave_config_t *config) sdio_ringbuf_t *buf = &(context.hal->send_desc_queue); //one item is not used. buf->size = SDIO_SLAVE_SEND_DESC_SIZE * (config->send_queue_size + 1); - buf->data = (uint8_t *)heap_caps_malloc(buf->size, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT); + buf->data = (uint8_t *)heap_caps_malloc(buf->size, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT | MALLOC_CAP_DMA); if (buf->data == NULL) { goto no_mem; } @@ -738,7 +738,7 @@ sdio_slave_buf_handle_t sdio_slave_recv_register_buf(uint8_t *start) { SDIO_SLAVE_CHECK(esp_ptr_dma_capable(start) && (uint32_t)start % 4 == 0, "buffer to register should be DMA capable and 32-bit aligned", NULL); - recv_desc_t *desc = (recv_desc_t *)heap_caps_malloc(sizeof(recv_desc_t), MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT); + recv_desc_t *desc = (recv_desc_t *)heap_caps_malloc(sizeof(recv_desc_t), MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT | MALLOC_CAP_DMA); if (desc == NULL) { SDIO_SLAVE_LOGE("cannot allocate lldesc for new buffer"); return NULL;