- Home
- :
- General Purpose Microcontrollers
- :
- LPC Microcontrollers
- :
- how configure keil for use from external sram as d...

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

how configure keil for use from external sram as default heap location

06-15-2016
10:59 AM

378 Views

lpcware

NXP Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Hi to all

I am beginner in embedded systems so I need your helps.

Recently I was working on a training project and on it I use from lpc1788 with 2mb * 16bit external ram,i successfully use from external memory as buffer of LCD controller, but i can not configure my compiler to use from it as default heap location(my compiler is keil v5),

Now any one can give me a guide that how can i configure keil for use from external memory as default heap location.

Excuse me for my bad English.

Thanks for your attention.

1 Reply

06-15-2016
10:59 AM

19 Views

lpcware

NXP Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Defining __initial_sp, __heap_base and __heap_limit

Home » The ARM C and C++ libraries » Defining __initial_sp, __heap_base and __heap_limi

One of several methods you can use to specify the initial stack pointer and heap bounds is to define the following symbols:

•__initial_sp

•__heap_base

•__heap_limit.

You can define these symbols in an assembly language file, or by using the embedded assembler in C.

For example:

__asm void dummy_function(void)

{

EXPORT __initial_sp

EXPORT __heap_base

EXPORT __heap_limit

__initial_sp EQU STACK_BASE

__heap_base EQU HEAP_BASE

__heap_limit EQU (HEAP_BASE + HEAP_SIZE)

}

The constants STACK_BASE, HEAP_BASE and HEAP_SIZE can be defined in a header file, for example stack.h, as follows:

/* stack.h */

#define HEAP_BASE 0x20100000 /* Example memory addresses */

#define STACK_BASE 0x20200000

#define HEAP_SIZE ((STACK_BASE-HEAP_BASE)/2)

#define STACK_SIZE ((STACK_BASE-HEAP_BASE)/2)

Note

This method of specifying the initial stack pointer and heap bounds is supported by both the standard C library (standardlib) and the micro C library (microlib).