This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

IWRL6432: Help with Memory Allocation Discrepancies for L3 Static Arrays

Part Number: IWRL6432


Dear TI,

I'm encountering an issue while attempting to declare a static array on L3 at compile time, and I've noticed some unexpected behavior concerning the image size. In theory, I would expect the image size to remain constant regardless of whether I'm using a C-style array or an std::array.

Here's a breakdown of what I'm trying to achieve:


C style:  static uint8_t sL3MemoryBuffer[sL3Size_B] __attribute((section(".l3")));
std array: static std::array<uint8_t, sL3Size_B> sL3MemoryBuffer __attribute((section(".l3")))


Where sL3Size_B = 0x40000 + 160 * 1024. However, I'm encountering discrepancies in memory allocation as illustrated in the table below:

Array Image size (Bytes) Init Length in memory map Section allocation map input section 

C style

251,524 00000000 UNINITIALIZED

std::array

677,508 00068000 blank

I would greatly appreciate any insights or suggestions regarding why this discrepancy is occurring. Below, I've listed the compiler flags that I'm currently using:

tiarmclang.exe -c -mcpu=cortex-m4 -mfloat-abi=hard -mlittle-endian -mthumb -Wall -mno-unaligned-access -g3 -std=c++17 -fno-unwind-tables -fno-exceptions -fno-rtti -DSOC_XWRL64XX

I am presently unable to retrieve the linker flag output due to encountering difficulties with the verbosity flag. Please advise if you require this information, and I will make further attempts to resolve the issue.