2023-12-24 09:39 PM
I want to use IWDG with stm32f103rct6 chip with ll library. such samples code as below:
```
static int iwdg_init (unsigned short int expired_ms)
{
/* 开启 LSI, IWDG */
__HAL_RCC_LSI_ENABLE();
LL_RCC_LSI_Enable();
while (!LL_RCC_LSI_IsReady());
LL_IWDG_EnableWriteAccess(IWDG);
LL_IWDG_SetPrescaler(IWDG, LL_IWDG_PRESCALER_256);
LL_IWDG_SetReloadCounter(IWDG, 100);
LL_IWDG_ReloadCounter(IWDG);
rt_kprintf("iwdg->pr %x\n", (unsigned int)IWDG);
rt_kprintf("iwdg->rlr %x\n", READ_REG(IWDG->RLR));
rt_kprintf("iwdg->pr %x\n", READ_REG(IWDG->PR));
/* 开启 IWDG */
LL_IWDG_Enable(IWDG);
pr_info("iwdg start\n");
}
````
After I do with these code, I found RLR and PR are still 0XFFF and 0X0 with reset value. Besides after I enable IWDG with ``LL_IWDG_Enable(IWDG)``, the system restart soon.
I wonder how could this happy ??😂
2023-12-25 12:24 AM
Hello @sheng yang
I suggest you take a look at the parts 2.8.2 and 2.8.3 of the ES0340. I think that describe your issue.
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.