Skip to main content
Visitor II
August 18, 2026
Solved

How to Integrate 2 PSRAM in one XSPI instance

  • August 18, 2026
  • 6 replies
  • 160 views

Hi,

We are working with the STM32H7S7 MCU for our project and are planning to use both XSPI interfaces for external memories.

Our current plan is:

  • XSPI1: PSRAM

  • XSPI2: External Flash (128MB)

We would like to use 128MB of PSRAM, but currently, only 64MB PSRAM devices are available to us. Therefore, we would like to know whether it is possible to integrate two 64MB PSRAM devices with XSPI1 to achieve a total PSRAM capacity of 128MB.

I have gone through the AN5050 – Octo-SPI Interface on STM32 MCUs document and understand that the multiplexed mode can be used to connect two external memory devices using separate NCS pins.

In this case, if we configure XSPI1 in multiplexed mode and connect two PSRAM devices using the available NCS pins:

  1. Can two 64MB PSRAM devices be connected to XSPI1 in this configuration and used as a combined 128MB memory space?

  2. If XSPI1 is configured in multiplexed mode for the two PSRAM devices, can XSPI2 still be used independently for the external 128MB Flash?

  3. If this approach is not recommended or not practically possible, could you please suggest an alternative solution for achieving the required 128MB PSRAM + 128MB external Flash configuration?

Best answer by KDJEM.1

Hello ​@Bhuvanesh .

 

Query1. According to RM0477, if two XSPIs multiplexed mode to Port 2, it is possible to connect a 16-bit memory on Port 1, whereas Port 2 uses multiplexing mode on two octal memories. If two XSPIs multiplexed mode to Port 1, it is possible to connect a octal memories on Port 1, whereas Port 1 uses multiplexing mode on two octal memories.

 

Query2. The OCTOSPI/XSPI I/O manager implements a Multiplexed mode feature. When enabled, both OCTOSPI1/2 or both XSPI1/2 signals are mixed over one OCTOSPI/XSPI I/O port except the OCTOSPI1/2_NCS / XSPI1/2_NCS1/2 pins. So, with multiplexed mode enable, you can minimize the nombre of GPIOs.

 

I hope this answer your request.

Thank you.

Kaouthar

6 replies

KDJEM.1
ST Technical Moderator
August 18, 2026

Hello ​@rizwan07 ,

 

Yes you can connect two 64MB PSRAM devices to XSPI1. So, two XSPIs multiplexed mode to Port 1 can be accessible by two external memories. The arbiter in the IO manager selects XSPI1 or XSPI2 to own the octal-SPI bus according to the existing transfer requests. The external memories can be on separate chips, or embedded in a single multichip package. In this case, each memory requests a dedicated Chip select, selected according to the CSSEL control of the XSPI currently owning the bus. 

 

When two XSPI instances are available (XSPI 1 and XSPI2), the XSPI I/O manager matrix allows the user to set multiplexed modes for these cases:

• Multiplexed to Port1: XSPI1 and XSPI2 both mapped to Port 1, with arbitration (multiplexed mode)

• Multiplexed to Port2: XSPI1 and XSPI2 both mapped to Port 2, with arbitration (multiplexed mode). Note that it is possible to connect a 16-bit memory on Port 1, whereas Port 2 uses multiplexing mode on two octal memories

You can connect three memories, for example if the STM32 MCUs supports three instances or by using pseudo-static communication

*When three XSPI instances are available (XSPI, XSPI2 and XSPI3), the XSPI I/O manager matrix allows the user to set multiplexed modes for these cases:

  • Multiplexed to Port1: XSPI1 and XSPI2 both mapped to Port 1, with arbitration (multiplexed mode), and XSPI3 mapped to Port 2
  • Multiplexed to Port2: XSPI1 and XSPI2 both mapped to Port 2, with arbitration (multiplexed mode), and XSPI3 mapped to Port 1

*To one Octo-SPI interface using pseudo-static communication

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 octo-SPI memory1, it is recommended to set the octo-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.

 

I hope this answer your request.

 

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.
Visitor II
August 19, 2026

Hi ​@KDJEM.1,

I understand the concept of multiplexing of 2 RAM, we are using STM32H7S7 and we have only 2 XSPI instances.

We are connecting two 512Mbit of PSRAM Multiplexed to Port1: XSPI1 and XSPI2 both mapped to Port 1, with 2 different CS pin of XSPI1

Query1:  Since the both the XSPI1 and XSPI2 are mapped to part1, is it possible to connect 1Gbit of NOR flash to XSPI2 and use it from port2?

Query2: Since both the XPI instances are individual and has 2 independent ports why we need to map both the XPI to one port during multiplexing?

 

Regards,
Bhuvanesh

 

KDJEM.1
KDJEM.1Best answer
ST Technical Moderator
August 19, 2026

Hello ​@Bhuvanesh .

 

Query1. According to RM0477, if two XSPIs multiplexed mode to Port 2, it is possible to connect a 16-bit memory on Port 1, whereas Port 2 uses multiplexing mode on two octal memories. If two XSPIs multiplexed mode to Port 1, it is possible to connect a octal memories on Port 1, whereas Port 1 uses multiplexing mode on two octal memories.

 

Query2. The OCTOSPI/XSPI I/O manager implements a Multiplexed mode feature. When enabled, both OCTOSPI1/2 or both XSPI1/2 signals are mixed over one OCTOSPI/XSPI I/O port except the OCTOSPI1/2_NCS / XSPI1/2_NCS1/2 pins. So, with multiplexed mode enable, you can minimize the nombre of GPIOs.

 

I hope this answer your request.

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.
Visitor II
August 19, 2026

Hi ​@KDJEM.1,

Thanks for sharing the Rm0477, I am using STM32H7S7I8T6 which is 176-LQFP package which has only 8bit mode on port1, 512Mbit DRAM (HYPERRAM) with 8bit data bus and 1Gbit NOR flash with 8bit data bus

As per reference manual 25.5.5 and 25.5.6, I hope either I can use the 2 below methods

  1. XSPI multiplexed mode to port 1 and connect two HYPERRAM with XSPIM_P1 lines and 8bit NOR flash with XSPIM_P2 lines to port2 and use
  1. XSPI multiplexed mode to port 2 and connect two HYPERRAM with XSPIM_P2 lines and 8bit NOR flash with XSPIM_P1 lines to port1 and use

to achieve total of 1Gbit (2x512Mbit) of DRAM and 1Gbit of NOR flash. Correct me if I am wrong.

 

Thank you

Bhuvanesh 

KDJEM.1
ST Technical Moderator
August 19, 2026

Hello ​@Bhuvanesh ,

 

Yes you are right. 

But note that The device capacity can be up to 4 Gbytes (addressed using 32-bits) in indirect mode, but the addressable space in memory-mapped mode is limited to 256 Mbytes. 

 

I hope this answer your request.

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.
Visitor II
August 19, 2026

Got it ​@KDJEM.1, Thanks for the support