2013-11-18 01:21 AM
2013-11-20 02:10 AM
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.
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.
2017-10-30 03:18 PM
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
2018-02-01 06:50 AM
I have a similar situation. Guys, any news?