mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Thu Jan 09 09:00:05 2014 +0000
Parent:
70:c1fbde68b492
Child:
72:248c61396e08
Commit message:
Synchronized with git revision fa9f5da46934cff09860c5112938b8bc976a340d

Full URL: https://github.com/mbedmicro/mbed/commit/fa9f5da46934cff09860c5112938b8bc976a340d/

[LPC4088] RAM size fix for ARM_GCC. Added possibility to reserve stack space

Changed in this revision

targets/cmsis/TARGET_NXP/TARGET_LPC408X/TOOLCHAIN_ARM_STD/sys.cpp Show annotated file Show diff for this revision Revisions of this file
targets/cmsis/TARGET_NXP/TARGET_LPC408X/TOOLCHAIN_ARM_STD/sys_helper.cpp Show annotated file Show diff for this revision Revisions of this file
targets/cmsis/TARGET_NXP/TARGET_LPC408X/TOOLCHAIN_ARM_STD/sys_helper.h Show annotated file Show diff for this revision Revisions of this file
targets/cmsis/TARGET_NXP/TARGET_LPC408X/TOOLCHAIN_GCC_ARM/LPC4088.ld Show annotated file Show diff for this revision Revisions of this file
--- a/targets/cmsis/TARGET_NXP/TARGET_LPC408X/TOOLCHAIN_ARM_STD/sys.cpp	Tue Jan 07 11:00:05 2014 +0000
+++ b/targets/cmsis/TARGET_NXP/TARGET_LPC408X/TOOLCHAIN_ARM_STD/sys.cpp	Thu Jan 09 09:00:05 2014 +0000
@@ -11,6 +11,7 @@
 
 #include <rt_misc.h>
 #include <stdint.h>
+#include "sys_helper.h"
 
 extern char Image$$RW_IRAM1$$ZI$$Limit[];
 
@@ -22,7 +23,7 @@
 
     struct __initial_stackheap r;
     r.heap_base = zi_limit;
-    r.heap_limit = sp_limit;
+    r.heap_limit = sp_limit - __reserved_stack_size();
     return r;
 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/targets/cmsis/TARGET_NXP/TARGET_LPC408X/TOOLCHAIN_ARM_STD/sys_helper.cpp	Thu Jan 09 09:00:05 2014 +0000
@@ -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
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/targets/cmsis/TARGET_NXP/TARGET_LPC408X/TOOLCHAIN_ARM_STD/sys_helper.h	Thu Jan 09 09:00:05 2014 +0000
@@ -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
--- a/targets/cmsis/TARGET_NXP/TARGET_LPC408X/TOOLCHAIN_GCC_ARM/LPC4088.ld	Tue Jan 07 11:00:05 2014 +0000
+++ b/targets/cmsis/TARGET_NXP/TARGET_LPC408X/TOOLCHAIN_GCC_ARM/LPC4088.ld	Thu Jan 09 09:00:05 2014 +0000
@@ -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