I'm trying to implement standby and stop modes on this core for STM32F103 mcu. I had no isues with standby mode, it wirks properly wit power consumption about of 46 uA. Here it's sources:
void lp_init()
{
//enable power clock
RCC_BASE->APB1ENR |= RCC_APB1ENR_PWREN;
delay(10);
/* Enable access to RTC and backup registers */
PWR_BASE->CR |= PWR_CR_DBP;
///* Check if the system was resumed from StandBy mode */
if (PWR_BASE->CSR & SCB_SCR_SLEEPONEXIT)
{
PWR_BASE->CSR &= ~SCB_SCR_SLEEPONEXIT;
}
//Clear wakeup flag
PWR_BASE->CR |= PWR_CR_CWUF;
I'm trying to implement standby and stop modes on this core for STM32F103 mcu. I had no isues with standby mode, it wirks properly wit power consumption about of 46 uA. Here it's sources:
void lp_init() { //enable power clock RCC_BASE->APB1ENR |= RCC_APB1ENR_PWREN; delay(10);
}
void standby() { stop(); return; lp_init(); nvic_globalirq_disable();
}
But there are difficuelties with stop mode. It consumes 18 mA when entered, must be mutch less. Here the sources:
void stop() { lp_init();
}