Skip to content

Commit 899cd44

Browse files
Maciej BojczukBartSX
authored andcommitted
[NUCLEO_F070RB] Set NVIC Timer priorities
This fix is a solution for issue #816 when having two separate IRQ handlers in Timers (UPDATE Irq and OutputCompare Irq). The update priority needs to be higher to avoid undefined behaviours. Change-Id: I5ef2c27926167ed22108901cd63586692a5f8f90
1 parent 91422cb commit 899cd44

File tree

1 file changed

+2
-0
lines changed
  • hal/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F070RB

1 file changed

+2
-0
lines changed

hal/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F070RB/hal_tick.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,10 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) {
130130
// Output compare channel 2 interrupt for HAL tick
131131
NVIC_SetVector(TIM_MST_UP_IRQ, (uint32_t)timer_update_irq_handler);
132132
NVIC_EnableIRQ(TIM_MST_UP_IRQ);
133+
NVIC_SetPriority(TIM_MST_UP_IRQ, 0);
133134
NVIC_SetVector(TIM_MST_OC_IRQ, (uint32_t)timer_oc_irq_handler);
134135
NVIC_EnableIRQ(TIM_MST_OC_IRQ);
136+
NVIC_SetPriority(TIM_MST_OC_IRQ, 1);
135137

136138
// Enable interrupts
137139
__HAL_TIM_ENABLE_IT(&TimMasterHandle, TIM_IT_UPDATE); // For 32-bit counter

0 commit comments

Comments
 (0)