diff --git a/arch/arm/src/nrf53/Kconfig b/arch/arm/src/nrf53/Kconfig index 94324e40cb..1d46ad3667 100644 --- a/arch/arm/src/nrf53/Kconfig +++ b/arch/arm/src/nrf53/Kconfig @@ -687,6 +687,13 @@ config NRF53_I2C_MASTER_COPY_BUF_SIZE transaction will fit otherwise it will fall back on malloc. +config NRF53_I2C_MASTER_WORKAROUND_400KBPS_TIMING + bool "Master 400Kbps timing anomaly workaround" + default y + ---help--- + Enable the workaround to fix I2C Master 400Kbps timing bug + which occurs in all NRF5340 revisions to date. + endif # NRF53_I2C_MASTER endmenu diff --git a/arch/arm/src/nrf53/hardware/nrf53_twi.h b/arch/arm/src/nrf53/hardware/nrf53_twi.h index 603228ade5..70548957f4 100644 --- a/arch/arm/src/nrf53/hardware/nrf53_twi.h +++ b/arch/arm/src/nrf53/hardware/nrf53_twi.h @@ -156,7 +156,11 @@ #define TWIM_FREQUENCY_100KBPS (0x01980000) /* 100 kbps */ #define TWIM_FREQUENCY_250KBPS (0x04000000) /* 250 kbps */ -#define TWIM_FREQUENCY_400KBPS (0x06400000) /* 400 kbps */ +#ifdef CONFIG_NRF53_I2C_MASTER_WORKAROUND_400KBPS_TIMING +# define TWIM_FREQUENCY_400KBPS (0x06200000) /* 390 kbps */ +#else +# define TWIM_FREQUENCY_400KBPS (0x06400000) /* 400 kbps */ +#endif #define TWIM_FREQUENCY_1000KBPS (0x0ff00000) /* 1000 kbps */ /* RXDMAXCNT Register */