2023-01-24 05:30 AM
This MCU is having 3 RAM sections:
RAM : 640KB,
RAM2: 64KB,
RAM3: 384KB
I have modified my linker script(attached here) but don't know why the framebuffer is stored in RAM as well RAM3 section as per below snap?
Linker script: STM32L4R9AIIX_FLASH.zip
Following is the part of touchfgx generated code to store the framebuffer at the TouchGFX_Framebuffer location.
namespace
{
// Use the section "TouchGFX_Framebuffer" in the linker script to specify the placement of the buffer
LOCATION_PRAGMA_NOLOAD("TouchGFX_Framebuffer")
uint32_t frameBuf[(480 * 272 * 3 + 3) / 4] LOCATION_ATTRIBUTE_NOLOAD("TouchGFX_Framebuffer");
static volatile bool refreshRequested = false;
static uint16_t lcd_int_active_line;
static uint16_t lcd_int_porch_line;
}
Please help me to store the frame buffer in section RAM3 only as I want to use RAM/RAM2 for other operations.
Solved! Go to Solution.
2023-01-24 05:59 AM
Simple because RAM3 overlaps RAM.
2023-01-24 05:59 AM
Simple because RAM3 overlaps RAM.
2023-01-24 10:55 PM
Thank you @MM..1 for taking my attention towards the memory map of this MCU.
This MCU has a total of 640KB(RAM1:192, RAM2: 64, and RAM:384).
2023-10-07 05:34 AM
@Ashvin Ramani @MM..1 What are LOCATION_PRAGMA_NOLOAD and LOCATION_ATTRIBUTE_NOLOAD macros? Where do I find them?
2023-10-08 12:41 AM - edited 2023-10-08 12:45 AM
@Ashvin Ramani, @MM..1 Never mind, I have figured this out.
LOCATION_PRAGMA_NOLOAD and LOCATION_ATTRIBUTE_NOLOAD macros are TGFX defined like this:
#define STR(X) STR_I(X)
#define STR_I(X) #X
#define LOCATION_PRAGMA(name)
#define LOCATION_ATTRIBUTE(name) __attribute__((section(STR(name)))) __attribute__((aligned(4)))
The rest is well described in post How to solve this ( region `RAM' overflowed by 1168976 bytes ) error by @Martin KJELDSEN. Some more background can be found in post GNU Linker, can you NOT Initialize my Variable?