Dear support,
Anomaly 89 of the NRF52832 states that a high static current consumption is observed when the SPIM/TWIM uses EasyDMA and the GPIOTE is configured in event mode. The workaround, copied below, consist on "power cycling" the peripheral, by toggling its POWER register.
// Workaround code for the TWIM0/SPIM0 *(volatile uint32_t *)0x40003FFC = 0; *(volatile uint32_t *)0x40003FFC; *(volatile uint32_t *)0x40003FFC = 1;
From this thread, I can understand why it happens (TWIM/SPIM not releasing the HFCLK after a transition is over) and from this other thread, it is clear that the workaround, despite leaving the TWIM/SPIM powered on, the peripheral does not consume power because it is not configured.
However, I remain with two doubts:
1. Must the TWIM module be disabled after each transition is completed? If so, after finishing my transaction, should I run the following snippet, where tw1_instance is the nrf_drv_twi_t instance?
// disable module nrf_drv_twi_disable(&twi1_instance); // uninitialize TWI module nrf_drv_twi_uninit(&twi1_instance); *(volatile uint32_t *)0x40004FFC = 0; *(volatile uint32_t *)0x40004FFC; *(volatile uint32_t *)0x40004FFC = 1;
2. If I want to unitialize the module, i.e., not use it again (for instance, before going to sleep), do I still need to apply the workaround?
Thank you in advance,
Pedro