Tool/software:
Hello,
In our project we use MPU regions to isolate memory regions of the task from one another.
So far we realized this by using the #pragma SET_DATA_SECTION in every .c file. Later at the linker stage the entire section is assigned to RAM locations. Please find a example here
/* test.c file*/ #pragma SET_DATA_SECTION("test_section") uint8 testData; const uint8 testConstData; #pragma SET_DATA_SECTION() /* END test.c file*/ /*sys_link.cmd file */ MEMORY { RAM (RW) : origin=0x08002000 length=0x0003C000 } SECTIONS { test_section : START( StartAdrTestSection ) {} > RAM palign( 0x20 ) } /*End sys_link.cmd file */
With this approach the const data and ram data goes to the same RAM memory regions.
Could you please propose a solution where in the linker file I could extract the ram and const data from the section identifier test_section.
Alternate approach:
I tried the solution of manually doing individual file but without success, I have the following message from linker
warning: no matching section/* sys_link.cmd file */
testData : {
test*(.data)
} > RAM
I'm not very sure how to get the start address and size of the region even if the alternate approach works. Does the commands START and SIZE work with this approach?
Thanks in advance.