Page 1 of 1

SPI Slave and Gatt_Server integration issue...

Posted: Wed Nov 06, 2019 3:36 pm
by jjwsei
I have successfully compiled and tested both the SPI_slave receiver demo and the Gatt_server demo from V3.3 of the idf. I am now simply trying to add the SPI_slave functionality to the Gatt_server demo. In the app_main() function I have the code that sets up the SPI slave, and I have created a separate task that has a taskDelay of 10ms and is calling the spi_slave_transmit function. I am using the same SPI master that I had used to originally test the SPI_salve demo so nothing has changed on the master end. When I run make monitor I get a printout of the transaction receive buffer but all of the values are zero when the first 5 bytes should actually contain data. I am currently not doing anything else in the task but will eventually be using it to send some data via the BLE link.

Any ideas as to what I may have overlooked in adding the task aspect?

Re: SPI Slave and Gatt_Server integration issue...

Posted: Thu Nov 07, 2019 12:49 pm
by jjwsei
Update to original post....

To troubleshoot the issue I have removed the task aspect for now.

Here is what my process has been so far:

1) I verified that the GATT_Server demo worked on my hardware.
2) I verified that the SPI_Slave demo worked on my hardware.
3) I copied the app_main code from the SPI_Slave demo and pasted it into the GATT_Server demo app_main after the BT related code already there. Since the BT code is event driven the while loop from the SPI_Server demo was retained.
4) I compiled and flashed the code and the BT functionality is working as it was in the demo however the SPI functionality is not working as it did when just running the SPI_Slave demo code alone. All of the returned data are zeroes when the first 5 values should contain data.

I have compared the sdkconfig files from both demos and they are identical. My understanding of what is happening outside of the demos is limited but growing. Any help to educate myself faster would be welcomed.