3.4.21 Ram Option

The -mram=ranges option is used to adjust the data memory that is specified for the target device. Without this option, all the on-chip RAM implemented by the device is available, thus this option only needs be used if there are special memory requirements. Specifying additional memory that is not in the target device might result in a successful compilation, but can lead to code failures at runtime.

For example, to specify an additional range of memory to that already present on-chip, use:

-mram=default,+100-1ff

This will add the range from 100h to 1ffh to the on-chip memory. To only use an external range and ignore any on-chip memory, use:

-mram=0-ff

This option can also be used to reserve memory ranges already defined as on-chip memory in the relevant chipinfo file. To do this, supply a range prefixed with a minus character, -, for example:

-mram=default,-100-103

will use all the defined on-chip memory, but not use the addresses in the range from 100h to 103h for allocation of RAM objects.

This option will adjust the memory ranges used by linker classes (see 6.1.1 A: Define Linker Class Option). Any objects contained in a psect that do not use the classes affected by this option might be linked outside the valid memory specified by this option.