cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
380 Views
Registered: ‎06-29-2020

AXI QUAD SPI IN QUAD MODE WITH MICROBLAZE

Spoiler
Hi, all

Iam new to Microblaze and qspi 

I need to work on Microblaze with qspi. What i have done is i have created block level design in vivado 2018.3. In our design i have added the microblaze and AXI QUAD SPI in QUAD mode and Slave device is Spansion and after that i added UART.

After creation of the wrapper i exported the our design into xilinx sdk . Now i need to write application code for simple read and write operations.. I tried lot of examples in the xilinx github, i didn't get proper result , i see the transactions in only in these ports  IO0, IO1, SS, SCK ..

But i didn't see any transactions in IO2 and IO3 ports. i think my application code works like spi not qspi.


someone suggested me how can i proceed for it. any reference designs on Microblaze with Axi quad soi in QUAD mode only



Tags (1)
0 Kudos
3 Replies
Highlighted
Xilinx Employee
Xilinx Employee
310 Views
Registered: ‎10-12-2018

Hi @John_24053 ,

Please refer to xapp1280 and download Reference design files to get the flash read and write application for quad mode.

 

Thanks & Regards
Anil B
-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
Visitor
Visitor
269 Views
Registered: ‎06-29-2020

Hi, @abommera 

Thank you so much for your response

I go through the the xapp1280 reference design, But in this design STARTUPE3 primitive is also used . In my design i didn't use STARTUPE3 primitive only I use Microblaze, AXI Quad Spi in quad mode and uartlite.

And also in reference design they use the micron as a slave memory . In my design i use the spansion (s25fl512s). this entire design developed on virtex ultrascale board.

 

The problem i am facing is read and write operations.

This is our application code. But i do the simulation i only got io0 and io1 and ss ,sck signals trasactions.

i didn.t see any transactions in io2 and io3.

 

Please help me how can i change my manage those signals...

 

thank you

#include <stdio.h>
#include "platform.h"
#include "xil_printf.h"
#include "xparameters.h" /* XPAR parameters */
#include "xspi.h"
#include "sleep.h"

#define SPI_DEVICE_ID XPAR_AXI_QUAD_SPI_0_DEVICE_ID


#define BUFFER_SIZE 17

typedef u8 DataBuffer[BUFFER_SIZE];


int SpiPolledExample(XSpi *SpiInstancePtr, u16 SpiDeviceId);

static XSpi SpiInstance; /* The instance of the SPI device */

u8 ReadBuffer[BUFFER_SIZE];
u8 WriteBuffer[BUFFER_SIZE];


int main(void)
{
init_platform();
int Status;

Status = SpiPolledExample(&SpiInstance, SPI_DEVICE_ID);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}

//return XST_SUCCESS;
cleanup_platform();
return 0;
}

int SpiPolledExample(XSpi *SpiInstancePtr, u16 SpiDeviceId)
{
init_platform();
//ps7_post_config() ;
int Status;
u32 Count;
XSpi_Config *ConfigPtr; /* Pointer to Configuration data */


ConfigPtr = XSpi_LookupConfig(SpiDeviceId);
if (ConfigPtr == NULL) {
return XST_DEVICE_NOT_FOUND;
}

Status = XSpi_CfgInitialize(SpiInstancePtr, ConfigPtr,
ConfigPtr->BaseAddress);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}


Status = XSpi_SetOptions(SpiInstancePtr, XSP_MASTER_OPTION | XSP_MANUAL_SSELECT_OPTION);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}

XSpi_Start(SpiInstancePtr);

XSpi_IntrGlobalDisable(SpiInstancePtr);
xil_printf("%d",XSpi_GetStatusReg(SpiInstancePtr));


u8 WriteBuffer[BUFFER_SIZE]={0xB,0x3,0x1,0x0,0x0,0x1,0xC,0x5,0xA,0x1,0x0,0xA,0xC,0xC,0x3,0xE,0x0};
u8 ReadBuffer[BUFFER_SIZE]={0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0};
XSpi_SetSlaveSelect(SpiInstancePtr, 0x01);

while(1)
{
XSpi_Transfer(SpiInstancePtr, WriteBuffer, NULL, BUFFER_SIZE);
}

for (Count = 0; Count < BUFFER_SIZE; Count++) {
xil_printf("\n read %d",ReadBuffer[Count]);
xil_printf("\n write %d",WriteBuffer[Count]);
if (WriteBuffer[Count] != ReadBuffer[Count]) {
print("fail");
return XST_FAILURE;
}
}
print("\n success");
return XST_SUCCESS;
}

 

 

 

0 Kudos
Highlighted
Visitor
Visitor
220 Views
Registered: ‎06-29-2020

HI,

I attached the simulation results that i have got.

Only problem with io2 and io3 signals i didn't see any transactions on those signals..

please anyone suggested me what if iam doing wrong,

I am wonder about this.

Thank you

pic1.JPG
2.JPG
0 Kudos