AnsweredAssumed Answered

QSPI flash timing issue in LPC546xx

Question asked by Prasanna Naik on Jun 4, 2019
Latest reply on Jun 10, 2019 by xiangjun.rong

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

 

Outcomes