How do I set top of memory?

If defined, the variable top_of_memory specifies the highest address in memory that the C library can use for stack space. By default, a semihosting call returns stack base. Base of heap is then set to follow on directly from the end of the image data region.

The default value of top_of_memory is 0x80000 for ARM processors. If you want to set this value manually, you can either change it for the current session using the Set Register… option from the Code window Debug menu, or you can set it permanently using connection properties.

To set top_of_memory for the session only:

1.   Select Memory Register Operationsimage\optarrow.gif Set Register… from the Code window Debug menu.

The Interactive Register Setting dialog is displayed.

2.   Set Register to @top_of_memory.

3.   Enter the required value.

4.   Click Set.

image\lamp.gifIf you are using RealView ARMulator ISS to simulate an ARM target, the default setting for top of memory is 0x80000. You cannot change this value.

To set the top of memory and stack heap values using connection properties:

1.   Open RealView Debugger without connecting to a target.

2.   Select Connection Properties… from the Code window Target menu to display the Connection Properties window.

3.   Expand the CONNECTION group for your target until you see the ARM_Config setting in the Advanced_Information block:

image\topmem2.gif

 

The right pane displays the settings for ARM_config.

4.   Right-click on Top memory to display the context menu.

5.   Select Edit Value.

6.   Enter the new value.

image\lamp.gifMake sure that you specify a value that is supported by your target.

7.  Select Save and Close from the File menu to save your settings.

Whenever you load a program compiled with the standard ARM C library to this target, the top of memory that you have set is used.

Related Topics