Skip to content

Commit 7a4f589

Browse files
Use correct section for Nanostack heap on LPC1768
1 parent d137e8b commit 7a4f589

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

connectivity/nanostack/mbed-mesh-api/mbed_lib.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@
241241
"target_overrides": {
242242
"KW41Z": {
243243
"mbed-mesh-api.heap-size": 14000
244+
},
245+
"LPC1768": {
246+
"mbed-mesh-api.heap-size": 16383
244247
}
245248
}
246249
}

connectivity/nanostack/mbed-mesh-api/source/mesh_system.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,19 @@
3232
#include "ns_trace.h"
3333
#define TRACE_GROUP "m6-mesh-system"
3434

35+
/* For LPC boards define the heap memory bank ourselves to give us section placement
36+
control */
37+
#ifndef ETHMEM_SECTION
38+
# if defined(TARGET_LPC1768)
39+
# define ETHMEM_SECTION __attribute__((section("AHBSRAM0"),aligned))
40+
# else
41+
# define ETHMEM_SECTION
42+
# endif
43+
#endif
44+
3545
/* Heap for NanoStack */
3646
#if !MBED_CONF_MBED_MESH_API_USE_MALLOC_FOR_HEAP
37-
static uint8_t app_stack_heap[MBED_CONF_MBED_MESH_API_HEAP_SIZE + 1];
47+
ETHMEM_SECTION uint8_t app_stack_heap[MBED_CONF_MBED_MESH_API_HEAP_SIZE + 1];
3848
#else
3949
static uint8_t *app_stack_heap;
4050
#endif

0 commit comments

Comments
 (0)