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: 
Adventurer
Adventurer
1,179 Views
Registered: ‎05-23-2018

SPI no RX

I have a ZCU102 Board and want to use a SPI on a PMOD-Connector. For this i took the QuadSPI.

When running with the loopback flag everything is running fine, but when i remove the loopback and use a

connection from MOSI to MISO i always receive 0. What could be the problem ?

 

First picture D0=MOSI,D1=MISO,D2=CLK,D3=SEL.

 

This is the Constraint File for PMOD0 :

set_property PACKAGE_PIN A20 [get_ports spi_mosi]
set_property PACKAGE_PIN B20 [get_ports spi_miso]
set_property PACKAGE_PIN A22 [get_ports spi_sck]
set_property PACKAGE_PIN A21 [get_ports spi_sel]

set_property IOSTANDARD LVCMOS33 [get_ports spi_mosi]
set_property IOSTANDARD LVCMOS33 [get_ports spi_miso]
set_property IOSTANDARD LVCMOS33 [get_ports spi_sck]
set_property IOSTANDARD LVCMOS33 [get_ports spi_sel]

 

bild1.jpg
bild2.jpg
0 Kudos
12 Replies
Moderator
Moderator
1,136 Views
Registered: ‎07-31-2012

Re: SPI no RX

Hi bader@gctnet.de,

 

If you remove loopback then how are you configuring the mode of transfers in SPI?

Is it in normal mode?

 

Regards

Praveen


-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Adventurer
Adventurer
1,125 Views
Registered: ‎05-23-2018

Re: SPI no RX

I only set the MasterOption:

The SPI IP is in Standard-Mode ( not Dual or Quad ), XIP and Performance mode is disabled.

And this is the setting in the SDK:

    Status = XSpi_SetOptions(&Spi_PL, XSP_MASTER_OPTION );

0 Kudos
Adventurer
Adventurer
1,120 Views
Registered: ‎05-23-2018

Re: SPI no RX

Here is a part of my serial output:

TX: 0x01 0x55 0x02 0xAA
xRX: 0x00 0x00 0x00 0x00
[0x60]=0x0106  [0x64]=0x0025  [0x70]=0x0001  [0x74]=0x0000  [0x78]=0x0000  [0x1C]=0x80000000  [0x20]=0x0000 

[0x28]=0x002B.

[Register] = Value

The "x" before RX indicates an Interrupt. For starting I used the example code from "xspi_intr_example.c"

0 Kudos
Community Manager
Community Manager
1,081 Views
Registered: ‎07-23-2012

Re: SPI no RX

Did you enable the XILISF library on the BSP?

When you ran the example application, did it get executed successfully? If not, at what stage does it fail?
-----------------------------------------------------------------------------------------------
Please mark the post as "Accept as solution" if the information provided answers your query/resolves your issue.

Give Kudos to a post which you think is helpful.
0 Kudos
Adventurer
Adventurer
1,074 Views
Registered: ‎05-23-2018

Re: SPI no RX

Did you enable the XILISF library on the BSP?

No i didn't enable this Library before because i hadn't found any reference to it. But i have tested it now with enabled xilifs

and it is the same -> no Input, always 0.

When you ran the example application, did it get executed successfully? If not, at what stage does it fail?

This example is not a real example, because it only uses loopback ( as you can find in the posts above ).

And this works. Please read the posts above for all informations i already posted. And as you can see, everything is running

even the interrupt is working, only the input doesn't work !

0 Kudos
Community Manager
Community Manager
1,037 Views
Registered: ‎07-23-2012

Re: SPI no RX

Can you please share the application that you run? I will target that to one of our evaluation boards and see where it is going wrong. The example application we have writes to the flash and reads from it. It's not a loopback. Can you please point to the reference where it runs a loopback?
-----------------------------------------------------------------------------------------------
Please mark the post as "Accept as solution" if the information provided answers your query/resolves your issue.

Give Kudos to a post which you think is helpful.
0 Kudos
Adventurer
Adventurer
1,031 Views
Registered: ‎05-23-2018

Re: SPI no RX

Can you please share the application that you run?

I cannot share the application, because for me i throw this IP to waste and programmed one for myself in the meantime !

But i think it is a bug, so you should look for it.

I will target that to one of our evaluation boards and see where it is going wrong.

Simply connect the QuadSPI as a single SPI in standard mode. Then connect MOSI to MISO. No Flash to read or write. I already

described this in the first post.

It's not a loopback. Can you please point to the reference where it runs a loopback?

As explained above i used the example : xspi_intr_example.c ( see below)

[...]

// Run loopback test only in case of standard SPI mode.
    if (SpiInstancePtr->SpiMode != XSP_STANDARD_MODE) {
        return XST_SUCCESS;
    }

    // Connect the Spi device to the interrupt subsystem such that
    // interrupts can occur. This function is application specific.
    Status = SpiSetupIntrSystem(IntcInstancePtr,SpiInstancePtr,SpiIntrId);
    if (Status != XST_SUCCESS) {
        return XST_FAILURE;
    }

    /*
     * Setup the handler for the SPI that will be called from the interrupt
     * context when an SPI status occurs, specify a pointer to the SPI
     * driver instance as the callback reference so the handler is able to
     * access the instance data.
     */
    XSpi_SetStatusHandler(SpiInstancePtr, SpiInstancePtr,
                 (XSpi_StatusHandler) SpiIntrHandler);

    /*
     * Set the Spi device as a master and in loopback mode.
     */
    Status = XSpi_SetOptions(SpiInstancePtr, XSP_MASTER_OPTION | XSP_LOOPBACK_OPTION);
    if (Status != XST_SUCCESS) {
        return XST_FAILURE;
    }

[..]

But as i explained above, it doesn't work without loopback, and as i further explained above, everything works i even get an interrupt, but the received data is alway 0. . I looks like the input pin i not lead back to the IP.

 

0 Kudos
Community Manager
Community Manager
949 Views
Registered: ‎07-23-2012

Re: SPI no RX

Thanks for your feedback. I have created the design and now am modifying the example application to remove the loopback mode for standard mode.

I'll test this tomorrow and will update you on the next steps.
-----------------------------------------------------------------------------------------------
Please mark the post as "Accept as solution" if the information provided answers your query/resolves your issue.

Give Kudos to a post which you think is helpful.
0 Kudos
Adventurer
Adventurer
940 Views
Registered: ‎05-23-2018

Re: SPI no RX

In the meantimne i have built a testapplication too. And it is the same. How can i simply post a complete

project with SDK-Code and so on  ?

0 Kudos
Community Manager
Community Manager
681 Views
Registered: ‎07-23-2012

Re: SPI no RX

I sent a Ezmove ftp link to bader@gctnet.de. Please share your workspace archive through that.
-----------------------------------------------------------------------------------------------
Please mark the post as "Accept as solution" if the information provided answers your query/resolves your issue.

Give Kudos to a post which you think is helpful.
0 Kudos
Community Manager
Community Manager
647 Views
Registered: ‎07-23-2012

Re: SPI no RX

I received the workspace and am currently investigating the issue. I'll share the updates here soon.
-----------------------------------------------------------------------------------------------
Please mark the post as "Accept as solution" if the information provided answers your query/resolves your issue.

Give Kudos to a post which you think is helpful.
0 Kudos
Adventurer
Adventurer
563 Views
Registered: ‎05-23-2018

Re: SPI no RX

Do you have an idea whats happening ?

I still cannot use this IP !

0 Kudos