cancel
Showing results for 
Search instead for 
Did you mean: 

IWDG debug freeze not working (for me!).

ms1802
Associate II

Hi all -

Happy NY!

I've a stm32H743ZI2 (nucleo) and am using the following code to init the IWDG

   __HAL_RCC_WWDG1_CLK_ENABLE();

   __HAL_DBGMCU_FREEZE_IWDG1(); //not working!!!?

   // Reload = (LsiFreq(Hz) * Timeout(ms)) / (prescaler * 1000)

   hiwdg.Instance = IWDG1;

   hiwdg.Init.Prescaler = IWDG_PRESCALER_256;

   hiwdg.Init.Reload = (32000 * 5000) / (256* 1000);  //5 seconds.

   hiwdg.Init.Window = IWDG_WINDOW_DISABLE;

   HAL_IWDG_Init(&hiwdg);

The code is right after I've done the clock config, MPU,Cache etc.

The actual function of the WD seems to work fine, its just the when I hit a breakpoint, the MPU resets as if the __HAL_DBGMCU_FREEZE_IWDG1() was not called.

I've used this feature before on others, F4 F7 etc, and it works fine, but not on the H7.

The __HAL_DBGMCU_FREEZE_IWDG1 macro looks ok to me wrt to the manual.

What am I missing?

thanks

Mark

Bit of an update -

I think this is related to the problem with reading the DBGMCU region of memory. as desbribed in the link below. It also relates to the HAL_GetREVID() issues discussed.

Ive tried building a simple project with cubeMX and building an example one from the libraries. And implemented the suggested fix to the SystemInit(). But cant get the Device Id as Clive pointed out.

https://community.st.com/s/question/0D50X0000Atiu1QSQQ/two-different-stm32h7-rev-y-mcus-hang-on-new-140-hal

0 REPLIES 0