Example of how to read QSPI NOR Flash Device ID

Hi, can someone provide an example of reading the device ID from an QSPI flash (NOR)?

I'm trying to get it using my NRF52840 using the nrf sdk17.1 with the flash IC AT25FF081A but not getting correct values, just zeros.

For the AT25FF081A, the read device id cmd is 0x90 and we need to send the cmd byte first on the SI pin, then 3 dummy address bytes on the SI pin then receive the 2 data bytes on the SO pin.

Here is my code:

Here is our qspi config

Parents
  • Hi 

    Often you need to send a reset command first, before reading out the Jedec ID. Have you checked the datasheet if this is necessary? 

    Have you tried to probe the QSPI lines with a scope or logic analyzer to see if the output is as you expect?

    Just looking at the code I can't really spot the issue. 

    Best regards
    Torbjørn

Reply
  • Hi 

    Often you need to send a reset command first, before reading out the Jedec ID. Have you checked the datasheet if this is necessary? 

    Have you tried to probe the QSPI lines with a scope or logic analyzer to see if the output is as you expect?

    Just looking at the code I can't really spot the issue. 

    Best regards
    Torbjørn

Children
  • That is one way to do it, reset then read the id

    but we want to read the device id after a reset as well (sometime later).

    I guess, my worry is I'm not using nrfx_qspi_cinstr_xfer function correctly.

    If the datasheet says it  needs us to send the 1 byte opcode and then 3 dummy (addr) bytes before it sends back the 2 databytes then am I using the nrf sdk function correctly?

  • Also, I am able to write and read data from the flash IC

    it's just the device id I can't read

  • Ok looks like I got it working now. Here is the code for others to reference

  • Good to hear you found the issue, and thanks for sharing the solution Slight smile