This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to establish that QSPI device is working properly

I am testing a number of boards with a QSPI memory module with NRF52840 chip.

The QSPI driver functions all return without error even if the chip is not present.  What is the best way to establish that it is working?

For example, the function "nrf_drv_qspi_init" will return no error if I set the pins incorrectly.  

Eventually I want to run a check on startup that all my peripherals are working correctly, and am unsure of the best way to proceed.  My best idea is to read the REMS register and compare to expected manufacturer and device ID, but seems a bit excessive.

Thank you.

  • Hi,

    From the API reference, it looks like the READY event should not be generated before the flash chip is correctly initialized, but I confirmed that this is not the case on my board. You may be able to check the status register, but this requires that it actually contains something other than 0x00 after chip is read:

    while((NRF_QSPI->STATUS >> 24) == 0x00);    // Read NRF_QSPI->STATUS.SREG register

    This seems to work with the DK, which holds 0x40 in this register when the chip is initialized correctly. If wrong pins are used, this will loop forever, as it is stuck at 0x00.

    Best regards,
    Jørgen

Related