The STM32 devices embed up to three instances (OCTOSPI1 and OCTOSPI2/XSPI1, XSPI2, XSPI3) of the Octo-SPI/XSPI interfaces. Three XSPI instances are available only on STM32N6 devices.
The OCTOSPI/XSPI support most external memories, such as serial PSRAMs, serial NAND and serial NOR Flash memories, HyperRAM™ and HyperFlash™ memories.
The OCTOSPI/XSPI in Indirect mode propose a DMA mode for read/write data transfers to their peripheral registers. The OCTOSPI/XSPI are burst capable via their embedded 64-byte FIFO for XSPI and 32-byte FIFO for OCTOSPI.
The GPDMA request signal (no GPDMA request signal for STM32H7Rx/7Sx), is used by the hardware to request a new burst to be read/written by the GPDMA whenever the peripheral needs it. The GPDMA reads/writes the OCTOSPI_DR/XSPI_DR data register. This 32-bit data register can be accessed by a 32-bit word-aligned read access, with a programmed source data width being typically either 8-, 16-, or 32-bit and with a fixed addressing.
The burst is defined on the OCTOSPI/XSPI sides by programming the FIFO threshold FTHRES[4:0] in OCTOSPI_CR /XSPI_CR with a 1 to 32-byte burst size for OCTOSPI and 1 to 64-byte burst size for XSPI.
The allocated GPDMA channel is recommended to be one of the channel with 8‑word FIFO. It can perform bursts of a size equal to half of its FIFO size (up to 16-byte, 8-half-word, or 4-word bursts). This means programming a 15 decimal value on the OCTOSPI/XSPI sides (FTHRES[:0] = 15).
Using a 32-bit data width is preferred for minimizing the AHB bus load, unless the application requires a byte-level or half-word data management.
The table below summarizes the main peripheral characteristics: hardware request signal to the GPDMA, peripheral bus on which the OCTOSPI/XSPI are connected, and peripheral register from/to which the GPDMA must be programmed to read or write.
Table 52. OCTOSPI peripheral information| Peripheral request to GPDMA | Peripheral bus | Peripheral FIFO (unit, size) | Peripheral register access | Comments |
|---|
|
ospiy_dma/octospiy_dma/xspy_dma (y = 1, 2, 3)
| AHB_OCTOSPI (dedicated target of bus matrix) | 32-byte FIFO | Read/Write OCTOSPI_DR | It is recommended to access OCTOSPI_DR with a programmed 4-word burst, when a 32-bit data width is applicable. |
Table 53 GPDMA recommendation for OCTOSPI shows the supported and recommended GPDMA settings to be used for serving the different peripheral requests: GPDMA port allocation, GPDMA channel allocation, and programmed GPDMA bursts in terms of data width and burst length (only single data mode).
Table 53. GPDMA recommendation for OCTOSPI| GPDMA source/destination port | GPDMA source/destination burst | GPDMA channel | Comments |
|---|
| GPDMA data width | GPDMA burst length |
|---|
| Port 11 | 32-bit (preferred) else 8- or 16-bit | 4-word (preferred) or 8-half-word or 16-byte | Channel with 8‑word FIFO for burst performances | The default port allocation (port 0 to peripheral, port 1 to external memory) enables to balance the bandwidth over each port for memory-to-peripheral and peripheral-to-memory transfers. It also avoids bursts to memory from impacting directly the latency of a peripheral access. GPDMA port selection for the source and the destination transfers can be changed to fit specific application needs. For improved burst performances, the channel allocation can be one of the channels with 8‑word FIFO. |