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 zaku89
Observer
166 Views
Registered: ‎05-30-2018

QSPI and SPI example code on Ultrascale+

Jump to solution

I am implementing some code from ZYNQ 7000 to ZYNQ Ultrascale+.

 

When I implementing the XQspiPs and XSpi part, I met some problem.

1. There is no XQspiPs drivers in Ultrascale+ BSP, instead, there is a XQspiPsu in BSP. There is some difference between this two drivers.

Is there any example code for this XQspiPsu to initialize,read and write data?

 

2. The same situation in XSpi in BSP, there is only XSpiPs in Ultrascale+ BSP. Is there any sample code?

Thank you!

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
163 Views
Registered: ‎06-27-2017

Re: QSPI and SPI example code on Ultrascale+

Jump to solution

Hi @zaku89,

 

Have you refered the examples this for QSPI examples for interrupt and polling based for QSPI controller?

they are the bare-metal examples for QSPI

Best Regards
Kranthi
--------------------------
Don't forget to reply, kudo, and accept as solution.
0 Kudos
3 Replies
Xilinx Employee
Xilinx Employee
164 Views
Registered: ‎06-27-2017

Re: QSPI and SPI example code on Ultrascale+

Jump to solution

Hi @zaku89,

 

Have you refered the examples this for QSPI examples for interrupt and polling based for QSPI controller?

they are the bare-metal examples for QSPI

Best Regards
Kranthi
--------------------------
Don't forget to reply, kudo, and accept as solution.
0 Kudos
Observer zaku89
Observer
128 Views
Registered: ‎05-30-2018

Re: QSPI and SPI example code on Ultrascale+

Jump to solution
Hi @gudishak ,

Thank you! This is exactly what I need!
0 Kudos
Observer zaku89
Observer
108 Views
Registered: ‎05-30-2018

Re: QSPI and SPI example code on Ultrascale+

Jump to solution

Hi @gudishak,

I tried the sample code but it seems there is some issue.

I copied the code as:

int SpiFlashInitialization()
{
    XQspiPsu_Config *config_ptr;

    int Status;

    /* Initialize the SPI Driver */
    config_ptr = XQspiPsu_LookupConfig(SPI_DEVICE_ID);
    if (config_ptr == NULL) {
        return XST_DEVICE_NOT_FOUND;
    }

    Status = XQspiPsu_CfgInitialize(&QspiPsuInstance, config_ptr,  config_ptr->BaseAddress);
    if (Status != XST_SUCCESS) {
        return XST_FAILURE;
    }

    /*
     * Set Manual Start
     */
    XQspiPsu_SetOptions(&QspiPsuInstance, XQSPIPSU_MANUAL_START_OPTION);

    /*
     * Set the prescaler for QSPIPSU clock
     */
    XQspiPsu_SetClkPrescaler(&QspiPsuInstance, XQSPIPSU_CLK_PRESCALE_8);

    XQspiPsu_SelectFlash(&QspiPsuInstance,
        XQSPIPSU_SELECT_FLASH_CS_LOWER, XQSPIPSU_SELECT_FLASH_BUS_LOWER);

    /*
     * Read flash ID and obtain all flash related information
     * It is important to call the read id function before
     * performing proceeding to any operation, including
     * preparing the WriteBuffer
     */
    Status = FlashReadID(&QspiPsuInstance);
    if (Status != XST_SUCCESS) {
        return XST_FAILURE;
    }

    PRINT_INFO("Flash connection mode : %d \n\r",
            config_ptr->ConnectionMode);
    PRINT_INFO("where 0 - Single; 1 - Stacked; 2 - Parallel \n\r");
    PRINT_INFO("FCTIndex: %d \n\r", FCTIndex);


    return XST_SUCCESS;
}

I got the information as follow:

FlashID=0x0 0x0 0x0
Flash connection mode : 2
where 0 - Single; 1 - Stacked; 2 - Parallel
FCTIndex: 0

But this FlashID seems not correct.

 

Below is my board information:

 

Board: Ultrazed board (Ultrazed-EG-SOM)

The UltraZed-EG SOM provides 64MB of QSPI Flash in dual-parallel (x8) configuration. Two Micron MT25QU256ABA1EW7-0SIT (8-pin W-PDFN package) devices are used to implement the parallel Flash interface on the UltraZed-EG SOM. The QSPI Flash devices are connected to the PS MIO bank 500 and operated at 1.8V I/O. The QSPI Flash can be used as a primary boot device on the UltraZed-EG SOM.

in my platform:

 

122.png

in the xparameters.h

/* Definitions for driver QSPIPSU */
#define XPAR_XQSPIPSU_NUM_INSTANCES 1

/* Definitions for peripheral PSU_QSPI_0 */
#define XPAR_PSU_QSPI_0_DEVICE_ID 0
#define XPAR_PSU_QSPI_0_BASEADDR 0xFF0F0000
#define XPAR_PSU_QSPI_0_HIGHADDR 0xFF0FFFFF
#define XPAR_PSU_QSPI_0_QSPI_CLK_FREQ_HZ 124999000
#define XPAR_PSU_QSPI_0_QSPI_MODE 2
#define XPAR_PSU_QSPI_0_QSPI_BUS_WIDTH 2

 

Could you give some suggestion? Thank you!

0 Kudos