Dear diego_charles,
Thank you for your response. I took your project and tried to make changes in my one to fit your configurations.
For me it did not work exactly as I expected. Here is explanation:
I am trying to utilize the most of internal RAM memory of RT1172, so I defined 2 buffers in 2 different areas of memory:
__attribute__((section(".OCRAM1_Section"))) __attribute__((aligned(4U))) uint32_t image_data1[100][100] = {5,5,5};
__attribute__((section(".OCRAM2_Section"))) __attribute__((aligned(4U))) uint32_t image_data2[100][100] = {7,7,7};
*(.OCRAM1_Section) and *(.OCRAM2_Section) similarly as your MySection. See attached picture (1).
But I realized that my buffers are taking both areas in memory:
Memory region Used Size Region Size %age Used
SRAM_DTC_cm7: 116288 B 248 KB 45.79%
SRAM_ITC_cm7: 0 GB 256 KB 0.00%
BOARD_SDRAM: 0 GB 16 MB 0.00%
NCACHE_REGION: 0 GB 16 MB 0.00%
SRAM_OC1: 40000 B 512 KB 7.63%
SRAM_OC2: 40000 B 512 KB 7.63%
SRAM_OC_ECC1: 0 GB 64 KB 0.00%
SRAM_OC_ECC2: 0 GB 64 KB 0.00%
But when I redefined them as .bss they took the memory only once:
SRAM_DTC_cm7: 36288 B 248 KB 14.29%
SRAM_ITC_cm7: 0 GB 256 KB 0.00%
BOARD_SDRAM: 0 GB 16 MB 0.00%
NCACHE_REGION: 0 GB 16 MB 0.00%
SRAM_OC1: 40000 B 512 KB 7.63%
SRAM_OC2: 40000 B 512 KB 7.63%
SRAM_OC_ECC1: 0 GB 64 KB 0.00%
SRAM_OC_ECC2: 0 GB 64 KB 0.00%
SRAM_OC_cm7: 0 GB 128 KB 0.00%
SRAM_OC_cm7: 0 GB 128 KB 0.00%
I do need to initialize the buffers in my software with non zero values (it should be some RGB pictures), so I think it should be defined as .data section and not as .bss. But I tried to compile it as .bss and it pass the compilation.
Then I did the next (and it worked for me):
Disabled Manage linker script in project properties (picture 2).
Opened the link file and manually changed the lines:
> SRAM_OC1 AT>SRAM_DTC_cm7
> SRAM_OC2 AT>SRAM_DTC_cm7
to
> SRAM_OC1
> SRAM_OC2
Compiled again and got my memory back:
Memory region Used Size Region Size %age Used
SRAM_DTC_cm7: 36288 B 248 KB 14.29%
SRAM_ITC_cm7: 0 GB 256 KB 0.00%
BOARD_SDRAM: 0 GB 16 MB 0.00%
NCACHE_REGION: 0 GB 16 MB 0.00%
SRAM_OC1: 40000 B 512 KB 7.63%
SRAM_OC2: 40000 B 512 KB 7.63%
SRAM_OC_ECC1: 0 GB 64 KB 0.00%
SRAM_OC_ECC2: 0 GB 64 KB 0.00%
SRAM_OC_cm7: 0 GB 128 KB 0.00%
Can you please explain it why we have it in linker
the lines like this:
> SRAM_OC1 AT>SRAM_DTC_cm7
> SRAM_OC2 AT>SRAM_DTC_cm7
Do we actually need it? And what are consequences of such a change?
One more question I have:
In datasheet stated RT1172 has 2MByte of RAM memory.
But I cannot detect all of it. What I found is
512 KB in FlexRAM (divided somehow to DTC,ITC,OCRAM)
512 KB in OCRAM1
512 KB in OCRAM2
128 KB in OCRAM1 ECC / OCRAM2 ECC
So, I still miss 384 KB of RAM.
Can you please point me where it is located and how do I reach it?
Best regards,
Andrei