2.4.6. Placing the stack and heap

Scatter-loading provides a method for specifying the placement of code and statically allocated data in your image. This section covers how to place the application stack and heap.

The application stack and heap are set up during C library initialization. You can tailor stack and heap placement by re-implementing the routine responsible for stack and heap setup. In the ARM C library, this routine is __user_initial_stackheap().

Figure 2.9 shows the C library initialization process with a re-implemented __user_initial_stackheap().

Figure 2.9. Retargeting __user_initial_stackheap()

__user_initial_stackheap() can be coded in C or ARM assembler. It must return the following parameters:

You must re-implement __user_initial_stackheap() if you are scatter-loading your image. Otherwise, the linker generates the following error:


Error: L6218E: Undefined symbol Image$$ZI$$Limit (referred from sys_stackheap.o)

Copyright © 2002-2006 ARM Limited. All rights reserved.ARM DUI 0203G
Non-Confidential