cancel
Showing results for 
Search instead for 
Did you mean: 

How to connect two quad-SPI memories using only one OCTOSPI

KDJEM.1
ST Employee

There are two possible solutions for connecting two quad-SPI memories using only one OCTOSPI interface.

Solution 1:

Use a dedicated bit in the OCTOSPI_CR register for external memory selection: MSEL bit for STM32H5, STM32U5, and STM32L5 series or FSEL bit for STM32H7 and STM32L4+ series: The idea is to select the external memory to be addressed in single-, dual-, quad-SPI mode in a single-memory configuration.
MSEL or FSEL bit configuration:
0: External memory 1 selected (data exchanged over IO[3:0])
1: External memory 2 selected (data exchanged over IO[7:4])
This MSEL/FSEL bit is ignored when DMM = 1 or when octal-SPI mode is selected.

Figure 1: Connecting 2xQuadSPI memories using only one OCTOSPI interface.Figure 1: Connecting 2xQuadSPI memories using only one OCTOSPI interface.

 

Solution 2:

Use a different chip select GPIO pins for each memory. The two memories must be connected to the same OCTOSPI instance. The chip select of each memory must be connected to an OCTOSPI chip select GPIO pin as shown in the below figure. 

The software should configure the chip to select the GPIO pin for the memory to be accessed by driving the GPIO configuration. For example, when transmitting data to quad-SPI memory1, it is recommended to set the quad-SPI memory2 chip select pin (Pin2) to high voltage by using a pull-up resistor. In this case, the GPIO Pin2 is configured as GPIO output "Pull-up" and the Pin1 is configured as an alternate function.

 

Figure 2: Connecting 2xQuadSPI memories using only one OCTOSPI interface.Figure 2: Connecting 2xQuadSPI memories using only one OCTOSPI interface.

 Notes

  • These two proposed solutions can be applied when using identical or different types of quad-SPI memories.
  • In case of two different memories, before switching from quad-SPI memory to another, it is recommended to reconfigure the OCTOSPI interface accordingly the desired memory specification.
  • Please wait for data transmission to be completed before switching from quad-SPI memory to another.
Version history
Last update:
‎2024-08-05 02:45 AM
Updated by: