Read QSPI flash status register SAMD51

1 post / 0 new
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,  I have my QSPI interface working good, but I just can't seem to trigger a read to the QSPI Flash's status register.  Does anyone have a snippet of code to share how they do this?  No need for the actual command to be QSPI, a regular single-bit SPI command would be fine.


I can trigger, say, a write enable just fine:


        QSPI ->INSTRCTRL.reg = 0x06; //Write Enable
        QSPI ->INSTRFRAME.reg = 0x10;  //Command frame enable
        junk = QSPI ->INSTRFRAME.reg;


I think this is how you would read the status register, but it does not even trigger activity to the QSPI:


QSPI ->INSTRCTRL.reg = 0x5;  //REad status
QSPI ->INSTRFRAME.reg = 0x00090;  //Command and data frame enable
junk = QSPI ->INSTRFRAME.reg;
junk32 = QSPI ->RXDATA.reg;


Or, the INSTRFRAME might be:

QSPI ->INSTRFRAME.reg = 0x01090;  //Command and data frame enable, different READ Transfer Type