cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F429 NAND FLASH & SDRAM

zhouweiqiu
Associate
Posted on December 16, 2014 at 14:35

We constructed a board using STM32F429. We use SDRAM for memory of LCD and NAND flash for program data. SDRAM and NAND flash share FMC bus of MCU. We have 2 problems at present:

1. When we access NAND flash, there is disturbance on LCD display. Once operation on NAND flash stops, LCD restores to normal.

2. We define heap in SDRAM. When we move data from NAND flash to the heap, data is corrupted in heap. If we move heap data first to MCU internal SRAM, and then move it from internal SRAM to SDRAM, there is no problem.

It seems there is conflict NAND flash and SDRAM when both of them accessing the FMC bus. Our question is, dose STM32F429 support NAND and SDRAM for LCD display

simultaneously

? If yes, how to get rid of disturbance on LCD while accessing NAND flash or external SRAM? 

If someone had such experience, could you please give us some guidance?

Thanks!

Joe

//Following are codes of NAND flash initialization and driver.

p.FMC_SetupTime = 0x4; 

p.FMC_WaitSetupTime = 0x4;

p.FMC_HoldSetupTime = 0x6;

p.FMC_HiZSetupTime = 0x2;

FMC_NANDInitStructure.FMC_Bank = FMC_Bank2_NAND;

FMC_NANDInitStructure.FMC_Waitfeature = FMC_Waitfeature_Enable;//FMC_Waitfeature_Disable;//

FMC_NANDInitStructure.FMC_MemoryDataWidth = FMC_NAND_MemoryDataWidth_8b;

FMC_NANDInitStructure.FMC_ECC = FMC_ECC_Disable;

FMC_NANDInitStructure.FMC_ECCPageSize = FMC_ECCPageSize_512Bytes;

FMC_NANDInitStructure.FMC_TCLRSetupTime = 0x00;

FMC_NANDInitStructure.FMC_TARSetupTime = 0x00;

FMC_NANDInitStructure.FMC_CommonSpaceTimingStruct = &p;

FMC_NANDInitStructure.FMC_AttributeSpaceTimingStruct = &p;

FMC_NANDInit(&FMC_NANDInitStructure);

/*!< FSMC NAND Bank Cmd Test */

FMC_NANDCmd(FMC_Bank2_NAND, ENABLE);

////////////////////////////////////////////////////////////////////////////////////////////////////////////

int Nand_ReadPageWithSpare2048(int PageNum,uint8_t *const DataBuf, uint8_t *const Spare)

{

volatile uint8_t *pCLE;

volatile uint8_t *pALE;

volatile uint8_t *pDATA;

volatile uint8_t nand_buf;

uint32_t i, curColumm, curRow;

volatile uint8_t j;

char srambuf[NANDFLASH_PAGE_FSIZE];   //栈里的缓存

i = 0;

pCLE = K9F1G_CLE;

pALE = K9F1G_ALE;

pDATA = K9F1G_DATA;

curColumm = 0;

curRow = PageNum;

*pCLE = K9FXX_READ_1;

*pALE = (uint8_t)(curColumm & 0x000000FF); /* column address low */

*pALE = (uint8_t)((curColumm & 0x00000F00) >> 8); /* column address high */

*pALE = (uint8_t)(curRow & 0x000000FF); /* row address low */

*pALE = (uint8_t)((curRow & 0x0000FF00) >> 8);

*pCLE = K9FXX_READ_2;

i=20;

while(i--) ;

if(DataBuf != NULL)

{

for(i=0;i<NANDFLASH_RW_PAGE_SIZE;i++)

{

srambuf[i] =*pDATA;

}

}

else

{

for(i=0;i<NANDFLASH_RW_PAGE_SIZE;i++)

{

j=*pDATA;

}

}

if(Spare!=NULL)

{

for(i=0;i<NANDFLASH_SPARE_SIZE;i++)

{

srambuf[NANDFLASH_RW_PAGE_SIZE+i]=*pDATA;

}

}

else

{

for(i=0;i<NANDFLASH_SPARE_SIZE;i++)

{

j=*pDATA;

}

}

if(DataBuf != NULL)

{

for ( i = 0; i < NANDFLASH_RW_PAGE_SIZE; i++ )

{

DataBuf[i] = srambuf[i];

}

}

if(Spare != NULL)

{

for ( i = 0; i < NANDFLASH_SPARE_SIZE; i++ )

{

Spare[i] = srambuf[i+NANDFLASH_RW_PAGE_SIZE] ;

}

}

return 1;

}
9 REPLIES 9
Posted on December 16, 2014 at 16:57

