Skip to content

Commit 2970c50

Browse files
committed
Nenik: Fix FPU-caused power consumption issue, related to #165
Apply the workaround from the Errata 87 of nRF52832 See https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev2/ERR/nRF52832/Rev2/latest/anomaly_832_87.html?cp=4_2_1_0_1_24
1 parent 3ada760 commit 2970c50

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cores/nRF5/freertos/portable/CMSIS/nrf52/port_cmsis_systick.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,13 @@ void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime )
182182
configPRE_SLEEP_PROCESSING( xModifiableIdleTime );
183183
if ( xModifiableIdleTime > 0 )
184184
{
185+
#if (__FPU_USED == 1)
186+
// nRF52832 errata 87: prevent FPU from keeping CPU on
187+
// https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev2/ERR/nRF52832/Rev2/latest/anomaly_832_87.html?cp=4_2_1_0_1_24
188+
__set_FPSCR(__get_FPSCR() & ~(0x0000009F));
189+
(void) __get_FPSCR();
190+
NVIC_ClearPendingIRQ(FPU_IRQn);
191+
#endif
185192
#ifdef SOFTDEVICE_PRESENT // TODO
186193
uint8_t sd_en = 0;
187194
(void) sd_softdevice_is_enabled(&sd_en);

0 commit comments

Comments
 (0)