Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nrf52: i2c_twim: Fix static 400uA current #72621

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions modules/hal_nordic/nrfx/nrfx_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,10 @@
CONFIG_NRF52_ANOMALY_109_WORKAROUND_EGU_INSTANCE
#endif

#ifdef CONFIG_NRF52_ANOMALY_89_WORKAROUND
#define NRFX_TWIM_NRF52_ANOMALY_89_WORKAROUND_ENABLED 1
#endif

#if defined(CONFIG_SOC_SERIES_BSIM_NRFXX)
#include "nrfx_config_bsim.h"
#endif
Expand Down
10 changes: 10 additions & 0 deletions modules/hal_nordic/nrfx/nrfx_config_nrf52832.h
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,16 @@
#define NRFX_TWIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 0
#endif

/**
* @brief NRFX_TWIM_NRF52_ANOMALY_89_WORKAROUND_ENABLED - Enables nRF52 Anomaly 89 workaround for
* TWIM.
*
* Boolean. Accepted values 0 and 1.
*/
#ifndef NRFX_TWIM_NRF52_ANOMALY_89_WORKAROUND_ENABLED
#define NRFX_TWIM_NRF52_ANOMALY_89_WORKAROUND_ENABLED 0
#endif

/**
* @brief NRFX_TWIM_CONFIG_LOG_LEVEL
*
Expand Down
5 changes: 5 additions & 0 deletions soc/nordic/nrf52/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ if(CONFIG_SOC_NRF52832)
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")
endif()
endif()
if(NOT CONFIG_NRF52_ANOMALY_89_WORKAROUND)
if (CONFIG_NRFX_TWIM AND CONFIG_NRFX_GPIOTE)
message(WARNING "NRF52_ANOMALY_89_WORKAROUND disabled with TWIM and GPIOTE enabled. This can cause a static current draw of 400uA")
endif()
endif()
endif()
10 changes: 10 additions & 0 deletions soc/nordic/nrf52/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,14 @@ config NRF52_ANOMALY_109_WORKAROUND_EGU_INSTANCE
help
EGU instance used by the nRF52 Anomaly 109 workaround for PWM.

config NRF52_ANOMALY_89_WORKAROUND
bool "Anomaly 89 workaround"
default y
depends on SOC_NRF52832
depends on NRFX_TWIM || NRFX_SPIM
depends on NRFX_GPIOTE
help
This helps in reducing the 400uA to 450uA static current consumption when
GPIOTE and TWIM is enabled.

endif # SOC_SERIES_NRF52X
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ manifest:
groups:
- hal
- name: hal_nordic
revision: 4a3ba8eaca8f5255f550db7bc54dc3e23212da64
revision: pull/180/head
path: modules/hal/nordic
groups:
- hal
Expand Down
Loading