SPI slave driver, last 4 Bytes missing (using DMA)

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

Re: SPI slave driver, last 4 Bytes missing (using DMA)

Postby ESP_Sprite » Mon Jan 14, 2019 3:14 am

Not that I know. You may be able to use the non-DMA mode up to a point, but that only works up to a limited amount of bytes...

squonk11
Posts: 69
Joined: Wed Mar 01, 2017 6:53 pm
Location: Germany

Re: SPI slave driver, last 4 Bytes missing (using DMA)

Postby squonk11 » Mon Jan 14, 2019 12:21 pm

The non-DMA mode (just using the internal buffer of the ESP32) unfortunately is not a solution for me because I need to receive up to 114 bytes and the internal buffer of the ESP32 is only 32 bytes.
I am wondering if it might be possible to activate an interrupt instead of a DMA transaction. In order to check this I was studying the spi_slave.c driver sources. But for me it is not clear how the HW of the SSI works in detail. Is there some deeper description as given in the ESP32 Technical Refernce Manual?
"Whoever believes to be someone has stopped becoming someone"
Sokrates

squonk11
Posts: 69
Joined: Wed Mar 01, 2017 6:53 pm
Location: Germany

Re: SPI slave driver, last 4 Bytes missing (using DMA)

Postby squonk11 » Thu Jan 17, 2019 5:02 pm

@ESP_sprite : do you know if there will be a new silicon version of the ESP32 with this issue fixed or at least a workaround in ESP-IDF? If not I will need to switch to a different chip because a SPI slave interface suitable for an arbitrary number of incoming data bytes is mandatory for my project.
"Whoever believes to be someone has stopped becoming someone"
Sokrates

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

Re: SPI slave driver, last 4 Bytes missing (using DMA)

Postby ESP_Sprite » Sat Jan 19, 2019 3:40 am

We are working on new silicon, and we're very much aware that the SPI in the ESP32 is not perfect... we're trying as hard as we can to get the most common idiosyncracies in the current SPI peripheral out of the design, and I'd imagine this is one of them.

squonk11
Posts: 69
Joined: Wed Mar 01, 2017 6:53 pm
Location: Germany

Re: SPI slave driver, last 4 Bytes missing (using DMA)

Postby squonk11 » Sun Jan 20, 2019 12:54 pm

@ESP_sprite : Is there a schedule when the new silicon is available? Will it be just a new step of the ESP32 or will it be a feature enhanced version of the ESP32?
"Whoever believes to be someone has stopped becoming someone"
Sokrates

ghazel
Posts: 1
Joined: Fri Jan 25, 2019 4:10 am

Re: SPI slave driver, last 4 Bytes missing (using DMA)

Postby ghazel » Fri Jan 25, 2019 4:12 am

ESP_Sprite wrote:
Sat Jan 12, 2019 5:24 am
As I said before, for people who run into issues like this: check your /cs signal. The SPI slave logic assumes the /cs signal goes high after the transaction is finished. If for whatever reason (clock slew, difference in wire length, whatever) the ESP32 sees the /cs signal going high before the transaction is done, it aborts the transaction in a weird way that can cause the last 4 bytes to get corrupted or not written.
I am also encountering this issue, and I verified with a signal analyzer on the ESP32 side that the /cs signal goes high well after the clock is done and the transaction is finished. Yet, the last four bytes are still missing. https://github.com/espressif/esp-idf/is ... -456285033

Who is online

Users browsing this forum: No registered users and 52 guests