About semihosting and top of memory

Semihosting is typically used when debugging an application that is using the C library and running without an operating system. This enables functions in the C library, such as printf() and scanf(), to use the screen and keyboard on the host workstation instead of having a screen and keyboard on the target system.

Semihosting uses stack base and heap base addresses to determine the location and size of the stack and heap.

The default stack base, also known as the top of memory, is 0x80000. A full, descending stack is the default, so this means that the highest addressed word available for use by the stack is 0x7FFFC.

The heap base is an offset address with a default value of 0x0. This places the heap contiguous to the application code.

The following figure shows a typical layout for an ARM® target.

Figure 17. Typical layout between top of memory, stack, and heap

To view this graphic, your browser must support the SVG format. Either install a browser with native support, or install an appropriate plugin such as Adobe SVG Viewer.


Show/hideSee also

Copyright © 2010 ARM. All rights reserved.ARM DUI 0446A
Non-ConfidentialID070310