Hi, when configure MCU to deep sleep mode as the low power mode, it seems okay when debugging. But, when only power up STM32C0 by just connected its vcc and ground, it do not enter its interrupt. How can I solve it?
My project goals are to achieve lowest current consumption and MCU able to communication with other modules through I2C and USART. Those communication protocols are triggered by its interrupt using timer1.
int main(void)
{
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* Configure the system clock */
SystemClock_Config();
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_TIM1_Init();
MX_I2C1_Init();
MX_USART1_UART_Init();
/* USER CODE BEGIN 2 */
LPS_Init();
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP0);
LL_LPM_EnableDeepSleep();
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
__NOP();
/* USER CODE END WHILE */
if(fsleep==1){
__WFI();
}
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
communication flow::
timer -> I2C -> usart
timer will trigger i2c interrupt to read info and send the data to usart (TX)
Thanks.