Skip to content

Commit

Permalink
Adding workaround for nrf52 anomaly 89
Browse files Browse the repository at this point in the history
  • Loading branch information
gumulka committed Oct 9, 2024
1 parent ab5cb2e commit eaf0d17
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions nrfx/drivers/src/nrfx_twim.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,11 @@ void nrfx_twim_disable(nrfx_twim_t const * p_instance)

p_cb->int_mask = 0;
nrfy_twim_stop(p_instance->p_twim);
#if NRFX_CHECK(NRFX_TWIM_NRF52_ANOMALY_89_WORKAROUND_ENABLED)
p_instance->p_twim->POWER = 0;
p_instance->p_twim->POWER;
p_instance->p_twim->POWER = 1;
#endif
p_cb->state = NRFX_DRV_STATE_INITIALIZED;
p_cb->busy = false;
NRFX_LOG_INFO("Instance disabled: %d.", p_instance->drv_inst_idx);
Expand Down
4 changes: 3 additions & 1 deletion nrfx/mdk/nrf52.h
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,9 @@ typedef struct { /*!< (@ 0x40003000) TWIM0 Struct
__IOM TWIM_TXD_Type TXD; /*!< (@ 0x00000544) TXD EasyDMA channel */
__IM uint32_t RESERVED14[13];
__IOM uint32_t ADDRESS; /*!< (@ 0x00000588) Address used in the TWI transfer */
} NRF_TWIM_Type; /*!< Size = 1420 (0x58c) */
__IM uint32_t RESERVED15[668];
__IOM uint32_t POWER; /*!< (@ 0x00000FFC) Peripheral power control */
} NRF_TWIM_Type; /*!< Size = 4096 (0x1000) */



Expand Down
9 changes: 9 additions & 0 deletions nrfx/templates/nrfx_config_nrf52832.h
Original file line number Diff line number Diff line change
Expand Up @@ -1353,6 +1353,15 @@
#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

0 comments on commit eaf0d17

Please sign in to comment.