QSPI flash timing issue in LPC546xx

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

QSPI flash timing issue in LPC546xx

1,652 次查看
prasannanaik
Contributor III

Hi,

   I am using LPC546 development board OM13092 for evaluation of QSPI flash. I have used "spifi_dma_transfer" driver example code as reference. I have toggled port PIO2_0 for timing verification. All the settings are same as  "spifi_dma_transfer" code only port pin has been toggled in the code for timing verification.

While checking the driver example code i had following observations:

1) 1 sector erase time: 3.64 msec            

 

GPIO_PinWrite(GPIO, 2, 0, 1);/*PORT PIN HIGH*/
/* Write enable */
SPIFI_SetCommand(EXAMPLE_SPIFI, &command[WRITE_ENABLE]);
/* Set address */
SPIFI_SetCommandAddress(EXAMPLE_SPIFI, 0U);
/* Erase sector */
SPIFI_SetCommand(EXAMPLE_SPIFI, &command[ERASE_SECTOR]);

/* Check if finished */
check_if_finish();

GPIO_PinWrite(GPIO, 2, 0, 0);/*PORT PIN LOW*/

2) 1 sector write time: 2.24 msec

GPIO_PinWrite(GPIO, 2, 0, 1);/*PORT PIN HIGH*/

while (page < (SECTOR_SIZE / PAGE_SIZE))
{
SPIFI_SetCommand(EXAMPLE_SPIFI, &command[WRITE_ENABLE]);
SPIFI_SetCommandAddress(EXAMPLE_SPIFI, page * PAGE_SIZE);
SPIFI_SetCommand(EXAMPLE_SPIFI, &command[PROGRAM_PAGE]);
xfer.data = g_buffer;
xfer.dataSize = PAGE_SIZE;
SPIFI_TransferSendDMA(EXAMPLE_SPIFI, &handle, &xfer);
while (!finished)
{
}
finished = false;
page++;
check_if_finish();
}
GPIO_PinWrite(GPIO, 2, 0, 0);/*PORT PIN LOW*/

3) 1 sector erase and then write time: 47 msec

GPIO_PinWrite(GPIO, 2, 0, 1);/*PORT PIN HIGH*/
/* Write enable */
SPIFI_SetCommand(EXAMPLE_SPIFI, &command[WRITE_ENABLE]);
/* Set address */
SPIFI_SetCommandAddress(EXAMPLE_SPIFI, 0U);
/* Erase sector */
SPIFI_SetCommand(EXAMPLE_SPIFI, &command[ERASE_SECTOR]);

/* Check if finished */
check_if_finish();

/* Program page */
while (page < (SECTOR_SIZE / PAGE_SIZE))
{
SPIFI_SetCommand(EXAMPLE_SPIFI, &command[WRITE_ENABLE]);
SPIFI_SetCommandAddress(EXAMPLE_SPIFI, page * PAGE_SIZE);
SPIFI_SetCommand(EXAMPLE_SPIFI, &command[PROGRAM_PAGE]);
xfer.data = g_buffer;
xfer.dataSize = PAGE_SIZE;
SPIFI_TransferSendDMA(EXAMPLE_SPIFI, &handle, &xfer);
while (!finished)
{
}
finished = false;
page++;
check_if_finish();
}
GPIO_PinWrite(GPIO, 2, 0, 0);/*PORT PIN LOW*/

Why is the sector erase and write time so high?

Thanks and best regards,

Prasannna

标签 (1)
0 项奖励
回复
6 回复数

1,475 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Prasanna,

I suggest you use different GPIO to test the erase time and program time  lest you confuse erase and program time.

BR

XiangJun Rong

0 项奖励
回复

1,475 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Prasanna,

For your issue to test the erasing/programming time, I develop an example to use CTimer to test the erasing and programming time based on my LPC54618 board. Pls refer to the attached code.

The section(4KB) erasing time is tick number is (3981018-6947)*(1/12000000)=330mS, the section programming time is (4244825-3981018)=21uS.

Hope it can help you

BR

Xiangjun Rong

0 项奖励
回复

1,475 次查看
prasannanaik
Contributor III

Hi xiangjun.rong‌,

   There is a huge difference between your result and mine.Your method seems the most accurate one. Is there anything wrong wih my procedure?. Iam using high resolution Digital oscilloscope for timing measurement.

Thanks and best regards,

Prasanna

0 项奖励
回复

1,475 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Prasanna,

Regarding your question, as you know that the SPI flash MX25R6435FM2IL0 is used on OM13092, you can download the data sheet of the spi flash from the link:

http://www.macronix.com/Lists/Datasheet/Attachments/7428/MX25R6435F,%20Wide%20Range,%2064Mb,%20v1.4.... 

The erasing/programming time is dependent on the spi flash itself rather than the processor.

Pls refer to following figure, you can see that sector erase time is from 40ms to 240ms, you test the sector erasing time as 47ms, it is okay.

Hope it can help you

BR

XiangJun Rong

pastedImage_2.png

0 项奖励
回复

1,475 次查看
prasannanaik
Contributor III

Hi xiangjun.rong‌,

   Thanks for your help.

   The datasheet helps in understanding the 47 msec time but why am i getting 3.64 msec sector erase time when i am just testing the sector erase as mentioned in case 1 of  my query. Even that time should be 40 msec ?

Thanks and best regards,

Prasanna

0 项奖励
回复

1,475 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Prasanna,

I suspect you test the wrong elapsing time with GPIO timing for the flash erasing/programming time, can you use a Timer to get the accurate tick number?

BR

Xiangjun Rong

0 项奖励
回复