Skip to content

Commit bb028ba

Browse files
authored
Merge pull request #12134 from toyowata/lpc11u35_fix
Fix LPC11U35_401 baremetal build
2 parents 5cedd33 + f9242d0 commit bb028ba

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

targets/TARGET_NXP/TARGET_LPC11UXX/device/cmsis_nvic.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) {
6060

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

targets/TARGET_NXP/TARGET_LPC11UXX/us_ticker.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include "us_ticker_api.h"
1818
#include "PeripheralNames.h"
1919

20+
#if DEVICE_USTICKER
21+
2022
#define US_TICKER_TIMER ((LPC_CTxxBx_Type *)LPC_CT32B1_BASE)
2123
#define US_TICKER_TIMER_IRQn TIMER_32_1_IRQn
2224

@@ -70,3 +72,5 @@ void us_ticker_free(void)
7072
{
7173

7274
}
75+
76+
#endif // DEVICE_USTICKER

targets/targets.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,13 @@
374374
"SERIAL",
375375
"SLEEP",
376376
"SPI",
377-
"SPISLAVE"
377+
"SPISLAVE",
378+
"USTICKER"
378379
],
380+
"overrides": {
381+
"tickless-from-us-ticker" : true,
382+
"boot-stack-size" : "0x400"
383+
},
379384
"default_lib": "small",
380385
"release_versions": ["2"],
381386
"device_name": "LPC11U35FBD48/401"

0 commit comments

Comments
 (0)