2019-07-30 06:50 PM
My board(STM32F103R8T6) sometimes stop.. So I use IWDG and it doesn't work. If my board doesn't work well, is it right that iwdg works and resets the core? Let my code work properly.
void IWDG_Configuration(void)
{
IWDG->KR = 0x5555;
IWDG->RLR = 0x000F;
IWDG->PR = 0x0008;
IWDG->KR = 0xAAAA;
IWDG->KR = 0xCCCC;
}
void TIM2_IRQHandler(void)
{
if(TIM_GetITStatus(TIM2,TIM_IT_Update) != RESET)
{
IWDG->KR = 0xAAAA;
uCnt1 ++;
if (uCnt1 >= 500)
uCnt1 = 0;
if(ck_ldfg == 0) ck_ldfg = 1;
else ck_ldfg = 0;
if (ck_ldfg == 0)
CPU_CHK_LED_LO();
else
CPU_CHK_LED_HI();
TIM_ClearITPendingBit(TIM2, TIM_IT_Update);
}
}
2019-07-30 07:52 PM
Are you driving the NRST pin externally?
2019-07-30 10:06 PM
I've made it possible to reset the switch I've added.