cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G071: Watchdog Timer:

Karan 123
Senior

Hi,

How to use STM32G071 watchdog timer with STM32Cube IDE ?

--

karan

8 REPLIES 8
Simon.T
ST Employee

Hello @Community member​ ,

There are plenty of examples in cube using the IWDG or WWDG. You can easily take it and using it in your own code:

0693W00000UnozWQAR.png 

BR,

Simon

Karan 123
Senior

Hi @Simon.T​ 

Thanks for update..

I have seen example as below:

\\en.stm32cubeg0\STM32Cube_FW_G0_V1.3.0\Projects\NUCLEO-G071RB\Examples\WWDG\WWDG_Example\Src

And configure as below without any interrupt.

0693W00000UnqEsQAJ.png 

And do addition as attached file. But STM32G0 reset indefinitely Not working properly.

Please guide me..

--

Karan

You are not following the example. You are putting a 4000ms delay just after the init of the WWDG which is 2 times more than the maximum time out of the WWDG.

The condition "if (__HAL_RCC_GET_FLAG(RCC_FLAG_WWDGRST) != 0x00u)" and  __HAL_RCC_CLEAR_RESET_FLAGS();

 WwdgStatus = 0;

need to be before the MX_WWDG_Init();

Without this the MCU will reset every time.

Karan 123
Senior

Hi @STALA.1 (ST Employee)​ 

Thanks for update..

I have done as below but still same results . MCU keep reseting every time.

0693W00000UnvvCQAR.png0693W00000UnvvvQAB.png 

--

Karan

Hello Karan,

Is it possible to see the Option bit WWDG_SW. And check if the configuration is Hardware window watchdog or software window watchdog.

Because the example run only when the WWDG_SW is in software mode.

Best regards,

Simon

Karan 123
Senior

Hi @STALA.1 (ST Employee)​ 

Thanks for update..

In STM32CubeProgrammer

The Option bit WWDG_SW is already checked to use software window watchdog.

But when i unchecked with I am unable to Erase / program as well as Option bits to STM32 Chip.

STM32 Chip is detected and I am able to read.

0693W00000Uo6ylQAB.png 

0693W00000Uo6yqQAB.png 

With STM32CubeIDE,

I am getting below error.

0693W00000Uo70SQAR.png 

--

Karan

Hello Karan,

Can you check if you have activated some flash protection like PCROP, WRP or RDP?

The default value are these:

0693W00000UoKuxQAF.pngBy changing the WWDG_SW bit you shouldn't have an issue like this one.

I have another question, are you using a nucleo board or a custom board?

Simon

Hi @STALA.1 (ST Employee)​ 

Thanks for update..

Please check below as update.

0693W00000UoP0BQAV.png0693W00000UoP01QAF.png0693W00000UoP0GQAV.png0693W00000UoP1OQAV.pngError: Expected value for Option Byte

0693W00000UoOzrQAF.pngWhy causing this issue ?

--

Gurpreet Singh