How do I set top of memory and stack heap values?

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.

You can create your own settings to specify the bottom of the stack address, the size of the stack, the bottom of the heap address, and the size of the heap. If you do not set these values manually, RealView Debugger uses target-dependant defaults.

The default value of top_of_memory is 0x20000 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.   Click Stack_Heap in the left pane to display values in the right pane:

image\stackval.gif

8.   Right-click on any value that you want to change and select Edit Value from the context menu.

9.   Enter the new value.

10.  When you have entered all your new values, 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, stack and heap values that you have set are used for that target.

Related Topics