UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer sktpin
Observer
327 Views
Registered: ‎09-11-2018

XSpi slave in MicroBlaze - how to answer data to master

Jump to solution

Hello,

I'm using the axi quad spi IP (based on axi_quad_spi_v3_2_pg153), and for the software on the MicroBlaze, I found those example C files:
https://github.com/Xilinx/embeddedsw/tree/master/XilinxProcessorIPLib/drivers/spi/examples

(are they the correct ones?)

I want to configure the MicroBlaze as SPI slave, for plain old 4-wire SPI with 1 data line per direction, talking to an externally connected master CPU, based on interrupt, with 32bits width.

There is one example file which sets things up for slave/interrupt mode, but alas, it only shows how to register a status handler and receive data from the master, and print it:
https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/spi/examples/xspi_slave_intr_example.c

What it does not show is how to return data to the master for the remaining clock pulses to come.
I'm pretty sure that the "XSpi_Transfer" function is not meant to be called for that, especially not from an interrupt handler.
Am I supposed to, in the handler, just immediately write the reply into the Data Transmit Register?
Everything else in those code samples gets done by calling SDK functions (no direct fiddling with registers) - I see no function which would do what I stated above, though.

How is it supposed to be done?

0 Kudos
1 Solution

Accepted Solutions
Observer sktpin
Observer
284 Views
Registered: ‎09-11-2018

Re: XSpi slave in MicroBlaze - how to answer data to master

Jump to solution

ok, looking at it again, there was just a misunderstanding of how the library works, was used to things being setup somewhat differently in the MCU lines I worked with before.
When the bi-directional transfer routine is called, data to send out is already present (although not meaningful without previous info from the master) and just waiting for the master clock to start.

the thread can be closed ;)

 

0 Kudos
1 Reply
Observer sktpin
Observer
285 Views
Registered: ‎09-11-2018

Re: XSpi slave in MicroBlaze - how to answer data to master

Jump to solution

ok, looking at it again, there was just a misunderstanding of how the library works, was used to things being setup somewhat differently in the MCU lines I worked with before.
When the bi-directional transfer routine is called, data to send out is already present (although not meaningful without previous info from the master) and just waiting for the master clock to start.

the thread can be closed ;)

 

0 Kudos