cancel
Showing results for 
Search instead for 
Did you mean: 

IWDG Doesn't Reset Without Refreshing with F103RC

Chao
Senior

Hi,

I am trying to use IWDG to function as a 5s timer, IWDG is reloaded every second. In order to test the functionality, I just activated it with default parameters of PRESCALER=4 RELOAD VALUE=4095, and I did nothing else (no refreshing the timer), when I generate and build the code and run the main, no MCU reset occurs.

Chao_0-1736418375886.pngChao_1-1736418396524.png

I checked an example with G070, except for the example measures the LSI frequency, it does not do extra things to get the IWDG work. The F1 RM says that the IWDG will automatically work once the  main starts working.

Where it's going wrong?

Regards

Chao

4 REPLIES 4
Sarra.S
ST Employee

Hello @Chao

Since you're configuring your clock source as LSE, I want to make sure you have a 32.768 kHz external crystal.

If not, you have to use LSI, this should work without issues. 

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.

TDK
Guru

Debug the code, does it start the IWDG or does it get stuck somewhere before that?

If you feel a post has answered your question, please click "Accept as Solution".

Hi Sarra,

Thanks for your reply!

Yes, I do have an external 32.768KHz crystal, but from my understanding of the clck tree I copied, the IDWG uses the LSI clock source in any cases as it comes straight from the 40KHz and not from the mux. 

The clock configuration in the CubeIDE example with G070 is as below:

Chao_0-1736450882975.png

Do you mean that I can't use both LSE and LSI. I have to use LSE for RTC, in this case how shoud I configure the clock for IWDG?

Regards

Chao

Hi @TDK ,

Thanks for your reply!

I did do debugging, and could step through the Init code with HAL_IWDG_Init(&hiwdg) returns HAL_OK but my code runs as if the IWDG didn't exist:

Chao_1-1736453884331.png

I didn't refresh the counter and code runs as usual. The IWDG is a new functionality of my existing working code.

So any idea of this?

Regards

Chao