cancel
Showing results for 
Search instead for 
Did you mean: 

HAL API sets NVIC priority from 0 to 3 only whereas rM0376 suggests otherwise

SA.17
Associate III

I am using STM32L072

hence referring to reference manual RM0376

Page . 280 Table.53 suggests that priority can be from 0 till 38

but when try  

HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority)

as per help above that function i can set Preemptpriority only from 0-3 , subpriority is of no use for cortex m0+

if i put more than 3 ,it becomes 0

I am confused between reference manual and HAL

Which is correct ?

3 REPLIES 3
TDK
Guru

If you set the priority of all your interrupts to the same thing, the "priority" listed in the table is the order they'll fire in. These are built-in values which cannot be changed. It's just saying that if multiple interrupts are pending, and if they have the same priority level, the one with the lowest IRQ number will be executed first.

It could definitely be written better, or at least clarified.

If you feel a post has answered your question, please click "Accept as Solution".
SA.17
Associate III

"If you set the priority of all your interrupts to the same thing, the "priority" listed in the table is the order they'll fire in. "

Not the case cause i have already tried and uart and systicktimer stuck just because they have same priority.it only works if i change uart priority to a higher number .

Well they aren't going to preempt each other if they have the same priority.
If you feel a post has answered your question, please click "Accept as Solution".