Skip to content

[STM32F401xE] Freeze master timer on stop/breakpoint #4881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#define TIM_MST TIM5
#define TIM_MST_IRQ TIM5_IRQn
#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE()
#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5()

#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET()
#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET()
Expand Down
7 changes: 7 additions & 0 deletions targets/TARGET_STM/hal_tick_16b.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
// Enable timer
HAL_TIM_Base_Start(&TimMasterHandle);

#ifndef NDEBUG
#ifdef TIM_MST_DBGMCU_FREEZE
// Freeze timer on stop/breakpoint
TIM_MST_DBGMCU_FREEZE;
#endif
#endif

#if DEBUG_TICK > 0
__HAL_RCC_GPIOB_CLK_ENABLE();
GPIO_InitTypeDef GPIO_InitStruct;
Expand Down
7 changes: 7 additions & 0 deletions targets/TARGET_STM/hal_tick_32b.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
__HAL_TIM_SET_COMPARE(&TimMasterHandle, TIM_CHANNEL_2, PreviousVal + HAL_TICK_DELAY);
__HAL_TIM_ENABLE_IT(&TimMasterHandle, TIM_IT_CC2);

#ifndef NDEBUG
#ifdef TIM_MST_DBGMCU_FREEZE
// Freeze timer on stop/breakpoint
TIM_MST_DBGMCU_FREEZE;
#endif
#endif

#if DEBUG_TICK > 0
__HAL_RCC_GPIOB_CLK_ENABLE();
GPIO_InitTypeDef GPIO_InitStruct;
Expand Down