Skip to content

Commit fa5937f

Browse files
committed
Add configuration of LF clk source in targer.json for targets MCU_NRF51 & MCU_NRF52
Fix typo
1 parent be46875 commit fa5937f

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

hal/targets.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,13 @@
11071107
},
11081108
"program_cycle_s": 6,
11091109
"default_build": "small",
1110-
"features": ["BLE"]
1110+
"features": ["BLE"],
1111+
"config":{
1112+
"lf_clock_src": {
1113+
"value": "NRF_LF_SRC_XTAL",
1114+
"macro_name": "MBED_CONF_NORDIC_NRF_LF_CLOCK_SRC"
1115+
}
1116+
}
11111117
},
11121118
"MCU_NRF51_16K_BASE": {
11131119
"inherits": ["MCU_NRF51"],
@@ -1721,7 +1727,13 @@
17211727
"toolchains": ["ARM_STD", "GCC_ARM"]
17221728
},
17231729
"MERGE_BOOTLOADER": false,
1724-
"features": ["BLE"]
1730+
"features": ["BLE"],
1731+
"config":{
1732+
"lf_clock_src": {
1733+
"value": "NRF_LF_SRC_XTAL",
1734+
"macro_name": "MBED_CONF_NORDIC_NRF_LF_CLOCK_SRC"
1735+
}
1736+
}
17251737
},
17261738
"NRF52_DK": {
17271739
"supported_form_factors": ["ARDUINO"],

hal/targets/cmsis/TARGET_NORDIC/TARGET_NRF5/nrf5x_lf_clk_helper.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838

3939
#ifndef __NRF5X_LF_CLK_HELPER_H_
4040

41-
#ifndef MBED_CONF_APP_NORDIC_NRF_LF_CLOCK_SRC
42-
#define MBED_CONF_APP_NORDIC_NRF_LF_CLOCK_SRC (NRF_LF_SRC_XTAL)
43-
#warning Non of LF clk src configurartion! Sett to LF Xtal.
41+
#ifndef MBED_CONF_NORDIC_NRF_LF_CLOCK_SRC
42+
#define MBED_CONF_NORDIC_NRF_LF_CLOCK_SRC (NRF_LF_SRC_XTAL)
43+
#warning No configuration for LF clock source. Xtal source will be used as a default configuration.
4444
#endif
4545

4646

@@ -49,11 +49,11 @@
4949
#define NRF_LF_SRC_SYNTH 3
5050
#define NRF_LF_SRC_RC 4
5151

52-
#if MBED_CONF_APP_NORDIC_NRF_LF_CLOCK_SRC == NRF_LF_SRC_SYNTH
52+
#if MBED_CONF_NORDIC_NRF_LF_CLOCK_SRC == NRF_LF_SRC_SYNTH
5353
#define CLOCK_LFCLKSRC_SRC_TO_USE (CLOCK_LFCLKSRC_SRC_Synth)
54-
#elif MBED_CONF_APP_NORDIC_NRF_LF_CLOCK_SRC == NRF_LF_SRC_XTAL
54+
#elif MBED_CONF_NORDIC_NRF_LF_CLOCK_SRC == NRF_LF_SRC_XTAL
5555
#define CLOCK_LFCLKSRC_SRC_TO_USE (CLOCK_LFCLKSRC_SRC_Xtal)
56-
#elif MBED_CONF_APP_NORDIC_NRF_LF_CLOCK_SRC == NRF_LF_SRC_RC
56+
#elif MBED_CONF_NORDIC_NRF_LF_CLOCK_SRC == NRF_LF_SRC_RC
5757
#define CLOCK_LFCLKSRC_SRC_TO_USE (CLOCK_LFCLKSRC_SRC_RC)
5858
#else
5959
#error Bad LFCLK configuration. Declare proper source through mbed configuration.

0 commit comments

Comments
 (0)