Skip to content

Commit bb65961

Browse files
Maciej BojczukBartSX
authored andcommitted
[NUCLEO_F030R8] 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: Ic143ed0f3e4e42ad5f7b95337d8c005b7ec61274
1 parent 899cd44 commit bb65961

File tree

1 file changed

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

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,10 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) {
128128
// Output compare channel 2 interrupt for HAL tick
129129
NVIC_SetVector(TIM_MST_UP_IRQ, (uint32_t)timer_update_irq_handler);
130130
NVIC_EnableIRQ(TIM_MST_UP_IRQ);
131+
NVIC_SetPriority(TIM_MST_UP_IRQ, 0);
131132
NVIC_SetVector(TIM_MST_OC_IRQ, (uint32_t)timer_oc_irq_handler);
132133
NVIC_EnableIRQ(TIM_MST_OC_IRQ);
134+
NVIC_SetPriority(TIM_MST_OC_IRQ, 1);
133135

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

0 commit comments

Comments
 (0)