Compartilhar via


ROMOFFSET (Compact 2013)

3/26/2014

This configuration option, which is optional, modifies binary (.bin) file Record Addresses to fix up a run-time image for one address, but to have the run-time image be located at a different address, which is useful if you want your run-time image to run in RAM, but you want to store the run-time image in ROM or flash memory.

Syntax

ROMOFFSET = address

Parameters

  • address
    The hexadecimal address. This value is added to the Record Address of every record in the .bin file.

Example

In the following example, the associated run-time image is fixed up to run from RAM, but the run-time image itself is stored in flash. To accomplish this, ROMOFFSET is used to change the values of the Record Address fields to flash addresses. This ensures that the boot loader writes the run-time image to flash memory, since the boot loader uses the Record Address fields to determine where to write the run-time image.

MEMORY
   NK       80240000  009C0000  RAMIMAGE
   RAM      80C00000  03000000  RAM
    
CONFIG
   
    ;
    ; ROMOFFSET must be large enough so that when it is added to the base address
    ; of NK the result wraps around to 0x00100000 (assuming your flash is mapped at
    ; 0x00000000, the CPU fetches code from 0x00000000 after reset, and you have a
    ; boot loader that occupies 0x00000000 to 0x000FFFFF).  
    ;
    ; NK         +  ROMOFFSET   = (address to write .bin image to)
    ;
    ; 0x80240000 +  0x7FEC0000  = 0x00100000 (download to flash)
    ;
    ; In other words, the run-time address will execute in RAM at 0x80240000, but the 
    ; modified .bin Record Address fields will cause the image to be written to flash. 
    ; Eboot must copy the image from flash to RAM at reset.
    ;

   ROMOFFSET=7FEC0000

Remarks

When ROMOFFSET is set, by default, each Record Address is offset by the specified amount from the fixup address that RAMIMAGE specifies. The boot loader writes each .bin file record at the address specified by its Record Address.

Note

This configuration option does not affect absolute binary data format files.

Boot loaders that are stored in ROM or flash memory but copy themselves to RAM before startup can also use this configuration option.

See Also

Reference

CONFIG Section
Binary Image Builder (.bib) File