Quad-SPI interface (QUADSPI) RM0402
296/1163 RM0402 Rev 6
12.3.6  QUADSPI status flag polling mode
In automatic-polling mode, the QUADSPI periodically starts a command to read a defined 
number of status bytes (up to 4). The received bytes can be masked to isolate some status 
bits and an interrupt can be generated when the selected bits have a defined value. 
The accesses to the Flash memory begin in the same way as in indirect read mode: if no 
address is required (AMODE
 = 00), accesses begin as soon as the QUADSPI_CCR is 
written. Otherwise, if an address is required, the first access begins when QUADSPI_AR is 
written. BUSY goes high at this point and stays high even between the periodic accesses.
The contents of MASK[31:0] (QUADSPI_PSMAR) are used to mask the data from the Flash 
memory in automatic-polling mode. If the MASK[n]
 = 0, then bit n of the result is masked 
and not considered. If MASK[n]
 = 1, and the content of bit[n] is the same as MATCH[n] 
(QUADSPI_PSMAR), then there is a match for bit n.
If the polling match mode bit (PMM, bit 23 of QUADSPI_CR) is 0, then “AND” match mode is 
activated. This means status match flag (SMF) is set only when there is a match on all of the 
unmasked bits.
If PMM = 1, then “OR” match mode is activated. This means SMF is set if there is a match 
on any of the unmasked bits.
An interrupt is called when SMF is set if SMIE = 1.
If the automatic-polling-mode-stop (APMS) bit is set, operation stops and BUSY goes to 0 
as soon as a match is detected. Otherwise, BUSY stays at ‘1’ and the periodic accesses 
continue until there is an abort or the QUADSPI is disabled (EN
 = 0).
The data register (QUADSPI_DR) contains the latest received status bytes (the FIFO is 
deactivated). The content of the data register is not affected by the masking used in the 
matching logic. The FTF status bit is set as soon as a new reading of the status is complete, 
and FTF is cleared as soon as the data is read.
12.3.7 QUADSPI memory-mapped mode
When configured in memory-mapped mode, the external SPI device is seen as an internal 
memory.
It is forbidden to access QUADSPI Flash bank area before having properly configured and 
enabled the QUADSPI peripheral.
No more than 256MB can addressed even if the Flash memory capacity is larger.
If an access is made to an address outside of the range defined by FSIZE but still within the 
256MB range, then a bus error is given. The effect of this error depends on the bus master 
that attempted the access:
• If it is the Cortex
®
 CPU, bus fault exception is generated when enabled (or a hard fault 
exception when bus fault is disabled)
• If it is a DMA, a DMA transfer error is generated and the corresponding DMA channel is 
automatically disabled.
Byte, halfword, and word access types are all supported.
Support for execute in place (XIP) operation is implemented, where the QUADSPI 
anticipates the next access and load in advance the byte at the following address. If the 
subsequent access is indeed made at a continuous address, the access is completed faster 
since the value is already prefetched.