The ARM C library provides multiple implementations of the
function __user_setup_stackheap(), and can
select the correct one for you automatically from information given
in a scatter file.
To select the two region memory model, define two special
execution regions in your scatter file named ARM_LIB_HEAP and ARM_LIB_STACK.
Both regions have the EMPTY attribute. This causes
the library to select the non-default implementation of __user_setup_stackheap() that
uses the value of the symbols:
Image$$ARM_LIB_STACK$$Base
Image$$ARM_LIB_STACK$$ZI$$Limit
Image$$ARM_LIB_HEAP$$Base
Image$$ARM_LIB_HEAP$$ZI$$Limit
Only one ARM_LIB_STACK or ARM_LIB_HEAP region
can be specified, and you must allocate a size, for example:
LOAD_FLASH ...
{
...
ARM_LIB_STACK 0x40000 EMPTY -0x20000 ; Stack region growing down
{ }
ARM_LIB_HEAP 0x28000000 EMPTY 0x80000 ; Heap region growing up
{ }
...
}
You can use a combined stack and heap region by defining a
single execution region named ARM_LIB_STACKHEAP,
with the EMPTY attribute. This causes __user_setup_stackheap() to
use the value of the symbols Image$$ARM_LIB_STACKHEAP$$Base and Image$$ARM_LIB_STACKHEAP$$ZI$$Limit.
Note
If you re-implement __user_setup_stackheap(),
this overrides all library implementations.
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.