Using FL-S SPI Flash Memory with STM Accordo5 in QUAD mode – KBA220177

Version: *A

 

Question:

How can I use FL-S SPI Flash Memory with STM Accordo5 in Quad mode?

 

Answer:

The SQIO controller supports Fast read in SPI mode and Fast read in QPI mode. The following are the supported quad lines protocols (the blue text indicates compatible modes):

 

  • Command sent on a single line, but address and data sent on quad lines (1-4-4, SQI Type1) – Use Quad I/O Read command (QIOR EBhor 4QIOR ECh)

  • Command, address sent on a single line but data sent and received on quad lines (1-1-4, SQI Type 2) – Use Quad Output Read Command (QOR 6Bh or 4QOR 6Ch)

  • Command, address, data sent on quad lines (QPI) – FL-S does not support this mode

 

The following are the SQI settings to be used when attaching the Flash to CS0# (the recommended settings are in blue):

 

Memory map:

 

  • XIP memory base address SQI_CS0#: 0x9000.0000
  • XIP memory base address SQI_CS1#: 0x9800.0000

 

Configuration registers base address:

 

  • SQI_CS0#: 0x5020.0000
  • SQI_CS1#: 0x5080.0000

 

SQI registers address offset and recommended settings:

 

  • 0x0100: SQI Command Status Register
    • Bit[9:8] SQIO_MODE
      • 00 (SPI mode)
      • 01 (QPI mode)
      • 10 (SQI mode 1)
      • 11 (SQI mode 2)
  • 0x0104: SQI Address Register
  • 0x0108: SQI Data Register
  • 0x010C: SQI Configuration Register
    • Bit[18] DUMMY_DIS
      • 0: Enable DUMMY_CYCLES
      • 1: Zero dummy cycle
    • Bit[17:15] DUMMY_CYCLES
      • For QPI mode
        • 000: 2 cycles
        • 001: 4 cycles
        • 010: 6 cycles
        • 011: 8 cycles
        • 100: 10 cycles
      • For SQI mode 1
        • 001: 4 cycles
        • 010: 6 cycles
        • 011: 8 cycles
        • 100: 10 cycles
      • For SQI mode 2
        • 001: 4 cycles
        • 101: 6 cycles
        • 011: 8 cycles
        • 100: 10 cycles
      • Bit[8] SPI clock mode
        • 0: mode 0
        • 1: mode 3
  • 0x0110: SQI Status Polling Register
  • 0x0114: SQI Extended Address Register
  • 0x0118: SQI Configuration Register 2