The sequence of operations uses I/O mode for reads and writes.
- Enable manual mode. Write
1to qspi.Config_reg[Man_start_en, Manual_CS] =1 - Configure the flash device. Refer to Table 1. Use reset values of the qspi.LQSPI_CFG register for
a single flash device. In case of a parallel dual flash device, write
1to the TWO_MEM, SEP_BUS bit fields. - Assert chip select. Set qspi.Config_reg[PCS] =
0 - Enable the controller. Set qspi.En_REG[SPI_EN] =
1 - Write byte sequences to the flash memory. Write from 1 to 4 bytes to the TxFIFO using the TXD registers. Refer to I/O Mode Transmit Registers (TXD).
- Avoid TxFIFO overflow. When the TxFIFO is empty, 252 bytes can be written. After that, software can avoid overflowing the TxFIFO by reading qspi.Intr_status_REG[TX_FIFO_full] and waiting until it equals 0 before writing to a TXD register.
- Enable the interrupts. Write to qspi.Intrpt_en_REG. Interrupt handlers that handle the interrupt conditions are discussed in interrupt handlers section.
- Start data transfer. Set qspi.Config_reg[Man_start_com] =
1 - Interrupt handler: Transfer all the required data to QSPI flash during program/read operations to Quad-SPI flash. See Example: I/O Mode Interrupt Service Routine.
- If read operations are carried out: re-arrange the READ data to eliminate the data read due to dummy cycles.
- De-assert chip select. Set QSPI.Config_reg[PCS] =
1 - Disable controller. Set qspi.En_REG[SPI_EN] =
0
The TxFIFO width must be programmed to 32 bits:
qspi.Config_reg[FIFO_WIDTH] = 0b11. Software needs to take care of
“consecutive non word aligned” transfers.