High current consumption in standby mode after starting CPU 2
Hi!
My project consists of a bootloader and a main program that uses BLE functionality. If, after turning on the device, the main program was not started, then after switching the bootloader to STANDBY, I get a current consumption of 5 µA, taking into account the additional components on the board-OK. If the main program was started (respectively, CPU2->RUN), after the software reset, the bootloader puts the system in standbay, but the current consumption floats in the range of 30-70 µA. After that, the situation can only be changed by switching the power. I took code samples for switching to standby in STM32Cube_FW_WB_V1. 10. 1 PWR_EnterStandbyMode
//in start main() after HAL init:
if((LL_PWR_IsActiveFlag_C1SB() != 0) && (LL_PWR_IsActiveFlag_C2SB() != 0)){
LL_PWR_ClearFlag_C1STOP_C1STB();
LL_PWR_ClearFlag_C1STOP_C1STB();
}
// SLEEP device:
HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);
HAL_SuspendTick();
if((LL_PWR_IsActiveFlag_C1SB() == 0)|| (LL_PWR_IsActiveFlag_C2SB() == 0)){
// Set the lowest low-power mode for CPU2: shutdown mode
LL_C2_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
}
LL_PWR_DisableWakeUpPin(LL_PWR_WAKEUP_PIN1);
// Clear all wake up Flag
LL_PWR_ClearFlag_WU();
// Enable pull up on wakeup pin
// Note: Setting not mandatory but recommended since there is no external pulling resistor on pin PA0 on STM32WB Nucleo board
LL_PWR_EnableGPIOPullUp(LL_PWR_GPIO_A, LL_PWR_GPIO_BIT_0); // SW1 button
.
.
.
// Enable pull-up and pull-down configuration for CPU1
LL_PWR_EnablePUPDCfg();
// Set wakeup pin polarity
LL_PWR_SetWakeUpPinPolarityLow(LL_PWR_WAKEUP_PIN1);
// Enable wakeup pin
LL_PWR_EnableWakeUpPin(LL_PWR_WAKEUP_PIN1);
// As default User push-button (SW1) state is high level, need to clear all wake up Flag again
LL_PWR_ClearFlag_WU();
// Set Standby mode when CPU enters deepsleep
LL_PWR_SetPowerMode(LL_PWR_MODE_STANDBY);
// Set SLEEPDEEP bit of Cortex System Control Register
LL_LPM_EnableDeepSleep();
// This option is used to ensure that store operations are completed
#if defined ( __CC_ARM)
__force_stores();
#endif
// Request Wait For Interrupt
__WFI();I think the problem is in the CPU2 activity. Can you tell me where I am wrong in preparing for the transition to STANDBY mode?
Thanks!
