9.4.6.10.3 GCLK Frequency Change Procedure

The GCLK frequency change procedure is as follows.

  1. Wait for QSPI_SR.RBUSY=0 and QSPI_SR.HIDLE=1.
  2. Send a QSPI_CR.LASTXFER command.
  3. If QSPI_SR.CSS=0, wait for QSPI_ISR.CSRA=1.
  4. Set QSPI_CR.QSPIDIS and wait for QSPI_SR.QSPIENS=0.
  5. Disable the GCLK clock.
  6. Set QSPI_CR.DLLOFF and wait for QSPI_SR.DLOCK=0.
  7. If QSPI_SR.CSS=0, wait for QSPI_ISR.CSRA=1.
  8. Wait for QSPI_SR.CALBSY=0.
  9. Change GCLK frequency.
  10. Write:
    • QSPI_CR. DLLON
    • QSPI_CR.STPCAL
  11. Wait for:
    • QSPI_SR.DLOCK=1
    • QSPI_SR.CALBSY=0
  12. Write QSPI_CR.QSPIEN.
  13. Wait for QSPI_SR.QSPIENS=1.
  14. If automatic refresh is enabled, wait for QSPI_ISR.RFRSHD=1 by polling or interrupt (see Automatic Refresh).