I am trying to get the STM32F767 in the LQFP100 package to go into standby but the internal 1.2v regulator stays on.
There is a complication in that it uses external oscillators while running, but for shutdown I switch to HSI, disable the external oscillator and try to enter standby. GPIOE pin 2 asserts then fades away, suggesting that standby is sort of being entered, but the 1.2V regulator stays on, pulling around 5mA. What is keeping it on?
By the way, I didn't have this problem with a previous prototype that used a crystal for the HSE, just call HAL_PWR_EnterSTANDBYMode() and the regulator turns off.
// configure WUP4 for wakeup
//HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN4_LOW); // heh, doesn't work
PWR->CR2 |= PWR_CR2_WUPP4;
PWR->CSR2 &= ~PWR_CSR2_EWUP4;
PWR->CR2 |= PWR_CR2_CWUPF4;
PWR->CSR2 |= PWR_CSR2_EWUP4;
HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSI, RCC_MCODIV_1); // MCO1 to HSI
RCC->CFGR &= ~RCC_CFGR_SW_Msk; // Select HSI for sysclk
while (RCC->CFGR & RCC_CFGR_SWS); // wait until HSI selected
RCC->CR &= ~RCC_CR_HSEON; // disable HSE
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_7, GPIO_PIN_RESET); // turn external oscillator off
SysTick->CTRL = 0;
while (!(PWR->CSR2 & PWR_CSR2_WUPF4)) // while wakeup pin is not asserted
HAL_GPIO_TogglePin(GPIOE, GPIO_PIN_2); // debug