AnsweredAssumed Answered

Trouble entering STOP2 on stm32l432

Question asked by brown.geoffrey.001 on Jul 9, 2018
Latest reply on Jul 11, 2018 by brown.geoffrey.001

I'm having trouble entering stop2 -- instead of going to stop2 my code seems to enter sleep; this is based upon measuring power levels -- I have the RTC fed by an external crystal and a 1 second interval alarm.  I can clearly see the transitions from sleep to run and back.      I'm just doing the standard thing

 

MODIFY_REG(PWR->CR1, 
PWR_CR1_LPMS, PWR_CR1_LPMS_STOP2);        
SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk));        
__SEV();        
__WFE();        
__WFE();        
CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk));

If instead I enter standby, the power levels drop to where I expect them (e.g. < 1uA), so I don't thing this power is leaking outside the stm32.   So something is either preventing entry to stop2 or just consuming power internal to the stm32.  This board is really simple -- just an adxl362 and a crystal.  In a different context (external RTC instead of crystal) I've had no problem entering STOP2.    I have read about the PWR_CR1_LPR bit, but I don't think that's the problem.   Any thoughts on ways to diagnose this ?

Outcomes