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,

How to detect bad block in parallel NOR flash.

I am using "S29GL01GS" NOR flash, with this flash memory I am not able write and match data of "192 Block". from 1 to 191 block i am able to write and read  and from 193 to 254 blocks also read/write. it seems it has bad block.

So please verify attached code, and let me know if any things is wrong in this.

Thanks

Raj kishor

0 Likes
3 Replies
rakic_3478611
New Contributor

Sorry!!

i forget to attach code.

0 Likes
AS_36
Moderator
Moderator

Hi Raj,

Thank you for contacting Cypress Community.

Only NAND Flash memory devices have bad blocks. NOR Flash memory devices are more reliable and it does not have bad blocks.

Bad Blocks in NOR Flash Devices – KBA219740

We will review your code and get back to you.

Thanks and Regards,

Apurva

0 Likes
SudheeshK
Moderator
Moderator

Hi Raj,

Could you please modify the function eraseFlashBlk() as below and send us the log messages when this issue happens?

static void eraseFlashBlk(int blkno)

{

unsigned int  BlockStartAddr = blkno * BLOCK_SIZE;

unsigned short *WrAddr = (unsigned short*)(FLASHADDR+BlockStartAddr);

//        lftprintf("BlockStartAddr 0x%08X BLOCK_SIZE 0x%08X bklno 0x%08X Status Reg 0x%08X \n" ,*(WrAddr+BlockStartAddr),BLOCK_SIZE,blkno,WrAddr[0x28]);

WrAddr[0x555] = 0x00AA;     /* 6 cycle chip erase command */

WrAddr[0x2AA] = 0x0055;

WrAddr[0x555] = 0x0080;

WrAddr[0x555] = 0x00AA;

WrAddr[0x2AA] = 0x0055;

WrAddr[0] = 0x30;    

while((WrAddr[0] & 0xFFFF) != 0xFFFF)

{

lftprintf("Data Polling: 0x08X \n", WrAddr[0];

}

lftprintf("Erase Done %08X  \n",WrAddr[0]);

}

Thanks and Regards,

Sudheesh

0 Likes