关于keil和看门狗

199 阅读1分钟

看门狗一定要喂狗,喂狗不是要在主程序开头,每一个有while的里面都要有一个,多喂几个

KEIL快捷键https://blog.csdn.net/dddxxxx/article/details/44813135

\

stm32看门狗独立窗口初始化

void IWDG_Configuration(void)
{
IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable); //Enable write access to IWDG_PR and IWDG_RLR registers

IWDG_SetPrescaler(IWDG_Prescaler_32);//IWDG counter clock: 40KHz(LSI)/32 = 1.25 KHz (0.8ms)

IWDG_SetReload(2000);    //Set counter reload value to 500 (0.4S)(IWDG timeout equal to 400ms)

EWDG_wdi_feed();
IWDG_ReloadCounter();   //Reload IWDG counter

IWDG_Enable();          //Enable IWDG (the LSI oscillator will be enabled by hardware)
}

看现象要把jlink拔下来,还要起始地址是0x8000