10-20-2017 08:51 AM - edited 10-22-2017 08:49 AM
we have a problem on setting up SPI PS as slave, with interrupt driven receiving.
We are working on a Zynq 7z007s in bare metal.
Starting from the examples provided into the SDK package we succeded in receiving a known number of data less than 128byte.
It seems that there’s no chance to handle data transfer:
We would like to use XSpiPs_Transfer function passing not the known data length as parameter, but the maximum data length.
The interrupt should be risen when the slave select is deasserted (so when the transaction is over).
In this interrupt we would like to know how many bytes have been received.
In attachment you can find a part of the code we use.
10-20-2017 07:10 PM
you could try to set the threshold level (# frames in the RX FIFO) at which the interrupt is triggered.
That's the value set in the TX_thres_regN register (check TRM's Appendix B).
Changing it may solve your issue.
The SPI FIFO thresholds are a bit of a challenge because they raise interrupts upon crossing the threshold.
The interrupts are not kept raised as long as the contents of the FIFO is below (TX) or above (RX) the threshold as most controllers do.
To make things even more difficult, there are no way to know the number of frames in the FIFO.
If you want to diverge from the BSP, you can get our SPI driver by requesting it from
It handles all these shortcomings in the interrupt handler and a demo is supplied for the Zedboard.
It should be easy for you to set the driver up to operate on your target platform.
10-22-2017 08:47 AM