cancel
Showing results for 
Search instead for 
Did you mean: 

Page Read Problem with NAND Flash on STM32F2xx

tzewan
Associate II
Posted on November 18, 2013 at 10:21

The original post was too long to process during our migration. Please click on the attachment to read the original post.
3 REPLIES 3
tzewan
Associate II
Posted on November 20, 2013 at 11:10

Hi, all

I managed to read a page of data now. However, some delay is needed. Below is a description of the function I modified/wrote.

int32_t NAND_ReadSmallPage(uint8_t *pBuffer, NAND_ADDRESS Address, uint32_t NumPageToRead)
{
/* snip */
/*!< Page Read command and page address */
*(__IO uint8_t *)(Bank_NAND_ADDR | CMD_AREA) = 0x00;
// Set row and column address to all zeroes for testing .
*(__IO uint8_t *)(Bank_NAND_ADDR | ADDR_AREA) = 0x00;
*(__IO uint8_t *)(Bank_NAND_ADDR | ADDR_AREA) = 0x00;
*(__IO uint8_t *)(Bank_NAND_ADDR | ADDR_AREA) = 0x00;
*(__IO uint8_t *)(Bank_NAND_ADDR | ADDR_AREA) = 0x00;
*(__IO uint8_t *)(Bank_NAND_ADDR | CMD_AREA) = 0x30;
/*!< Get Data into Buffer */ 
for(; index < size; index++)
{
pBuffer[index]= *(__IO uint8_t *)(Bank_NAND_ADDR | DATA_AREA);
}
/* snip */
}

However, I have to put in some delay (by stepping through) before (Get Data into Buffer) above. Without the delay, the bytes are offset by about 11 or 12 bytes. These first 11 or 12 bytes are all read as 0x On this board, the Read/^Busy signal of the NAND is connected to FSMC_INT2 of STM32F This is the signal description from the flash manual. 0690X000006052LQAQ.png In AN2784, it is described that:

Generally, the Ready/Busy signal is an open-drain output. To connect this signal to the

STM32F10xxx microcontroller, the corresponding pin must be configured as input pull-up.The Ready/Busy signal can be used as an interrupt source for the FSMC and, in this case,the CPU can perform other tasks during NAND Flash operations.Three FSMC configurations make it possible to use this signal as an interrupt. For thatpurpose, the IREN, IFEN or ILEN bits in the SR2 register are used to select the rising edge,the falling edge or the high level of the NAND Flash Ready/Busy signal. I would like to ask: (1) What is the method to configure FSMC_INT2? Is this correct?

GPIO_PinAFConfig(GPIOG, NAND_INT2_s, GPIO_AF_SDIO); // or, is it GPIO_AF_FSMC?
GPIO_InitStructure.GPIO_Pin = NAND_INT2; 
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(GPIOG, &GPIO_InitStructure);

(2) I inserted a line of code before getting the data into the buffer as follows:

while(GPIO_ReadInputDataBit(GPIOG, GPIO_PinSource6) == 0);
/*!< Get Data into Buffer */

But the program is trapped forever in the while loop. This means the pin never goes high. What should be the correct way of doing? I would appreciate some guidance. Thank you.
Abdul Qadir Shabbir
Associate II
Posted on October 30, 2017 at 23:18

Hi Foo, 

Did you happen to get your Nand flash to work. I have a similar configuration, and I am having issues with the read speed. There is a delay between each subsequent read. 

Did you happen to note this delay? Did you happen to improve on this delay? 

Would appreciate your reply,

AQ

Posted on February 01, 2018 at 14:50

I have a similar situation. Guys, any news?