Unexpected extra 1.5uA after first wakeup from stop mode STM32L0
I'm testing STM32L051C8T6 without any peripherals or extra electronics. No crystals used.
After reset and first power down I get about 1.40uA. the MCU wakes up and powers down and then I get about 3uA in power down mode. After changing all kind of code I'm out of options. Any suggestions?
The main code. The MCU wakes up from RTC AlarmA.
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
// MX_RTC_Init();
/* USER CODE BEGIN 2 */
__HAL_RCC_PWR_CLK_ENABLE();
HAL_PWR_EnableBkUpAccess();
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
//HAL_GPIO_WritePin(GPIOB, GPIO_PIN_8, 1);
HAL_Delay(1000);
//HAL_GPIO_WritePin(GPIOB, GPIO_PIN_8, 0);
HAL_Delay(100);
// reset_RTC; //change time to 0:00:00
MX_RTC_Init();
HAL_PWREx_EnableUltraLowPower();
// USR_PowerDown_GPIO();
HAL_SuspendTick();
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
// rest system clock config
SystemClock_Config();
HAL_ResumeTick();
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}