Skip to main content
Associate III
September 29, 2026
Question

Why is the STM32N6 Discovery Kit linker script configured/limited to 16 MB in all offical github examples ?

Hi everyone,

I’m working with the STM32N6570-DK (STM32N6 Discovery Kit) and noticed that the example projects/scripts configure the external flash memory as 16 MB in the linker script.

However, as far as I understand, the Discovery Kit supports 32 MB of external flash.

I’m trying to understand why the linker scripts are configured for only 16 MB.

For example, if the linker script contains something similar to:

FLASH (rx) : ORIGIN = ..., LENGTH = 16M

I have a few questions:

  • Why is the linker script configured for 16 MB when the board supports 32 MB?

  • Is the 16 MB value simply a default/example-project configuration, or is there a technical reason for it?

  • Can the FLASH region safely be changed from 16 MB to 32 MB?

  • Are there any restrictions related to the STM32N6 memory map, OCTOSPI/XSPI configuration, boot process, linker script, MPU/cache configuration, or startup code?

  • If I want to use the complete 32 MB, are there any other project files or configurations that need to be modified in addition to the linker script?

I’m asking because I’m working with a larger application/model and would like to make use of the full external flash available on the STM32N6570-DK.

I would appreciate it if someone from ST could clarify whether the 16 MB configuration is intentional and why, despite the board supporting 32 MB.

Thanks!

10 replies

mƎALLEm
ST Technical Moderator
September 29, 2026

Hello,

Examples and software related questions need to be asked in STM32 MCUs Embedded software forum board.

I’m moving it then..

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
vedantggAuthor
Associate III
September 29, 2026

ok sure 

ST Technical Moderator
September 29, 2026

Hello ​@vedantgg 

Could you share the linker script where the external flash is configured to 16 MB please? 

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om
vedantggAuthor
Associate III
September 29, 2026
ST Technical Moderator
September 29, 2026

Hello ​@vedantgg 

Could you share the link to the example on Github please?

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om
Associate II
September 29, 2026

The STM32N6570-DK with STM32N657X0H3Q is said to support up to 256-Mbit Hexadeca‑SPI PSRAM that’s 32MB of PSRAM.

The linker script gives      PSRAM (xrw)           : ORIGIN = 0x91000000, LENGTH =  16M

If Software tools don’t yet show the 32MB support you could edit the linker script in IDE before building, assume origin correct,

Edit the script to show      PSRAM (xrw)           : ORIGIN = 0x91000000, LENGTH =  32M

vedantggAuthor
Associate III
September 29, 2026

yes i tried editing the script, i am able to write to  memory above 16MB and read from it but when i allocate it a buffer the application starts to hang . I am not able to get why 

Associate II
September 29, 2026

from the linker script the only section that uses PSRAM is:- 

 .psram_section (NOLOAD):
  {
     . = ALIGN(32);
    *(.psram_bss)
    . = ALIGN(32);
  } >PSRAM
 

To me it implies treatment as .bss also mentioning NOLOAD.

Perhaps you could raise a support ticket?