Everything
8.5 Creating ROM Images

This section gives an outline of the creation of ROM images that are required for embedded applications.

 

External and static variables defined in applications are allocated to sections in RAM. If these variables have been initialized, their initial values must be present in RAM when the corresponding application is started.

On the other hand, values in RAM are undefined when the hardware is started up or following a reset. For this reason, the initial values of variables need to have been stored in RAM by the time an application is started after the hardware has been reset.

CC-RH allows the creation of a ROM image that defines how the program code and initial values are allocated to ROM. When the program is run, the initial values in the ROM image are copied to RAM within the startup routine. This initializes the RAM.

 

For details on the creation of ROM images and copying them to RAM, refer to (4), Initialization of RAM sections, in section 8.2.2, Initialization routines of user programs.

 

The following figure shows the copying of initial values from ROM to RAM.

Figure 8.1

Memory Maps before and after the Copying of Initial Values

 

Remarks

-

As well as the initial values of variables, you can copy program code that you wish to run from RAM.

-

When you are using an in-circuit emulator for debugging, for example, you can also download load modules directly to ROM or RAM and execute them from the given types of memory. In such cases, the copying of initial values is not necessary.