Skip to content

Commit

Permalink
[nrf fromtree] soc: nrf53: Warn if workaround for anomaly 160 cannot …
Browse files Browse the repository at this point in the history
…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)
  • Loading branch information
anangl authored and tmon-nordic committed Feb 24, 2023
1 parent f8c53c0 commit fcaa60a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
12 changes: 12 additions & 0 deletions soc/arm/nordic_nrf/nrf53/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,15 @@ zephyr_library_sources_ifdef(CONFIG_PM
zephyr_library_sources_ifdef(CONFIG_NRF53_SYNC_RTC
sync_rtc.c
)

if (CONFIG_SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED AND
NOT CONFIG_SYS_CLOCK_EXISTS)
message(WARNING "
Your application may be affected by the anomaly 160 that concerns the
nRF5340 SoC. The related workaround cannot be applied, because your
application has the system clock disabled (CONFIG_SYS_CLOCK_EXISTS=n).
Consider enabling the system clock to apply the workaround.
" "
At your own risk, you can suppress this warning by setting
CONFIG_SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED=n.")
endif()
19 changes: 16 additions & 3 deletions soc/arm/nordic_nrf/nrf53/Kconfig.soc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ config SOC_NRF5340_CPUAPP
config SOC_NRF5340_CPUNET
bool
select HAS_NO_PM
imply SOC_NRF53_ANOMALY_160_WORKAROUND
imply SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED

choice
prompt "nRF53x MCU Selection"
Expand All @@ -28,6 +28,19 @@ config SOC_NRF5340_CPUNET_QKAA

endchoice

config SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED
bool "Workaround for nRF5340 anomaly 160"
imply SOC_NRF53_ANOMALY_160_WORKAROUND
help
Indicates that the workaround for the anomaly 160 that affects
the nRF5340 SoC should be applied.
This option is enabled by default for the Application MCU when
DC/DC mode is enabled for the VREGMAIN or VREGRADIO regulator
and always for the Network MCU.
If this option is enabled, but the workaround cannot be applied,
because the system clock is disabled, a related cmake warning is
issued.

config SOC_NRF53_ANOMALY_160_WORKAROUND
bool
depends on SYS_CLOCK_EXISTS
Expand All @@ -37,13 +50,13 @@ if SOC_NRF5340_CPUAPP

config SOC_DCDC_NRF53X_APP
bool
imply SOC_NRF53_ANOMALY_160_WORKAROUND
imply SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED
help
Enable nRF53 series System on Chip Application MCU DC/DC converter.

config SOC_DCDC_NRF53X_NET
bool
imply SOC_NRF53_ANOMALY_160_WORKAROUND
imply SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED
help
Enable nRF53 series System on Chip Network MCU DC/DC converter.

Expand Down

0 comments on commit fcaa60a

Please sign in to comment.