cancel
Showing results for 
Search instead for 
Did you mean: 

Disable the IWDG when the MCU is stopped in debug mode in a STM32F0

Xavier Garcia
Associate
Posted on November 02, 2017 at 09:19

Hi all,

In a STM32F0 I have configured the IWDG and every time that in debug mode I stop the MCU, then the watchtdog  active and the reset is on.

I read the user Manual and some post seen in this community . I use the HAL library give by ST Microelectronics to configure in this situation the IWDG in debug mode, but finally it's not work proprerlly.

I attach int this post all the code that I testing. .

I use the ST Cube the last version to configure all peripherals devices  and the Atollic IDE.

First test I attach the macro and with this macro don't work propoerlly

__HAL_DBGMCU_FREEZE_IWDG();

Second test I include in my project the Standard Peripheral Library to try another function  , but don't work propoerlly.

  ******************************************************************************

  * @file    stm32f0xx_dbgmcu.c

  * @author  MCD Application Team

  * @version V1.2.0

  * @date    01-August-2013

  * @brief   This file provides firmware functions to manage the following

  *          functionalities of the Debug MCU (DBGMCU) peripheral:

  *           + Device and Revision ID management

  *           + Peripherals Configuration

  *  @verbatim

  *  @endverbatim

  *

  ******************************************************************************

DBGMCU_APB1PeriphConfig(DBGMCU_IWDG_STOP,ENABLE);

Can anyone help me ?

Thanks,

Xavier,

#stm32-iwdg
4 REPLIES 4
rchris
Associate II
Posted on November 03, 2017 at 09:25

Hi,

for me on a STM32F437 this works:

DBGMCU->APB1FZ = DBGMCU->APB1FZ | DBGMCU_APB1_FZ_DBG_IWDG_STOP;   

Regards, Ralph

Xavier Garcia
Associate
Posted on November 03, 2017 at 14:19

Hi,

It's strange because in a STM32F103 works fine the same sentence that you wrote.

I don't arrive to configure for STM32F0 and work propertly.

Thanks,

Xavier,

Rock Deng
Associate III

Thank you!

I have just tested that __HAL_DBGMCU_FREEZE_IWDG() works on stm32f103.

Sonnenschützer_DW
Associate

I had the same problem on stm32f030.

An __HAL_RCC_DBGMCU_CLK_ENABLE() before __HAL_DBGMCU_FREEZE_IWDG() did the trick. I don't know why.