SPI2 and SPI3 in parallel
Posted: Sun Aug 13, 2023 9:25 am
Hi all,
I'm trying to achieve very high speed in controlling a 4-PIN (SPI) LED strip with an ESP32-S3.
The strip only receives messages from SPI, it never replies, so it only has 2 pins for the SPI: MOSI and CLK.
In order to halve the communication time between the ESP32-S3 and the strip i decided to split the strip in two halves and drive the two halves in parallel with SPI2 and SPI3 buses.
I can successfully initialize both buses and talk with each halve of the strip independently, but I'm having hard times sending the commands to the two buses concurrently.
Please keep in mind that I'm using DMA so I'm expecting the two SPI hosts to be able to work independently.
My initial idea was to use something like
but it seems that spi_device_polling_start cannot be invoked if a previous polling transaction is still in progress, despite the two device handlers (spi_A and spi_B) referring to different SPI hosts.
Does the ESP32-S3 hardware (SPI hosts, DMA channels, ...) allows concurrent SPI transfers? Is this some kind of software limitation of the ESP-IDF framework? Or, more probably, am I doing something wrong?
Thank you!
I'm trying to achieve very high speed in controlling a 4-PIN (SPI) LED strip with an ESP32-S3.
The strip only receives messages from SPI, it never replies, so it only has 2 pins for the SPI: MOSI and CLK.
In order to halve the communication time between the ESP32-S3 and the strip i decided to split the strip in two halves and drive the two halves in parallel with SPI2 and SPI3 buses.
I can successfully initialize both buses and talk with each halve of the strip independently, but I'm having hard times sending the commands to the two buses concurrently.
Please keep in mind that I'm using DMA so I'm expecting the two SPI hosts to be able to work independently.
My initial idea was to use something like
Code: Select all
spi_device_polling_start(spi_A, &t_A, portMAX_DELAY);
spi_device_polling_start(spi_B, &t_B, portMAX_DELAY);
spi_device_polling_end(spi_A, portMAX_DELAY);
spi_device_polling_end(spi_B, portMAX_DELAY);
Does the ESP32-S3 hardware (SPI hosts, DMA channels, ...) allows concurrent SPI transfers? Is this some kind of software limitation of the ESP-IDF framework? Or, more probably, am I doing something wrong?
Thank you!