Skip to content

Commit ad0dd41

Browse files
ananglcarlescufi
authored andcommitted
[nrf fromlist] soc: nrf53: Fix configuration of HFXO capacitance
This is a follow-up to commit 60d9988. Add a third option for the HFXO capacitance that keeps the default value of the XOSC32MCAPS register untouched. The message in the above commit incorrectly claimed that external load capacitors for HFXO (the reset value of the XOSC32MCAPS register) was the configuration in effect before. In fact, the register value was modified during the device trimming in the SystemInit() function to use the internal capacitors, and that is the configuration required for proper RADIO operation on nRF5340 DK, for instance. Upstream PR: zephyrproject-rtos/zephyr#36320 Signed-off-by: Andrzej Głąbek <[email protected]>
1 parent d94780b commit ad0dd41

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

soc/arm/nordic_nrf/nrf53/Kconfig.soc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,16 @@ endchoice
165165

166166
choice SOC_HFXO_LOAD_CAPACITANCE
167167
prompt "HFXO load capacitance"
168-
default SOC_HFXO_CAP_EXTERNAL
168+
default SOC_HFXO_CAP_DEFAULT
169+
170+
config SOC_HFXO_CAP_DEFAULT
171+
bool "SoC default"
172+
help
173+
When this option is used, the SoC initialization routine does not
174+
touch the XOSC32MCAPS register value, so the default setting for
175+
the SoC is in effect. Please note that this may not necessarily be
176+
the reset value (0) for the register, as the register can be set
177+
during the device trimming in the SystemInit() function.
169178

170179
config SOC_HFXO_CAP_EXTERNAL
171180
bool "Use external load capacitors"

soc/arm/nordic_nrf/nrf53/soc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static int nordicsemi_nrf53_init(const struct device *arg)
9696
+ ((offset - 8) << 4) + 32) >> 6;
9797

9898
nrf_oscillators_hfxo_cap_set(NRF_OSCILLATORS, true, capvalue);
99-
#else
99+
#elif defined(CONFIG_SOC_HFXO_CAP_EXTERNAL)
100100
nrf_oscillators_hfxo_cap_set(NRF_OSCILLATORS, false, 0);
101101
#endif
102102
#endif /* defined(CONFIG_SOC_NRF5340_CPUAPP) && ... */

0 commit comments

Comments
 (0)