Hello
I built several RAM arias in the project.
Please help me with CW C commands that will enable locating variables in a specific RAM zone.
(like SECTION in CW assembly).
TIA Benny
Solved! Go to Solution.
In CW help, search for "@address".
From help menu:
Global Variable Address Modifier (@address)
Use the global variable address modifier to assign global variables to specific addresses.....
int glob @0x0500 = 10; // global variable "glob" is at 0x0500, initialized with 10
There are many other ways to use this modifier. Look there.
Hope it helps.
Have a look in the Linker Command File documentation.
You can tell the Linker to Place a symbol in a specific section, and address in your ".lcf"
This is how we place our software version at a known location.
___SOFTWARE_REVISION = 1;
WRITEW(0x05000000 + ___SOFTWARE_REVISION);
You could substitute the symbol for your array. But be carfull with the size of the array and the section it is in.
Thanks James, I'll have to check the lcf options. Do you have mapping sample in lcf?
In CW help, search for "@address".
From help menu:
Global Variable Address Modifier (@address)
Use the global variable address modifier to assign global variables to specific addresses.....
int glob @0x0500 = 10; // global variable "glob" is at 0x0500, initialized with 10
There are many other ways to use this modifier. Look there.
Hope it helps.
Thanks Tiago. I am trying it.