2025-07-27 12:21 PM - edited 2025-07-27 12:21 PM
I am currently using the STM32N657 to drive an 800x480 pixel display with 24-bit color. The problem that I am running into is the buffer that I need uses 1.1MB (800*480*3 = 1.152MB). Using just FSBL, I am limited to 511KB of SRAM. I know that this chip has 4.2MB of SRAM on it, so how do I access that SRAM for my buffer?
Solved! Go to Solution.
2025-07-28 6:05 AM
Hello @DHOUT19
You need to check the Reference Manual or Memory Map section of the STM32N657 datasheet to find the base address and size of the full SRAM region.
Please follow these steps below:
Check the full SRAM memory address and size in the STM32N657 datasheet or reference manual.
Modify your linker script to increase the SRAM region size to 4.2MB and optionally create a dedicated section for your framebuffer.
MEMORY
{
/* Adjust these addresses and sizes based on your device's memory map */
SRAM (rw) : ORIGIN = 0x30000000, LENGTH = 0x00420000 /* 4.2MB SRAM */
/* Other memory regions */
}
SECTIONS
{
/* Place your framebuffer buffer in SRAM */
.framebuffer (NOLOAD) :
{
. = ALIGN(4);
_framebuffer_start = .;
KEEP(*(.framebuffer))
. = ALIGN(4);
_framebuffer_end = .;
} > SRAM
}
Declare your framebuffer in code with a section attribute to place it in the large SRAM region.
#define FRAMEBUFFER_SIZE (800 * 480 * 3)
__attribute__((section(".framebuffer")))
uint8_t framebuffer[FRAMEBUFFER_SIZE];
2025-07-28 6:05 AM
Hello @DHOUT19
You need to check the Reference Manual or Memory Map section of the STM32N657 datasheet to find the base address and size of the full SRAM region.
Please follow these steps below:
Check the full SRAM memory address and size in the STM32N657 datasheet or reference manual.
Modify your linker script to increase the SRAM region size to 4.2MB and optionally create a dedicated section for your framebuffer.
MEMORY
{
/* Adjust these addresses and sizes based on your device's memory map */
SRAM (rw) : ORIGIN = 0x30000000, LENGTH = 0x00420000 /* 4.2MB SRAM */
/* Other memory regions */
}
SECTIONS
{
/* Place your framebuffer buffer in SRAM */
.framebuffer (NOLOAD) :
{
. = ALIGN(4);
_framebuffer_start = .;
KEEP(*(.framebuffer))
. = ALIGN(4);
_framebuffer_end = .;
} > SRAM
}
Declare your framebuffer in code with a section attribute to place it in the large SRAM region.
#define FRAMEBUFFER_SIZE (800 * 480 * 3)
__attribute__((section(".framebuffer")))
uint8_t framebuffer[FRAMEBUFFER_SIZE];
2025-07-31 10:48 AM
This pointed me in the right direction. Thanks.