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];
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