cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way in MX2 to enable/disable timer freezing during debugging?

gil_dobjanschi
Associate III

Hello,

 

Is there a setting in MX2 to enable/disable timer freezing during debugging? If not, what HAL APIs can be used for this purpose?

 

Thank you,

Gil

1 ACCEPTED SOLUTION

Accepted Solutions
STackPointer64
ST Employee

Hello,

It is not available in MX2. It needs to be configured manually in the debug register, DBGMCU_APB1LFZR, in particular. I invite you to check the reference manual, page 2543.

STackPointer64_0-1776951981484.png

Best regards,

To improve visibility of answered topics, please click 'Accept as Solution' on the reply that resolved your issue or answered your question.

View solution in original post

3 REPLIES 3
STackPointer64
ST Employee

Hello,

It is not available in MX2. It needs to be configured manually in the debug register, DBGMCU_APB1LFZR, in particular. I invite you to check the reference manual, page 2543.

STackPointer64_0-1776951981484.png

Best regards,

To improve visibility of answered topics, please click 'Accept as Solution' on the reply that resolved your issue or answered your question.
gil_dobjanschi
Associate III

Thank you @STackPointer64,

Much appreciated!

-Gil

mƎALLEm
ST Employee

Hello,

You need to use DBGMCU block and call call __HAL_DBGMCU_FREEZE_TIMx() to freeze the timer during the debug.

If you re using TIM1 so call  __HAL_DBGMCU_FREEZE_TIM1().

DBGMCU_APBxy register:

mALLEm_0-1776952815071.png

mALLEm_1-1776952888323.png

Edit:

For HAL2 use HAL_DBGMCU_TIMx_Freeze() where x is the timer number.

 

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.