Skip to content

Commit f44ace1

Browse files
committed
stmhal: Put flash in deep power-down mode when entering stop mode.
This can get PYBv1.0 stop current down to around 290uA.
1 parent 104a867 commit f44ace1

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

stmhal/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ SRC_HAL = $(addprefix $(HAL_DIR)/src/,\
168168
stm32f4xx_hal_pcd.c \
169169
stm32f4xx_hal_pcd_ex.c \
170170
stm32f4xx_hal_pwr.c \
171+
stm32f4xx_hal_pwr_ex.c \
171172
stm32f4xx_hal_rcc.c \
172173
stm32f4xx_hal_rcc_ex.c \
173174
stm32f4xx_hal_rng.c \

stmhal/modpyb.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,9 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_udelay_obj, pyb_udelay);
425425

426426
/// \function stop()
427427
STATIC mp_obj_t pyb_stop(void) {
428+
// takes longer to wake but reduces stop current
429+
HAL_PWREx_EnableFlashPowerDown();
430+
428431
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
429432

430433
// reconfigure the system clock after waking up

0 commit comments

Comments
 (0)