Skip to main content
Associate III
August 7, 2026
Question

STM32N6 XSPI EXTENDMEM (two octal PSRAM, 128 MB): CubeMX has no toggle

  • August 7, 2026
  • 0 replies
  • 17 views

On an STM32N657X0HxQ I'm bringing up two APS51208N octal-DDR PSRAMs (512 Mb / 64 MB each, x8) on a single XSPI1 controller, XSPIM Port 1, using EXTENDMEM to get a contiguous 128 MB map. This is configured in the FSBL context.

Per RM0486 §28.4.24, one XSPI drives both NCS1/NCS2 autonomously when EXTENDMEM (XSPI_DCR1 bit 21) is set.

My CubeMX config (which it accepts without error):
- XSPIM: Direct (XSPI1 on Port1)
- XSPI1: Octo SPI, Port1 Octo, Memory Type = AP Memory, Memory Mode = Enable
- Memory Size = 512 Mbit (one die, per "the size of one external memory must be set in DEVSIZE")
- Chip Select Boundary = 64 MB
- Memory Select = NCS1

I could not find any EXTENDMEM / dual-memory / extended-memory option anywhere in the CubeMX XSPI1 panel, so I'm handling the extended-memory parts in user code. Three things I'd like confirmed:

  1. EXTENDMEM has no CubeMX exposure: is setting XSPI1->DCR1 |= (1U << 21) manually after MX_XSPI1_Init() the intended approach, or is there a CubeMX setting I've missed?
  2. NCS2 pin: CubeMX only reserves NCS1 (its config model is single-die). I can assign XSPIM_P1_NCS2 to the pin in the Pinout view, but it stays orange ("unused") since nothing in the config drives it. Is manually muxing the NCS2 pin the correct/expected way, and once EXTENDMEM is set does the hardware drive NCS2 correctly with only the pin AF configured, or does NCS2 need anything beyond that?
  3. DEVSIZE = per-die (512 Mbit), not the 128 MB total — can you confirm that's correct for EXTENDMEM mode?

No functional bug to report. This is design validation ahead of PCB layout, since I understand there's no ST reference hardware for two octal DDR PSRAMs.