Skip to content

Commit fcaa60a

Browse files
anangltmon-nordic
authored andcommitted
[nrf fromtree] soc: nrf53: Warn if workaround for anomaly 160 cannot be applied
This is a follow-up to commit fe3b97a. Add a cmake warning issued when the workaround for the nRF5340 anomaly 160 cannot be applied because the application is configured with no system clock. Signed-off-by: Andrzej Głąbek <[email protected]> (cherry picked from commit 4e197b7)
1 parent f8c53c0 commit fcaa60a

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

soc/arm/nordic_nrf/nrf53/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,15 @@ zephyr_library_sources_ifdef(CONFIG_PM
1111
zephyr_library_sources_ifdef(CONFIG_NRF53_SYNC_RTC
1212
sync_rtc.c
1313
)
14+
15+
if (CONFIG_SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED AND
16+
NOT CONFIG_SYS_CLOCK_EXISTS)
17+
message(WARNING "
18+
Your application may be affected by the anomaly 160 that concerns the
19+
nRF5340 SoC. The related workaround cannot be applied, because your
20+
application has the system clock disabled (CONFIG_SYS_CLOCK_EXISTS=n).
21+
Consider enabling the system clock to apply the workaround.
22+
" "
23+
At your own risk, you can suppress this warning by setting
24+
CONFIG_SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED=n.")
25+
endif()

soc/arm/nordic_nrf/nrf53/Kconfig.soc

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ config SOC_NRF5340_CPUAPP
1313
config SOC_NRF5340_CPUNET
1414
bool
1515
select HAS_NO_PM
16-
imply SOC_NRF53_ANOMALY_160_WORKAROUND
16+
imply SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED
1717

1818
choice
1919
prompt "nRF53x MCU Selection"
@@ -28,6 +28,19 @@ config SOC_NRF5340_CPUNET_QKAA
2828

2929
endchoice
3030

31+
config SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED
32+
bool "Workaround for nRF5340 anomaly 160"
33+
imply SOC_NRF53_ANOMALY_160_WORKAROUND
34+
help
35+
Indicates that the workaround for the anomaly 160 that affects
36+
the nRF5340 SoC should be applied.
37+
This option is enabled by default for the Application MCU when
38+
DC/DC mode is enabled for the VREGMAIN or VREGRADIO regulator
39+
and always for the Network MCU.
40+
If this option is enabled, but the workaround cannot be applied,
41+
because the system clock is disabled, a related cmake warning is
42+
issued.
43+
3144
config SOC_NRF53_ANOMALY_160_WORKAROUND
3245
bool
3346
depends on SYS_CLOCK_EXISTS
@@ -37,13 +50,13 @@ if SOC_NRF5340_CPUAPP
3750

3851
config SOC_DCDC_NRF53X_APP
3952
bool
40-
imply SOC_NRF53_ANOMALY_160_WORKAROUND
53+
imply SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED
4154
help
4255
Enable nRF53 series System on Chip Application MCU DC/DC converter.
4356

4457
config SOC_DCDC_NRF53X_NET
4558
bool
46-
imply SOC_NRF53_ANOMALY_160_WORKAROUND
59+
imply SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED
4760
help
4861
Enable nRF53 series System on Chip Network MCU DC/DC converter.
4962

0 commit comments

Comments
 (0)