cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer
Observer
515 Views
Registered: ‎08-28-2018

Question about AXI spi slave mode

Hi everyone,

I'm new to using the slave mode axi spi. I want to use this spi to receive data from an external master. When I run the xspi_slave_polled_example, the code is stucked in XSpi_Transfer(SpiInstancePtr, WriteBuffer, ReadBuffer, BUFFER_SIZE). And I have checked inside the function XSpi_Transfer I found that the code stucked in this loop:

do {
StatusReg = XSpi_IntrGetStatus(InstancePtr);
} while ((StatusReg & XSP_INTR_TX_EMPTY_MASK) == 0);

I really have no idea how this problem happens. Cause I'm just running the example code and it can't work. I can run the spi with master mode well. Anyone could give me some ideas? Thanks!

Regards,

Han

0 Kudos
2 Replies
Highlighted
Teacher
Teacher
452 Views
Registered: ‎10-23-2018

Re: Question about AXI spi slave mode

@pmuproject

It looks like that question was also asked back in 2010...

https://forums.xilinx.com/t5/Embedded-Boot-and-Configuration/XSpi-Transfer-hangs-on-unknown-opcodes/td-p/834272

They didn't give an answer then... I would check to see the value of the MASK and the range of the status register and make sure that and-ing them can indeed become a non-zero value. If the Status register was always returning a zero, it would indeed get stuck... If that is the case, you would need to look up stream... 

Another thought... is the InstancePtr valid? If not, maybe always return 0

 

0 Kudos
Highlighted
431 Views
Registered: ‎08-07-2018

Re: Question about AXI spi slave mode

Did you configure CPOL and CPHA in the SPI Control Register(0x60) correctly?

Default it should be CPOL=0 and CPHA=0, so maybe your SPI-Master has a different configuration.

0 Kudos