Hi,
Some times ago I created an example using this pragma.
May be this can help you.
See description below and refer to the attached project.
Description:
Attached you will find an example explaining how to put specific variable in specific memory area.
This project has been create with the wizard.
I change the following:
1# /* 1. Define the section */
#pragma define_section mysection ".mysection.data" RW
2# /* 2. Add variables in this section*/
__declspec(mysection) int a[10] = {'0','1','2','3','4','5','6','7','8','9'};
__declspec(mysection) int b[10];
3# /* 3. Code using variables */
int i;
for (i=0;i<10;i++)
b[i]=a[i];
4# /* 4. in the lcf file we must create a new memory section */ MEMORY {
code (RX) : ORIGIN = 0x00000410, LENGTH = 0x0003FBF0
MY_RAM (RWX) : ORIGIN = 0x00800000, LENGTH = 0x00000100
userram (RWX) : ORIGIN = 0x00801000, LENGTH = 0x00007000
}
5# /* 5. add a new section using MY_RAM */
.my_section:
{
* (.mysection.data)
}>MY_RAM
Regards
Pascal