cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dolores.garcia
Observer
Observer
4,894 Views
Registered: ‎09-11-2008

CFI test program

I have a Spansion CFI in my protoype board for write and storage of program configuration values (program is storaged in xc2s).

Sometimes when I write in the CFI, it doesn´t answer and I have to reset the microblaze. I think , there is something wrong in my program because when

I use the flash writer, always it is ok. where i could find  a cfi test example?

 

Thank you.

0 Kudos
5 Replies
prateek_bhatt
Scholar
Scholar
4,893 Views
Registered: ‎08-21-2008

Hello.

If everything is working then the issue you have mentioned can only happen when you issue a new command whereas the processor is busy executing the previous command.

See in your code that a new command can only be given afte making sure the previous command was successfully dealt with.

There is no such code as CFI test but in every CFI memory there are sections to test the CFI FLASH memory.

There will be some command to read the device ID or to do CFI query.

Check these things. If you are able to read them successfully then there is no problem. Just in your code check the polling to see if the processor is busy or not executing some command.

Issue new command only when previous was done completely.

Best of luck.
--
Unlimited in my Limits.
0 Kudos
dolores.garcia
Observer
Observer
4,889 Views
Registered: ‎09-11-2008

I have not problems with reading, I only has problems when I try to write and only sometimes (1% of writings). I wait that the last command  finish and this its the problem, the micro is waiting at DQ5 will be high and it never happen. It is not a periodic mistake, for this reason I could like see a example writing C code  to compare, because I think it is not a flash problem(with Nios all the writing are OK).

 

Best Regards.

0 Kudos
prateek_bhatt
Scholar
Scholar
4,887 Views
Registered: ‎08-21-2008

Hello.

You must be having some pin, like ry\by, ready-busy pin that you can poll.

If you can read well then there is no problem in mapping.

As far as writing is concerned there are only two things...

1. Giving write command and then data at proper address.

2. Polling the ry\by pin to check for operation to complete.

Thats it. No more.

Best of luck.
--
Unlimited in my Limits.
0 Kudos
dolores.garcia
Observer
Observer
4,884 Views
Registered: ‎09-11-2008

Untill I know, RY/BY is not polling by the emc module, You have to polling the DQ5 later to write, and it doesn´t work ok .

Microblaze is waiting to DQ5. For this reason I think there its something wrong in my program (but the error is only sometimes....)

 

Thank you for your answer 

0 Kudos
prateek_bhatt
Scholar
Scholar
4,882 Views
Registered: ‎08-21-2008

Hello.

In EDK there is no constraint using a one bit GPIO dip switch to map to ry\by pin along with EMC controller.

Even if the EMC controller doesn't give you any option to map ry\by pin you can use one bit dip switch to map your ry\by pin and then you can poll this dip switch in your code to see if the operation is complete or not. I am not sure of the data pin you told for polling.

Best of luck.
--
Unlimited in my Limits.
0 Kudos