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: 
Highlighted
Contributor
Contributor
4,604 Views
Registered: ‎06-24-2008

In System Flash for Spartan 3 AN devices "xilisf.h" help

The two main resources on this subject I have found are ug333 and xapp1034.  I have written a test program on a custom board and am not able to read and write the in system flash.  I am using a spartan 3 an 700. 

 

 I initialize spi followed by the isf and get the appropriate instance pointers.   I then create the read parameter and write parameter structs.  When I read and write to the same location I do not get the correct value read back and I am not sure if I am even writing to the in system flash.  I am not sure how to find out if the error is in initialization, reading or writing.  Could someone offer some guidance on how to debug this?

 

 

The following is a little bit of the code I am using (full code attached).  Is this the correct method for reading and writing to in system flash? 

 

 

 

 

u8* buf = malloc(sizeof(u8));

XIsf_WriteParam *wp = malloc(sizeof(XIsf_WriteParam));   
XIsf_ReadParam *rp = malloc(sizeof(XIsf_ReadParam));

 

init_spi();

Status = XIsf_Initialize(&isf, &spi, ISF_SPI_SELECT, temp);

 

 

wp->Address = XPAR_XPS_INSYSTEM_FLASH_0_BASEADDR + 0xA1C00; //first available user data space
wp->WritePtr = buf;
wp->NumBytes = 1;

 

 

rp->Address = XPAR_XPS_INSYSTEM_FLASH_0_BASEADDR + 0xA1C00;
rp->ReadPtr = buf;
rp->NumBytes = 1;

 

*buf = 66;

Status = XIsf_Write(&isf, XISF_WRITE, wp);

*buf = 0;

Status = XIsf_Read(&isf, XISF_READ, rp);

 

//*buf should now equal 66 but does not

Message Edited by bborko on 04-19-2010 10:59 AM
Message Edited by bborko on 04-19-2010 11:07 AM
0 Kudos
4 Replies
Contributor
Contributor
4,596 Views
Registered: ‎06-24-2008

Re: In System Flash for Spartan 3 AN devices "xilisf.h" help

Just in case my xparameters and mhs file are useful.  Thanks!
0 Kudos
Contributor
Contributor
4,595 Views
Registered: ‎06-24-2008

Re: In System Flash for Spartan 3 AN devices "xilisf.h" help

 
0 Kudos
Contributor
Contributor
4,505 Views
Registered: ‎06-24-2008

Re: In System Flash for Spartan 3 AN devices "xilisf.h" help

I don't necessarily need a solution if no one knows but could someone comment on whether I am doing something obviously wrong or not?  I am stuck at this point. 

 

Going to take another look at those documents..

Thanks

0 Kudos
Visitor darrencorey
Visitor
4,235 Views
Registered: ‎12-17-2008

Re: In System Flash for Spartan 3 AN devices "xilisf.h" help

Hey bborko,

 

I came across this post while looking for info on xilisf.  Did you ever get this worked out?  I'm able to read and write to my flash ok, but it seems to me that the xilisf functions are dealing with addresses totally wrong... but of course, I could be wrong as well.  Have you (or anybody else) been successful with this?

 

Thanks--

0 Kudos