Skip to content

Commit 59c8ac8

Browse files
committed
Support bare-metal build for NXP LPC1114
1 parent 532654e commit 59c8ac8

File tree

3 files changed

+23
-33
lines changed

3 files changed

+23
-33
lines changed

targets/TARGET_NXP/TARGET_LPC11XX_11CXX/device/TOOLCHAIN_GCC_ARM/startup_LPC11xx.S

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -44,36 +44,7 @@
4444
aborting compilation, it is not the run time limit:
4545
Heap_Size + Stack_Size = 0x80 + 0x80 = 0x100
4646
*/
47-
.section .stack
48-
.align 3
49-
#ifdef __STACK_SIZE
50-
.equ Stack_Size, __STACK_SIZE
51-
#else
52-
.equ Stack_Size, 0x80
53-
#endif
54-
.globl __StackTop
55-
.globl __StackLimit
56-
__StackLimit:
57-
.space Stack_Size
58-
.size __StackLimit, . - __StackLimit
59-
__StackTop:
60-
.size __StackTop, . - __StackTop
6147

62-
.section .heap
63-
.align 3
64-
#ifdef __HEAP_SIZE
65-
.equ Heap_Size, __HEAP_SIZE
66-
#else
67-
.equ Heap_Size, 0x80
68-
#endif
69-
.globl __HeapBase
70-
.globl __HeapLimit
71-
__HeapBase:
72-
.space Heap_Size
73-
.size __HeapBase, . - __HeapBase
74-
__HeapLimit:
75-
.size __HeapLimit, . - __HeapLimit
76-
7748
.section .isr_vector
7849
.align 2
7950
.globl __isr_vector

targets/TARGET_NXP/TARGET_LPC11XX_11CXX/device/cmsis_nvic.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) {
6060
static volatile uint32_t* vectors = (uint32_t*)NVIC_RAM_VECTOR_ADDRESS;
6161

6262
// Copy and switch to dynamic vectors if first time called
63-
if((LPC_SYSCON->SYSMEMREMAP & 0x3) != 0x1) {
64-
uint32_t *old_vectors = (uint32_t *)0; // FLASH vectors are at 0x0
63+
if((LPC_SYSCON->SYSMEMREMAP & 0x3) != 0x1) {
64+
// Add volatile qualifier to avoid armclang aggressive optimization
65+
volatile uint32_t *old_vectors = (uint32_t *)0; // FLASH vectors are at 0x0
6566
for(i = 0; i < NVIC_NUM_VECTORS; i++) {
6667
vectors[i] = old_vectors[i];
6768
}

targets/targets.json

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,27 @@
334334
"SLEEP",
335335
"SPI",
336336
"SPISLAVE",
337-
"STDIO_MESSAGES"
337+
"STDIO_MESSAGES",
338+
"USTICKER"
338339
],
339-
"default_lib": "small",
340+
"overrides": {
341+
"tickless-from-us-ticker": true,
342+
"boot-stack-size": "0x400"
343+
},
344+
"supported_c_libs": {
345+
"arm": [
346+
"std",
347+
"small"
348+
],
349+
"gcc_arm": [
350+
"std",
351+
"small"
352+
],
353+
"iar": [
354+
"std"
355+
]
356+
},
357+
"c_lib": "small",
340358
"release_versions": [
341359
"2"
342360
],

0 commit comments

Comments
 (0)