NF_nFCE_L();
NF_CMD(0x50); // Spare array read command
NF_ADDR(517&0xf); // Read the mark of bad block in spare array(M addr="5") [q6]
NF_ADDR(blockPage&0xff); // The mark of bad block is in 0 page
NF_ADDR((blockPage>>8)&0xff); // For block number A[24:17]
NF_ADDR((blockPage>>16)&0xff); // For block number A[25]
for(i=0;i // wait tWB(100ns) //?????
NF_WAITRB(); // Wait tR(max 12us)
data=NF_RDDATA();
NF_nFCE_H();
if(data!=0xff)
{
Uart_Printf("[block %d has been marked as a bad block(%x)]\n",block,data);
return 1;
}
else
{
return 0;
}
}