6.6. Setting top of memory and stack values

If defined, the top of memory variable 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 default settings that are target-dependent. For ARM architecture-based processors the default is 0x20000.

When you first connect to an ARM architecture-based debug target, RealView Debugger displays a warning message, in the Cmd tab:

Warning: No stack/heap or top of memory defined - using defaults.

To avoid this message, set permanent values for top of memory, stack base and limit, using the Connection Properties window. Configure your debug target and define these settings so that they are used whenever you connect with RealView Debugger.

You can set top of memory, and other ARM-specific runtime controls, as part of a project definition. However, the available options depend on your target processor and execution vehicle. See Appendix B Project Properties Reference for details on these entries in your project SETTINGS group.

You can also set top of memory, stack, and heap values on a temporary basis, that is for the current session, using the @top_of_memory register. To do this select Debug → Memory/Register Operations → Set Register... to display the Interactive Register Setting dialog box, where the register contents can be changed.

Copyright © 2003, 2004 ARM Limited. All rights reserved.ARM DUI 0234B