Announcements
IMPORTANT: Cypress Developer Community is transitioning on October 20th. To learn more and be prepared for this change, check out our latest announcement.
cancel
Showing results for 
Search instead for 
Did you mean: 

Nor Flash

rakic_3478611
New Contributor

Hi All,

I am able to write only 0-127 sector of NOR flash, So Please review my code in attached. And let me know anything is missing.

Thanks

Raj kishor

0 Likes
7 Replies
SudheeshK
Moderator
Moderator

Hi Raj,

I checked your code and I need a clarification. I saw the macro BLOCK_SIZE in your code and it's value is 0xFFFF. Is the macro to specify the sector size our device? Our device has uniform sector architecture and each sector has 128 Kbyte size (0x20000).

Could you please attach the schematic diagram of your application also?

Thanks and Regards,

Sudheesh

0 Likes
rakic_3478611
New Contributor

Hi Sudheesh,

Thanks you very much for your quick response.

You noticed  good point in my code that  BLOCK_SIZE 0xFFFF. I realized that BLOCK_SIZE should be 0x10000 instead of 0xFFFF as per S29GL01GS data sheet.

Now i have added read code also to verify that whether it is writing correctly or not.

Now I found new issue in my code that  from 1-63 block i am able write any verify correctly but 64th block onward i am not able to write correctly.

So please see the attached code and data sheet which i am referring.

Thanks

Raj kishor

0 Likes
rakic_3478611
New Contributor

Sorry I missed to attache data sheet.

Thanks

Raj kishor

0 Likes
SudheeshK
Moderator
Moderator

Hi Raj,

Could you please attach the log messages from your code when this issue happens? Are you observing this failure during program operation or read operation?

Thanks and Regards,

Sudheesh

0 Likes
rakic_3478611
New Contributor

Hi Sudheesh,

Thanks you very much for your response.

I am sending you log and code in attachment.

-> you can see in log file before "Block No 31" I am getting  "Erase Done FFFFFFFF" value after sector erase, "Block No 32" on ward i am getting different value "Erase Done 00020001".

and, also you can see error counter "Error cnt 00000001". And after "Block No 64"   error counter become "Error cnt 0000FF00" till 72 block.

Thanks

Raj kishor

0 Likes
SudheeshK
Moderator
Moderator

Hello Raj kishor,

Could you please modify the below line in function "eraseFlashBlk()"?

Change "while(WrAddr[BlockStartAddr] & 0xFFFF != 0xFFFF); "

To,

"while((WrAddr[BlockStartAddr] & 0xFFFF) != 0xFFFF); "

As per my understanding, you are using this while loop to check whether the erase operation is finished or not. The code will exit this loop only when the memory content become 0xFFFF. But, from the log files I saw that, the code reaches the "lftprintf("Erase Done %08X  \n",WrAddr[BlockStartAddr]);" statement after this loop. But, the erase did not happen. Could you please make the above change in your code and test again?

Thanks and Regards,

Sudheesh

rakic_3478611
New Contributor

Hi Sudheesh,

Thank you very much for your support.

Sorry for the delay response, I was busy with other high priority task.

Yes with above mention changes I am able to read/write  32MB, after 32MB it get stuck, I do not know the reason for this.

I am  suspecting that processor do not more than 32MB address line connect. it  may be the for that i am not able to access more than 32MB.

I verified it through jtag, I tried the to read 32MB onward data that  I am not able to access.

I will contact you again. If will be stuct at any point.

Thanks

Raj kishor yadav

0 Likes