cancel
Showing results for 
Search instead for 
Did you mean: 

USB Low-Full-High Speed Peripherals

Anonymous
Not applicable

I am trying to do a simple SPI based data logger and using cy7c65211 came with psoc4 kit in spi slave mode.

   

i am on windows10 and have written a simple c based application but its not working consistently. some time it works some times spi_read_write request fails with CY_ERROR_REQUEST_FAILED.

   

share your thoughts!

   

~SwK

0 Likes
Reply
2 Replies
Moderator
Moderator

Hi,

   

I have gone through the application. Can you tell me whether the error is occurring due to Write operation or Read operation of CySpiReadWrite() API?

   

Are you seeing that error in the following debug print in the thread handler:

   

printf("read write :- ERROR(%d)\r\n", rtnStatus);

   

Regards,

   

Hemanth

Hemanth
0 Likes
Reply
Anonymous
Not applicable

I am interested in only reading the SPI in slave mode so here txbuff is used as dummy

   

Txdata and Rxdata has same buffer length and txdata buffer is filled with '00' dummy

   

CySpiReadWrite(hSPI, &myRxData, &myTxData, 5000);

   

as per above case some time it works some time it does not.

   

 

   

if I use it like this telling the read/write api that i dont want write operation

   

CySpiReadWrite(hSPI, &myRxData, NULL, 5000);

   

then it never reads the SPI data, first call returns error:6 and subsequent calls returns timeout

0 Likes
Reply