Hello,
I'd like to assign the variable to a speicified RAM location, for example, there is a variable Var which I'd like to assign to the address 0xB000, is there any way it can be achieved?
In the help document, I only find something like user-defined section, but it seems that it can only be used for a C file, but I'd like to used something inside a C file and only affect one variable? I am using C166 compiler.
Thank, Simon
If you have critical variables that should survive a reboot, then a simple method is to modify your project and reduce the size of RAM.
Then you can define a struct with all the variables that should survive a reset. Set such a struct pointer to this memory area and access the relevant fields, after having checked a CRC of the struct to figure out if the content is valid.
... under Absolute Memory Access:
http://www.keil.com/support/man/docs/c166/c166_ap_linkerloc.htm