Page 1 of 1

SPI Master-Slave errors sending/receiving 32 bytes between two ESP8266

Posted: Tue Oct 29, 2019 1:18 am
by Inquisitor
I submitted issues on your GitHub repositories: and but wasn't sure where Espressif monitors for bugs... so adding this post.

I am only using your spi_test.c and the spi_interface files in the driver_lib sections. ESP8266_NONOS_SDK/examples/peripheral_test/user/spi_test.c

The first bug (first link above) I found concerning the slaves not properly receiving the 32bytes - I tracked down to the fact that your spi_test program was sending a 1 byte command, 4 byte address, and 32 bytes data. However, the slave instance, when it uses the SPIInit() in the spi_interface.c file (line 146) expects a 1 byte command, 1 byte address and 32 bytes of data. As soon as I changed the spi_test.c (line 150) to spiData.addrLen = 1; The Master => Slave direction is working correctly.

The second bug concerns when the Master pulls the data back from the Slave. Although a Logic Analyzer shows that Master is transferring the 32 bytes correctly, somewhere in the code that data is being misplaced into the SPI_W0... registers.

Screen dumps of the output from spi_test.c and an image of the logic analyzer retrieved data can be found in the second link above.

For this second bug, I cannot find any parameters that I can change having any affect on the data placement. However, because the Logic Analyzer is seeing the 32 bytes correctly transferred, I suspect the change is in the lower level code on the Master side.

Thank you for any help you can provide fixing this bug.

Re: SPI Master-Slave errors sending/receiving 32 bytes between two ESP8266

Posted: Fri Nov 29, 2019 11:26 am
by Her Mary
Would you like to try ESP8266 RTOS SDK instead? ... herals/spi