ESP8266 Developer Zone The Official ESP8266 Forum 2019-11-29T11:26:06+08:00 https://bbs.espressif.com:443/feed.php?f=66&t=51990 2019-11-29T11:26:06+08:00 2019-11-29T11:26:06+08:00 https://bbs.espressif.com:443/viewtopic.php?t=51990&p=68500#p68500 <![CDATA[Re: SPI Master-Slave errors sending/receiving 32 bytes between two ESP8266]]> https://github.com/espressif/ESP8266_RT ... herals/spi

Statistics: Posted by Her Mary — Fri Nov 29, 2019 11:26 am


]]>
2019-10-29T01:18:30+08:00 2019-10-29T01:18:30+08:00 https://bbs.espressif.com:443/viewtopic.php?t=51990&p=67543#p67543 <![CDATA[SPI Master-Slave errors sending/receiving 32 bytes between two ESP8266]]> https://github.com/espressif/ESP8266_NONOS_SDK/issues/269 and https://github.com/espressif/ESP8266_NONOS_SDK/issues/273 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. https://github.com/espressif/ESP8266_NONOS_SDK 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.

Statistics: Posted by Inquisitor — Tue Oct 29, 2019 1:18 am


]]>