11-27-2018 08:28 PM
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:
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!
12-21-2018 03:32 PM
It looks like that question was also asked back in 2010...
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
12-22-2018 12:28 AM
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.