2021-11-28 05:33 AM
Hi.
I can read and write from nand flash memory with fmc but when is use this function for a test code it mostly returns zero and i think its not ok.
addr.Block=1;
addr.Page=0;
HAL_NAND_ECC_Enable(&hnand1);
HAL_NAND_Read_Page(&hnand1, &addr, aRxBuffer, 1);
HAL_NAND_GetECC(&hnand1,&ECC_Hardware,100);
HAL_NAND_ECC_Disable(&hnand1);
addr.Block=1;
addr.Page=1;
HAL_NAND_ECC_Enable(&hnand1);
HAL_NAND_Read_Page(&hnand1, &addr, aRxBuffer, 1);
HAL_NAND_GetECC(&hnand1,&ECC_Hardware,100);
HAL_NAND_ECC_Disable(&hnand1);
In page zero I have 0x00 to 0x0F from position zero to 15 and the others are zero.
I mean from 15th byte to 2047th byte its written 0x00;
In page one the same as page zero but just changed the 0x01 to 0x00 to generate a single bit error.
For the zero page eccr register is 0x00000000 and for the first page the eccr register is 0x55555595
Even when i read page 3 that is all 0xFF the eccr is 0x00000000;