cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H750: Cannot run IWDG1 Watchdog

flyer31
Senior

Somehow my IWDG1 does not start. I follow exactly the instruction in the manual:

 IWDG1->KR= (DWORD)0xcccc;    // Start IWDG
 IWDG1->KR= (DWORD)0x5555;    // Access registers IWDG
 IWDG1->PR= 0;
 IWDG1->RLR= 500;
 

 ... but if I check now IWDG1->SR, then the RUV Bit keeps on 1, and the 

 RLR register keeps on the reset value 0xFFF (it does NOT change to the specified value of 500). The LSI switches on, as I

 see it in RCC->CSR (I also tried already to switch on LSI "manually" first,

 but it does not help)

 Am I missing here some special trick to start IWDG? (from LSION it seems to start, but RLR does not change...)

 The option byte "IWDG_SW" is set, as I see it in ST-Link. Also the bit IWDG_SW  in the register FLASH->OPTSR_CUR is set. (I did not change any option bytes so far, this just seems to be the state "as delivered", chip is STM32H750 Version Y).

 But strangely in SYSCFG->UR11 the bit IWDGM reads zero... . 

 The WWDG works ... .

 Any help available?

3 REPLIES 3
MikeDB
Lead

That's weird. The code I found said to do this, but it's currently commented out and hence untested.

      IWDG1->KR = 0x5555;

      IWDG1->PR = 3;

      IWDG1->KR = 0xCCCC;

flyer31
Senior

I now programmed IWDG1 to Hardware control (using FLASH->OPTSR_PRG).

Then IWDG1 worked nicely.

Just if I want to connect with Keil/ST-LINK again, then the connection failed. ... but now I changed the Project-Settings Debug Connect to "Under Pre-Reset" ... now connect works also with IWDG1 running in Hardware mode, so this seems nice for me (just I still think, that it is quite strange, that IWDG1 seems not to start under software control...).

PS: Sometimes Connection to Keil via STLINK does not work. In such case, if I start ST-LINK directly it will connect, but then show the error line "Cannot read memory". If I then in ST-LINK re-program the option bytes with IWDG checked, then all will work again ... just very strange that if I connect again with Keil-ST-LINK, and I check FLASH->OPTSR_CUR, then strangly the IWDG still is set to zero ... also if I re-connect again with ST-LINK, then IWDG checkbox NON_CHECKED again ... (my ST-LINK has Version v4.3.0.0, USB v5.1.0.0, cli v3.3.0.0)

flyer31
Senior

... I meanwhile found the IWDG example for Nucleo board in the STM32Cube_FW_H7_V1.3.0.

I tried exactly the same, and now it works. (and my original code above also works now ... shame over me, please excuse).

Software start of IWDG is really much nicer than the Hardware start ... when I used the Hardware start, Debugging had been not too funny any more, often I needed to set IWDG1 again with ST-Link utility, as the connection in Keil-ST-Link somehow was blocked on new Debug start from time to time...