cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
8,515 Views
Registered: ‎05-31-2015

XPS SPI core failing selftest

Hi,

 

I have configured microblaze in xilinx xps.My mhs file is attached. I tried to do self test on the module inspired from xilinx examples. The code is shown below

 

#include "xparameters.h"
#include "xspi.h"
#include "xspi_l.h"

#define SPI_DEVICE_ID XPAR_SPI_0_DEVICE_ID
int SpiSelfTestExample(u16 DeviceId);
XSpi Spi;
#ifndef TESTAPP_GEN
int main(void)
{
int Status;
Status = SpiSelfTestExample(SPI_DEVICE_ID);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}

return XST_SUCCESS;
}
#endif
int SpiSelfTestExample(u16 DeviceId)
{
int Status;
XSpi_Config *ConfigPtr; /* Pointer to Configuration data */
ConfigPtr = XSpi_LookupConfig(DeviceId);
if (ConfigPtr == NULL) {
return XST_DEVICE_NOT_FOUND;
}

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

Status = XSpi_SelfTest(&Spi);
if (Status != XST_SUCCESS) {

xil_printf("\nThe self test failed");
return XST_FAILURE;
}

xil_printf("\nSelf test success");

return XST_SUCCESS;
}

 

But my self test failed. The self test function is returning XST_REGISTER_ERROR. Later when I took out values of control,status registers of spi core I found that these where also not set by reset function as desired. I checked if base address is same in both XPS and SDk and were same. Also if any endianness issues where there I believe sdk will not compile.I am using xps_spi 2.02a.The xilinx sdk automatically loads functions for spi_1.06a in include and source directory . I doubt if it was problem but dont know how to override it.Also there are no s/w ip files for 2.02a in xilinx EDK installation directory.

 

I am stuck at this for past 2 weeks.Kindly make some suggestions.

 

0 Kudos
2 Replies
Highlighted
Community Manager
Community Manager
8,429 Views
Registered: ‎07-23-2012

Does Xilinx provided driver work correctly with your setup? What tweaks did you make to Xilinx examples?
-----------------------------------------------------------------------------------------------
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
Highlighted
Explorer
Explorer
8,362 Views
Registered: ‎05-31-2015

Sir,

 

Xilinx has given hw drivers for 2.02a and sw drivers for 3.03a that are being used. However now atleast my function returns after i changed core from xps_spi to axi_spi. Now I am facing  difficulty in doing simulation with isim. none of my signals change fron X .transfer fn returns sucess.

0 Kudos