Merge pull request #141 from arebert/lpc4088

[LPC4088] RAM size fix for ARM_GCC. Added possibility to reserve stack space
pull/142/head
Bogdan Marinescu 2014-01-09 00:59:43 -08:00
commit fa9f5da469
5 changed files with 39 additions and 3 deletions

View File

@ -11,6 +11,7 @@ extern "C" {
#include <rt_misc.h>
#include <stdint.h>
#include "sys_helper.h"
extern char Image$$RW_IRAM1$$ZI$$Limit[];
@ -22,7 +23,7 @@ extern __value_in_regs struct __initial_stackheap __user_setup_stackheap(uint32_
struct __initial_stackheap r;
r.heap_base = zi_limit;
r.heap_limit = sp_limit;
r.heap_limit = sp_limit - __reserved_stack_size();
return r;
}

View File

@ -0,0 +1,19 @@
/* mbed Microcontroller Library - stackheap
* Copyright (C) 2009-2011 ARM Limited. All rights reserved.
*
*/
#include "sys_helper.h"
/* This function specifies the amount of memory of the internal RAM to
reserve for the stack. The default implementation will reserve 0 bytes
which gives the normal behaviour where the stack and heap share all the
internal RAM.
You can override this function in your code to reserve a number of bytes
for the stack.
*/
extern "C" __attribute__((weak)) uint32_t __reserved_stack_size();
extern "C" __attribute__((weak)) uint32_t __reserved_stack_size() {
return 0; // return 0 to indicate that nothing is reserved
}

View File

@ -0,0 +1,16 @@
#ifndef SYS_HELPER_H
#define SYS_HELPER_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
uint32_t __reserved_stack_size();
#ifdef __cplusplus
}
#endif
#endif

View File

@ -4,7 +4,7 @@
MEMORY
{
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 512K
RAM (rwx) : ORIGIN = 0x100000E8, LENGTH = (32K - 0xE8)
RAM (rwx) : ORIGIN = 0x100000E8, LENGTH = (64K - 0xE8)
USB_RAM(rwx) : ORIGIN = 0x20000000, LENGTH = 16K
ETH_RAM(rwx) : ORIGIN = 0x20004000, LENGTH = 16K

View File

@ -21,7 +21,7 @@
</DaveTm>
<Target>
<TargetName>mbed NXP LPC1768</TargetName>
<TargetName>mbed NXP LPC4088</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<TargetOption>