How to detect Bad block in parallel nor flash.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
rakic_3478611
Level 1
Level 1

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
lock attach
Attachments are accessible only for community members.
rakic_3478611
Level 1
Level 1

Sorry!!

i forget to attach code.

0 Likes

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
Moderator
250 sign-ins First question asked 750 replies posted

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