How to get the FMC ECC working with NAND
I'm using an STM32F765 and a toshiba NAND chip via FMC. I want to use the hardware ECC, but the ECCR register is always empty. My fmc init looks like this:
/** Perform the NAND1 memory initialization sequence
*/
hnand1.Instance = FMC_NAND_DEVICE;
/* hnand1.Init */
hnand1.Init.NandBank = FMC_NAND_BANK3;
hnand1.Init.Waitfeature = FMC_NAND_WAIT_FEATURE_ENABLE;
hnand1.Init.MemoryDataWidth = FMC_NAND_MEM_BUS_WIDTH_8;
hnand1.Init.EccComputation = FMC_NAND_ECC_ENABLE;
hnand1.Init.ECCPageSize = FMC_NAND_ECC_PAGE_SIZE_256BYTE;
hnand1.Init.TCLRSetupTime = 2;
hnand1.Init.TARSetupTime = 2;
I do the following in a loop:
HAL_NAND_ECC_Enable(&hnand1);
write 256 bytes
HAL_NAND_GetECC
HAL_NAND_ECC_Disable(&hnand1);
This results in the ECCR register always being 0. The ECC computation is enabled in cube. I'm using bank 3 which should be supported. What to do?