This directive may not be specified on the command line.
Description
The USERCLASS directive assigns a user-defined class name
(user-classname) to a compiler-generated segment
(MSpace). By default, the CARM Compiler uses the following
basic class names for segment definitions.
MSpace
Description
CODE
Program code.
CONST
Variables defined with the const
keyword.
DATA
Variables.
ERAM
Program code defined with the __ram
keyword.
To re-assign an MSpace to the default class, use the
USERCLASS directive to assign the MSpace to the
default class. For example:
#pragma userclass (DATA = default)
A user_classname may be referenced by the LARM Linker and
used to locate all segments within that class to a specific memory
section. In µVision, you may enter address ranges for user-defined
classes under Options—LA Locate—User classes.
Example
#pragma userclass (DATA = NVRAM)
// the following variables are stored in the DATA_NVRAM class
int x1[10];
int x2[10];
#pragma userclass (DATA = default)
// the following variables are stored in the default class DATA
int y1[10];
int y2[10];
#pragma userclass (CODE = APP)
// the following function is stored in the CODE_APP class
void func (void) {
...
}
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.