3.4.23 Rom Option

The -mrom=ranges option is used to change the default program memory that is specified for the target device. Without this option, all the on-chip program memory 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 on-chip, use:

-mrom=default,+100-2ff

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

-mrom=100-2ff

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

-mrom=default,-100-1ff

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

This option will adjust the memory ranges used by linker classes (see 6.1.1 A: Define Linker Class Option) . Any code or 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.

Note that some psects must be linked above a threshold address, most notably some psects that hold const-qualified data. Using this option to remove the upper memory ranges can make it impossible to place these psects.