STM32L433 clock is running in stop 2
My issue is a high current in stop 2 mode with the STM32L433, i'm measuring around 1mA in Stop2 Mode, which should be around 5uA for the MCU, with the rest of the board compoents, i expect around 50uA. For investiagrion, i desoldered all other components and only left voltage regulator in place. I'm still seing 750uA.
Further i enabled the PA8 MCO. This resulted in seeing a 4Mhz MSI Clock output while STOP2 is active, so it seems that the clock is active, and causing the current draw. Cube MX states 600uA for 4Mhz in "run" mode, which is closely to the measured 750uA.
I'm using the following code:
void pwr_Stop(void){
/* Set regulator to bypass: 2.5....3V from battery, instead of 3.3 regulated*/
hw_resetPin(PSU_EN);
/* Suspend the Ticker */
HAL_SuspendTick();
/* Change the GPIO , only leave wakeup pin active*/
hw_GPIO_InitStop();
__HAL_RCC_ADC_CLK_DISABLE();
__HAL_RCC_PWR_CLK_DISABLE();
__HAL_RCC_DMA1_CLK_DISABLE();
__HAL_RCC_PWR_CLK_DISABLE();
HAL_PWR_DisableBkUpAccess();
__HAL_RCC_WAKEUPSTOP_CLK_CONFIG(RCC_STOP_WAKEUPCLOCK_MSI);
/* Clear all related wakeup flags */
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
/* Go to STOP2 Mode */
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
////////////////
// STOP MODE
////////////////
/* Reinit the clocks */
sysClockConfig();
/* Enable Clocks */
sysClockEnable();
/* Resume the Ticker */
HAL_ResumeTick();
/* Reinit the Pins */
hw_GPIO_Init();
/* Startup the Regulator */
hw_PwrCntrl_EnAll();
}Any ideas why the clock stays on?