cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the FMC ECC working with NAND

omisys
Associate II

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?

11 REPLIES 11
Mohamed Aymen HZAMI
ST Employee

Hello,

You can try to use this example in the firmware package STM32Cube_FW_F7 under :

  • Repository\STM32Cube_FW_F7_V1.14.0\Projects\STM32F769I_EVAL\Examples\FMC

This example shows how to configure the FMC controller to access the NOR memory.

Best Regards,

Mohamed Aymen.

omisys
Associate II

Hi,

I have no problems with using the NAND flash. Reading and writing is both working. My only problem is the hardware ECC which seems to not be doing anything.

This seems like an answer to a different question.

Need examples of ECC syndrome generation and/or checking for NAND devices.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Back in the day I think there where SPL NAND examples for the F2 and F4 series parts, however as I recall it used obsolete algorithms for different architectures, and at a time where the NAND parts themselves could auto generate the required syndrome bytes as part of the write process, ie you wrote the sectors, and then wrote the computed ECC from buffers. Worked well if you have integrity at a bus level.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

How is this supposed to help me? I'm looking for someone who has used the hardware ECC from the FMC to maybe show me an example or point me to the right direction.

florin_o
Associate

I have the same problem on my side.

Reading and writing works but cannot use hardware ECC.

I'm testing using the Open407 board.

And what NAND device is that using? Does the sector format and ECC byte scheme match that supported by the F4 generator?

Given the lack you useful responses from ST, you might want to file an "Online Support Request" ticket, or find a local FAE (support engineer) with specific NAND usage experience.

I seem to recall the SPL or EVAL series examples having some NAND support, but these would have been for antiquated NAND devices. The actual correction would need to be done in software.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Might have been some licensable materials related to this, not sure it was "open" software

https://www.st.com/en/evaluation-tools/steval-ccm007v2.html

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

The NAND device is K9F1G08U0E.