Open yaqwsx opened 4 years ago
Is there anything I can do to help you to resolve this issue?
I am seeing similar problems. Using half duplex with DMA just the first byte is read then zeros for the rest. I pre-filled the buffer and it is actively changing it to zeros. I can see the SPI data with a logic analyzer and the data is on the lines, it is just not getting into the read buffer (except the first byte).
Environment
Problem Description
There is a half-duplex SPI bus, where ESP32 is master and talks to custom hardware. The write operation works as expected, the read operation reads several bytes correctly, the other bytes it reads as zero. The data are physically present on the bus (verified by an oscilloscope). This happens only in the DMA mode. When I call
spi_bus_initialize
with thedma_chan
0, everything starts to work as expected. However, DMA is not used.Also note, that the function
spi_device_transmit
writes to all bytes of the output buffer, but the values are zero.Steps to reproduce
Unfortunately, the bug is present in a fairly large codebase involving custom hardware. I wasn't able to create a simple reproducible example using only devkits and commonly available hardware (yet).
Code to reproduce this issue
Code to initialize the bus (the code uses custom C++ wrappers which are fairly simple and I can guarantee they work properly):
Reading from the bus: