Erasing 4kb QSPI ext flash block takes too long 700 - 900 millisec

NRF52840 running 17.1 SDK and using QSPI interface to erase a block of memory from AT25FF321A external flash IC.

When we call erase it takes 930 millisec to finish erasing a 4kb block. The IC datasheet says it should only take 45 millisec or something like that. 

Why is it taking so long?

 

nrfx_err_t nrf_err = nrfx_qspi_erase(NRF_QSPI_ERASE_LEN_4KB, start_address);
if (NRFX_SUCCESS == nrf_err)
{
    while(NRFX_SUCCESS != nrf_drv_qspi_mem_busy_check());
}

// this usually takes 770 - 930 millisec to finish
// but the datasheet for the ext falsh says it should only take 45 ms at most

  • Hi Joshua, 
    I don't see any issue with the code and the driver for QSPI. It could be that it's the performance issue with the external flash. 
    Have you tried to test with the external flash on the DK ? From the datasheet it should take less than 240ms for 4kB erase. 

  • I have the nrf52840 dev kit so will try.

    also, we are not using the standard nrf qspi pins, does that make a difference?

    #define GPIO_SPI_MISO 6u // SIO_6 = NVM SPI MISO input pin (QSPI = IO1)
    #define GPIO_SPI_CLK 7u // SIO_7 = NVM SPI CLK output pin
    #define GPIO_SPI_MOSI 8u // SIO_8 = NVM SPI MOSI output pin (QSPI = IO0)
    #define GPIO_SPI_IO3 9u // SIO_9 = NVM SPI IO3 pin
    #define GPIO_SPI_IO2 10u // SIO_10 = NVM SPI IO2 pin

    also, not sure if it makes a difference but our nrf52840 core is integrated into the Laird Connectivity BL654 module...

  • Hi Joshua, 
    As long as  you use our library directly you shouldn't have a problem using the nRF52 on the Laird's module. 
    When you change the QSPI pin, please make sure you follow the guideline on which pin should be used for QSPI. 
    I can see you are using some pins that clearly noted "low frequency I/O only" please try avoid that. Please check the spec for the detail list:


  • ok,

    by the way, 

    using the standard nrf erase method:
    nrfx_err_t nrf_err = nrfx_qspi_erase(NRF_QSPI_ERASE_LEN_4KB, start_address);

    will the function 'nrfx_qspi_erase' automatically send the wren (0x06) cmd before calling the erase cmd?

  • Hi Joshua, 
    As far as I know by default WREN is not sent. If you want to send WREN you would need to set WREN to 1 in ADDRCONF register. In the code it's done by calling nrf_qspi_addrconfig_set(). 
    I was suggesting that you should use the logic analyzer to verify the QSPI operation is correct. Please consider that. 

Related