Skip to main content
Jayesh2
Associate II
April 30, 2025
Question

How to utilize full XIP RAM in XSPI_PSRAM_MemoryMapped

  • April 30, 2025
  • 2 replies
  • 372 views

I want to take buffer of ~4MB in XSPI_PSRAM_MemoryMapped example of  STM32N6. I am just increasing the size BUFFERSIZE to 3MB but there is a error in building. As XSPI RAM is 256Mbit(16MB)  I was hoping this buffer size should be valid. But that is not the case. What modifications I need so I can increase buffer size >4MB.

 

I am attaching my project here. Only modification I made in this project from default code is increase buffer size.

#define BUFFERSIZE 302400

 

2 replies

N. SANTINI
ST Employee
May 2, 2025

Hi,

You must modify the linker script accordingly, from your project I assume you are using IAR IDE then you must omdify the stm32n657xx_axisram2_fsbl.icf file.

In your project the RAM region is from 0x341C0000 to 0x341FFFFF so only 262 143 Bytes.

You should modify the __ICFEDIT_region_RAM_start__ value and __ICFEDIT_region_RAM_end__ value.

For the memory mapping of the various SRAM and their range, please see the user manual (page 166):

https://www.st.com/resource/en/reference_manual/rm0486-stm32n647657xx-armbased-32bit-mcus-stmicroelectronics.pdf

0x34100000 AXISRAM2
0x34000000 AXISRAM1

For example to use 1MBytes of SRAM1 you can set 

__ICFEDIT_region_RAM_start__ to 0x34000000

__ICFEDIT_region_RAM_end__ to 0x340FFFFF

Best regards,

Nicolas

Tesla DeLorean
Guru
May 2, 2025

Pointers?

Add the space to the arena from which malloc() draws? Perhaps via _sbrk() on GNU/GCC side

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..