|
|
发表于 2021-8-5 23:33:35
|
显示全部楼层
level 对同一位置多次写入不通的数据,每次写入时,计算的ECC并不能保证每次也是全有1改写为0 ,所以会致使后续读取本页数据时,ECC会出错:
大家移植时是如何解决的?这样多次写入同一位置的代码有多处。
UINT _lx_nand_flash_open(LX_NAND_FLASH *nand_flash, CHAR *name, UINT (*nand_driver_initialize)(LX_NAND_FLASH *))
{
........
/* Setup the initial erase count to 1. */
page_word_ptr[0] = (((ULONG) 1) | LX_BLOCK_ERASED);
/* Write the initial erase count for the block. */
status = _lx_nand_flash_driver_write(nand_flash, block, 0, page_word_ptr, LX_NAND_ERASE_COUNT_WRITE_SIZE);
/* Check for status after the block erase. */
if (status == LX_SUCCESS)
{
/* Setup the initial erase count to 1. */
page_word_ptr[0] = ((ULONG) 1);
/* Write the initial erase count for the block. */
status = _lx_nand_flash_driver_write(nand_flash, block, 0, page_word_ptr, LX_NAND_ERASE_COUNT_WRITE_SIZE);
}
.........
}
|
|