Skip to content

Commit a7e2182

Browse files
committed
cpu/nrf5x/timer: run task SHUTDOWN instead of STOP
This is a workaround for errata 78 that causes increased current consumption even in the stopped state.
1 parent 97bc825 commit a7e2182

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

cpu/nrf5x_common/periph/timer.c

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,29 @@ void timer_start(tim_t tim)
165165

166166
void timer_stop(tim_t tim)
167167
{
168-
dev(tim)->TASKS_STOP = 1;
168+
/* Errata: [78] TIMER: High current consumption when using
169+
* timer STOP task only
170+
*
171+
* # Symptoms
172+
*
173+
* Increased current consumption when the timer has been running and the
174+
* STOP task is used to stop it.
175+
*
176+
* # Conditions
177+
* The timer has been running (after triggering a START task) and then it is
178+
* stopped using a STOP task only.
179+
*
180+
* # Consequences
181+
*
182+
* Increased current consumption.
183+
*
184+
* # Workaround
185+
*
186+
* Use the SHUTDOWN task after the STOP task or instead of the STOP task
187+
*
188+
* cf. https://infocenter.nordicsemi.com/pdf/nRF52833_Engineering_A_Errata_v1.4.pdf
189+
*/
190+
dev(tim)->TASKS_SHUTDOWN = 1;
169191
}
170192

171193
static inline void irq_handler(int num)

0 commit comments

Comments
 (0)