SPI DMA in ESP32-S2-WROOM

srikanth r
Posts: 2
Joined: Sun Jul 26, 2020 8:09 am

SPI DMA in ESP32-S2-WROOM

Postby srikanth r » Wed Apr 07, 2021 7:26 am

hi

now we are implemented SPI poling in ESP32-S2-WROOM module. But now I need to implement SPI DMA for Transmit and receive .
is ESP32-S2-WROOM module supports SPI DMA ?
actually we searched in github, I find SPI DMA stack but in that no DMA related functions.

thank you
srikanth

ESP_Sprite
Posts: 4574
Joined: Thu Nov 26, 2015 4:08 am

Re: SPI DMA in ESP32-S2-WROOM

Postby ESP_Sprite » Wed Apr 07, 2021 9:22 am

Given that you're using the ESP-IDF SPI driver and assign a DMA channel to the host driver when initializing it, you're already using DMA. The driver will use DMA for data transfers automatically.

srikanth r
Posts: 2
Joined: Sun Jul 26, 2020 8:09 am

Re: SPI DMA in ESP32-S2-WROOM

Postby srikanth r » Wed Apr 07, 2021 12:16 pm

thanks for reply.
Actually we are using the code which is present in the link.
link: https://github.com/hideakitai/ESP32DMASPI
In example i am not seen any interrupt routine for checking Transmit complete and Receive Complete. please let me know if any other examples are there for SPI DMA implementation.


thanks in advance
srikanth

PeterR
Posts: 615
Joined: Mon Jun 04, 2018 2:47 pm

Re: SPI DMA in ESP32-S2-WROOM

Postby PeterR » Thu Apr 08, 2021 5:46 pm

Keep in mind that DMA can be counter productive for small transfers. One of my SPI channels is a cheap MPC2515 and that is a very chatty device with between 3 and 8 byte transfers. Latency & setup really kill that through put. On the short transfers I measured that no DMA was faster. Basically the SPI FIFO can handle it, you only get the ISR on CS, you don't get hit by SPI full. DMA adds a setup time to the transaction & if not needed then why spend time configuring those register? Clearly longer transfers (which bust the SPI FIFO) would benefit.
& I also believe that IDF CAN should be fixed.

denial
Posts: 2
Joined: Fri Apr 09, 2021 10:49 am

Re: SPI DMA in ESP32-S2-WROOM

Postby denial » Fri Apr 09, 2021 10:57 am

i'm new to the community and esp32 can i get a simple spi loopback example code for esp32

Who is online

Users browsing this forum: No registered users and 36 guests