cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L476deep sleep cannot set pwr_cr1 register bits.

IDIMI.1
Associate

Hi,

i am trying to get stm32l476RET6 to deep sleep ( shutdown or standby mode) following mbed examples, but the processors power consumption i measure is not even close at the correct consumption in these modes.

At some point, befote WFI() function, i write PWR->CR1 power mode selection bits

, after that i read their value and the result i see is that PWR->CR1 value stays unaffected ( default 0x0200 ) , although it's bits have RW permissions.

printf("cr1 before : %lu\n",PWR->CR1);

// Select low power mode: SHUTDOWN

PWR->CR1 |= 0x4003;

or

PWR->CR1 |= PWR_CR1_LPMS_STANDBY;

printf("cr1 after : %lu\n",PWR->CR1);

Could you help me with what i am missing here?

Thank you.

0 REPLIES 0