(Bug Report) SysTick NVIC priority is incorrectly configured at the initialization code
(Environment)
MC_SDK 5.Y.3 + STM32CubeMX 6.3.0 + IAR EWARM 8.5
(Hardware)
NUCLEO-F446RE + X-NUCLEO-IHM08M1 + Low Voltage BLDC motor
(What I found)
- By CubeMX, SysTick NVIC priority is configured as Priority Group=3bit+1bit, PreemptPriority=4, SubPriority=0
- At main(), HAL_Init() and SystemClock_Config() implement the above configuration, then I can read the same values for their registers.
- Right after the above code, however, MX_MotorControl_Init() calls HAL_SYSTICK_Config(), where SysTick priority is set to 15, PreemptPriority=7, SubPriority=1
(Question)
- Is that a defect or am I doing something wrong in configuration & code generation?
- If a defect, is it good enough to add HAL_NVIC_SetPriority() for SysTick in MX_MotorContorl_Init()?
- Or removing NVIC_SetPriority() in SysTick_Config() would be better?
SysTick initialization code looks a little messy.