10-05-2009 02:59 AM
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?
10-05-2009 03:20 AM
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.
10-05-2009 03:42 AM
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).
10-05-2009 03:55 AM
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.
10-05-2009 04:10 AM
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
10-05-2009 04:26 AM
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.