Skip to content

Commit 1e06ba2

Browse files
Jordan Yatescarlescufi
authored andcommitted
soc: arm: nordic: handle nRF52832 anomaly 109
Enable workaround for anomaly 109 by default when affected peripherals are enabled. Signed-off-by: Jordan Yates <[email protected]>
1 parent 387f3c2 commit 1e06ba2

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

modules/hal_nordic/nrfx/nrfx_config.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,13 @@
487487
#define NRFX_WDT1_ENABLED 1
488488
#endif
489489

490+
#ifdef CONFIG_NRF52_ANOMALY_109_WORKAROUND
491+
#define NRFX_SPIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1
492+
#define NRFX_SPIS_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1
493+
#define NRFX_TWIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1
494+
#define NRFX_PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1
495+
#endif
496+
490497
#if defined(CONFIG_SOC_SERIES_BSIM_NRFXX)
491498
#include "nrfx_config_bsim.h"
492499
#endif

soc/arm/nordic_nrf/nrf52/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,11 @@ zephyr_library_include_directories(
1414
if(CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 AND CONFIG_SPI_NRFX_SPIM)
1515
message(WARNING "Both SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 and an NRF SPIM driver are enabled, therefore PAN 58 will apply if RXD.MAXCNT == 1 and TXD.MAXCNT <= 1")
1616
endif()
17+
18+
if(CONFIG_SOC_NRF52832)
19+
if(NOT CONFIG_NRF52_ANOMALY_109_WORKAROUND)
20+
if (CONFIG_NRFX_SPIS OR CONFIG_NRFX_SPIM OR CONFIG_NRFX_TWIM OR CONFIG_NRFX_PWM)
21+
message(WARNING "NRF52_ANOMALY_109_WORKAROUND disabled with SPIS, SPIM, TWIM or PWM enabled. This will occasionally cause the first byte transmitted to be incorrect")
22+
endif()
23+
endif()
24+
endif()

soc/arm/nordic_nrf/nrf52/Kconfig.soc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,15 @@ config NRF52_ANOMALY_198_WORKAROUND
129129
This anomaly applies to IC revisions "Engineering B" up to "3", the most
130130
recent one.
131131

132+
config NRF52_ANOMALY_109_WORKAROUND
133+
bool "Anomaly 109 workaround"
134+
default y
135+
depends on SOC_NRF52832
136+
depends on NRFX_SPIS || NRFX_SPIM || NRFX_TWIM || NRFX_PWM
137+
help
138+
Due to Anomaly 109 the first byte sent out by these peripherals is
139+
sometimes wrong. This occurs when the system enters IDLE and stops the
140+
64MHz clock at the same time as the peripheral that is using DMA is started.
141+
This anomaly applies to IC revisions up to "3", the most recent one.
142+
132143
endif # SOC_SERIES_NRF52X

0 commit comments

Comments
 (0)