Octo-SPI interface (OCTOSPI)
Status-flag polling mode configuration
The Status-flag polling mode is enabled by setting FMODE[1:0] = 10. In this mode, the
programmed frame is sent and the data is retrieved periodically.
The maximum amount of data read in each frame is 4 bytes. If more data is requested in
OCTOSPI_DLR, it is ignored and only 4 bytes are read.The periodicity is specified in
OCTOSPI_PIR.
Once the status data has been retrieved, the following can be processed:
•
Set SMF (an interrupt is generated if enabled).
•
Stop automatically the periodic retrieving of the status bytes.
The received value can be masked with the value stored in OCTOSPI_PSMKR, and can be
ORed or ANDed with the value stored in OCTOSPI_PSMAR.
In case of a match, SMF is set and an interrupt is generated if enabled; The OCTOSPI can
be automatically stopped if AMPS is set. In any case, the latest retrieved value is available
in OCTOSPI_DR.
When the OCTOSPI is used in Auto-polling mode, the frames are constructed in the
following way:
1.
Specify the input mask in OCTOSPI_PSMKR.
2.
Specify the comparison value in OCTOSPI_PSMAR.
3.
Specify the read period in OCTOSPI_PIR.
4.
Specify a number of data bytes to read in OCTOSPI_DLR.
5.
Specify the frame timing in OCTOSPI_TCR.
6.
Specify the frame format in OCTOSPI_CCR.
7.
Specify the instruction in OCTOSPI_IR.
8.
Specify the optional alternate byte to be sent right after the address phase in
OCTOSPI_ABR.
9.
Specify the optional targeted address in OCTOSPI_AR.
If the address register (OCTOSPI_AR) does not need to be updated for a particular
command, then the command sequence starts as soon as OCTOSPI_CCR is written. This
is the case when ADMODE[2:0] = 000.
When an address is required (ADMODE[2:0] ≠ 000), the command sequence starts as soon
as the address is updated with a write to OCTOSPI_AR.
Memory-mapped mode configuration
In Memory-mapped mode, the external device is seen as an internal memory but with some
latency during accesses. Read and write operations are allowed to the external device in
this mode.
It is not recommended to program the Flash memory using memory-mapped writes, as the
internal flags for erase or programming status have to be polled.
Memory-mapped mode is entered by setting FMODE[1:0] = 11 in OCTOSPI_CR.
The programmed instruction and frame are sent when an AHB master is accessing the
memory mapped space.
The FIFO is used as a prefetch buffer to anticipate any linear reads. Any access to
OCTOSPI_DR in this mode returns zero.
576/2301
RM0432 Rev 6
RM0432
Need help?
Do you have a question about the STM32L4+ Series and is the answer not in the manual?