ESP SPI transfer Max Size

jaybnair
Posts: 6
Joined: Fri Jun 23, 2017 8:20 am

ESP SPI transfer Max Size

Postby jaybnair » Sat Jun 24, 2017 7:57 am

Hi,

I have a need to transfer 4096 bytes over SPI in one transfer.
However, I see that ESP32 SPI transfer accepts only a max of 2048 bytes. Anything more than that is discarded.
Any idea where this limitation comes from or any input on how to increase the limit atleast to 4096 bytes?

Thanks
Jay

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

Re: ESP SPI transfer Max Size

Postby ESP_Sprite » Sat Jun 24, 2017 12:35 pm

Erm, it shouldn't discard the excess, the queue/transfer function should return with an error (ESP_ERR_INVALID_ARG if memory serves.) Also, the default maximum transfer size should be 4094, not 2048; are you sure you see a limit there and not at 4094?

The maximum size of the transfers is settable using the spi_bus_config_t.max_transfer_sz variable that you feed into spicommon_bus_initialize_io. Can you see if setting that higher changes anything?

User avatar
ESP_krzychb
Posts: 394
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: ESP SPI transfer Max Size

Postby ESP_krzychb » Fri Dec 22, 2017 7:39 pm

ESP_Sprite wrote:The maximum size of the transfers is settable using the spi_bus_config_t.max_transfer_sz variable that you feed into spicommon_bus_initialize_io. Can you see if setting that higher changes anything?
Indeed, setting of the ".max_transfer_sz" let me transfer more than the default maximum of 4094 bytes :idea:

Who is online

Users browsing this forum: Baidu [Spider] and 124 guests