Closed garudaonekh closed 6 months ago
I tried to use the OpenPuya LL example, but setting LSI as clock source hang the MCU and stuck there.
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_LSI);
static void APP_SystemClockConfig(void)
{
/* LSI使能及初始化 */
LL_RCC_LSI_Enable();
while(LL_RCC_LSI_IsReady() != 1)
{
}
/* 设置AHB分频 */
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
/* 配置LSI为系统时钟及初始化 */
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_LSI);
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_LSI)
{
}
LL_FLASH_SetLatency(LL_FLASH_LATENCY_0);
/* 设置APB1分频及初始化 */
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
/* 更新系统时钟全局变量SystemCoreClock(也可以通过调用SystemCoreClockUpdate函数更新) */
LL_SetSystemCoreClock(LSI_VALUE);
}
Apologies, I had read the question for a while but I didn't know what to answer. I didn't get time and parts to solder a clean board to test these power consumption numbers. Recently I have got what I need and did some tests. I guess you need to enable Flash Sleep mode in LSI to make 100uA, please find the example code in above commit.
thanks for taking time to make a specific example on this. I will try it
It works. Many thanks
Hi, As per Py32f030 datasheet, with LSI as clock source the power consumption in run mode is around 0.1ma.
I set the Low Speed Clock Source to LSI 32.768KHZ but it's not working. The power consumption still at around 0.4ma.
I try to set it in HAL mode also but still not working
Any configuration I am missing?
Thanks;