Skip to content

Commit cfb54f0

Browse files
authored
Merge pull request #1638 from dhalbert/disable-SPIM3
nrf: Disable SPIM3; add SPIM1; remove TWIM1
2 parents 8f57606 + c4586c0 commit cfb54f0

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

ports/nrf/nrfx_config.h

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
#define NRFX_SPIS_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1
1111
#endif
1212

13+
// NOTE: THIS WORKAROUND CAUSES BLE CODE TO CRASH; tested on 2019-03-11.
1314
// Turn on nrfx supported workarounds for errata in Rev1 of nRF52840
1415
#ifdef NRF52840_XXAA
15-
#define NRFX_SPIM3_NRF52840_ANOMALY_198_WORKAROUND_ENABLED 1
16+
// #define NRFX_SPIM3_NRF52840_ANOMALY_198_WORKAROUND_ENABLED 1
1617
#endif
1718

1819
// SPI
@@ -25,13 +26,17 @@
2526
// We could write an interrupt handler that checks whether it's
2627
// being used for SPI or I2C, but perhaps two I2C's and 1-2 SPI's are good enough for now.
2728

28-
// Enable SPIM2 and SPIM3 (if available)
29+
// Enable SPIM1, SPIM2 and SPIM3 (if available)
30+
// No conflict with TWIM0.
31+
#define NRFX_SPIM1_ENABLED 1
2932
#define NRFX_SPIM2_ENABLED 1
30-
#ifdef NRF_SPIM3
31-
#define NRFX_SPIM3_ENABLED 1
32-
#else
33-
#define NRFX_SPIM3_ENABLED 0
34-
#endif
33+
// DON'T ENABLE SPIM3 DUE TO ANOMALY WORKAROUND FAILURE (SEE ABOVE).
34+
// #ifdef NRF52840_XXAA
35+
// #define NRFX_SPIM_EXTENDED_ENABLED 1
36+
// #define NRFX_SPIM3_ENABLED 1
37+
// #else
38+
// #define NRFX_SPIM3_ENABLED 0
39+
// #endif
3540

3641

3742
#define NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY 7
@@ -40,10 +45,10 @@
4045
// QSPI
4146
#define NRFX_QSPI_ENABLED 1
4247

43-
// TWI aka. I2C; enable TWIM0 and TWIM1 (no conflict with SPIM choices)
48+
// TWI aka. I2C; enable a single bus: TWIM0 (no conflict with SPIM1 and SPIM2)
4449
#define NRFX_TWIM_ENABLED 1
4550
#define NRFX_TWIM0_ENABLED 1
46-
#define NRFX_TWIM1_ENABLED 1
51+
//#define NRFX_TWIM1_ENABLED 1
4752

4853
#define NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY 7
4954
#define NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY NRF_TWIM_FREQ_400K

0 commit comments

Comments
 (0)