Seem to recall someone reporting similar issues, check if it's described in the errata, or scheduled to be addresses in future spins of the silicon.

http://www.st.com/web/en/resource/technical/document/errata_sheet/DM00068628.pdf

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
p239955_stm1
Associate
Posted on February 05, 2015 at 13:49

Although we use a combination of SD-RAM and NOR-FLASH we do experience similar problems. On a separate basis, access to both chips appear to work fine. However, problems arise when using both chips. The errata referred to in this thread claims the problem only occurs on revision '' A'' (paragraph 2.9.4), but we do notice the same on our revision ''1''. More precise the ARM chip identifies as ARM 1 STM32F437IIH6 MPAEZ VQ KOR HP435 (it's  not a one-off as the same problem is identified in all other boards of the prototype production batch)

Questions:

1. @zhou.weiqiu: Did you manage to solve your problem?

2. Is there anyone who can confirm to have a working combination of memory chips on the external bus?

3. Is ST aware of this problem?

4. When is ST to provide a solution?

Posted on February 05, 2015 at 14:04

> Although we use a combination of SD-RAM and NOR-FLASH we do experience similar problems.

Please be more specific with what the problems are.

Displaying problems for example might be simply caused by hitting bandwidth limits.

JW

p239955_stm1
Associate
Posted on February 05, 2015 at 14:52

Similar problems in our case are:

1. SD-RAM read operations provide corrupt data results during a flash buffer write operation.

2. HardFault interrupts

We have tried to solve the problem by changing all kind of FMC timing parameters of both the NOR_FLASH as well as the SD-RAM but nothing helped.

There is an interesting phenomena to report:

I added a debugger hardware breakpoint just before a program statement to read a SD-RAM location. An inspect in the (GNU DDD) debugger of the SD-RAM variable showed a wrong value. However, after execution of a single innocent assembly instruction it appears that inspection of the same location suddenly shows the correct value. After a execution resume the program code also reads the data in a correct manner.

Posted on February 05, 2015 at 15:16

I see. This appears to be the case of ''FMC dynamic and static bank switching'', Erratum 2.9.7 in Rev9 of ''STM32F42xx and STM32F43xx silicon limitations''. According to that, it is still pertinent to silicon revision 1, and is fixed in silicon revision 3.

You can try the workaround described there, although I understand that it may be painful to impossible.

JW

[EDIT] you might want to read also [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32F429%20Silicon%20Revision%203%20ETA&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=216]this thread

mvanschie9
Associate II
Posted on February 06, 2015 at 10:17

Hi all,

Does anybody know if revision 3 of the STM32F437IIH6 is already in full production and availlable through European distributors? Apart from the PCN MMS-MIC/14/8608 dated august 2014 I can't find any information on availlability.

Unfortunately, on our current development boards revision 1 of this MCU is used, in which a blocking problem exists with the FMC in case of static and dynamic memory on the external bus.

Thanks in advance.

Best regards,

Mark

pr242
Associate II
Posted on February 18, 2015 at 09:58

Hi Mark,

Did you manage to find any rev 3 stock?

I am also planning to use sdram & static memory interface. Did you try Mouser / Digikey? They could have fresher stock than a European distributor.

Cheers

Paul

mvanschie9
Associate II
Posted on March 02, 2015 at 14:26

Hi Paul,

I did manage to get a few samples of the rev3 microcontroller via Silica. Currently the rev1 controllers on our development boards are being replaced by rev3 controllers and hopefully this week we can see if this solved our FMC problems.

Best regards,

Mark

ivanivan9
Associate
Posted on May 26, 2015 at 15:16

Hello ,

Did the Rev3 solve your FMC problem? 

I ask this because we have the same issue on our board.

Thank you

Ivan