Skip to content

Commit 6175b61

Browse files
committed
M487: Make SPIM CCM mode configurable
This is to support custom targets based on M480 series chips.
1 parent 2a7c79b commit 6175b61

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

targets/TARGET_NUVOTON/TARGET_M480/device/system_M480.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ void SystemInit (void)
7676
/* Disable Flash Access Cycle Auto-tuning, set access cycle for CPU @ 192MHz */
7777
FMC->CYCCTL = FMC_CYCCTL_FADIS_Msk | (8 << FMC_CYCCTL_CYCLE_Pos);
7878

79+
#if MBED_CONF_TARGET_SPIM_CCM_ENABLE
7980
// Divert SRAM bank2 (32 KB) to CCM from SPIM cache
8081
// NOTE: C-runtime not initialized yet. Ensure no static memory (global variable) are accessed in function below.
8182
// NOTE: SPIM must keep enabled to run CCM mode.
@@ -84,5 +85,6 @@ void SystemInit (void)
8485
SPIM_DISABLE_CACHE();
8586
SPIM_ENABLE_CCM();
8687
while (! SPIM_IS_CCM_EN());
88+
#endif
8789
}
8890
/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/

targets/targets.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12762,6 +12762,10 @@
1276212762
"IAR"
1276312763
],
1276412764
"config": {
12765+
"spim-ccm-enable": {
12766+
"help": "Enable SPIM CCM mode to spare 32KiB SRAM for normal use",
12767+
"value": 0
12768+
},
1276512769
"gpio-irq-debounce-enable": {
1276612770
"help": "Enable GPIO IRQ debounce",
1276712771
"value": 0
@@ -12840,7 +12844,10 @@
1284012844
"device_name": "M487JIDAE",
1284112845
"detect_code": [
1284212846
"1304"
12843-
]
12847+
],
12848+
"overrides": {
12849+
"spim-ccm-enable": 1
12850+
}
1284412851
},
1284512852
"NUMAKER_IOT_M487": {
1284612853
"inherits": [
@@ -12852,7 +12859,10 @@
1285212859
"device_name": "M487JIDAE",
1285312860
"detect_code": [
1285412861
"1308"
12855-
]
12862+
],
12863+
"overrides": {
12864+
"spim-ccm-enable": 1
12865+
}
1285612866
},
1285712867
"TMPM066": {
1285812868
"inherits": [

0 commit comments

Comments
 (0)