AnsweredAssumed Answered

What happens if I use the same priority and sub-priority in multiple NVIC?

Question asked by Carter Lee on Sep 13, 2017
Latest reply on Sep 13, 2017 by Clive One

Hi.

Now I'm trying to implement USART interrupt mode.

But I'm wondering if I use the same priority and sub-priority in multiple NVIC, what happens?

 

For example,

 

If I use as the below,

NVIC_InitStructure.NVIC_IRQChannel = EXTI0_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x00;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x00;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);

 

NVIC_InitStructure.NVIC_IRQChannel = USART2_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x00;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x00;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);

 

We can see that EXTI0_IRQn and EXTI0_IRQn have the same priority.

if I use the same priority and sub-priority in multiple NVIC, what happens?

 

As I know, first time to compare between NVIC_IRQChannelPreemptionPrioritys , if they are the same then compare between NVIC_IRQChannelSubPrioritys. but I'm not sure what happens if they have the same priority. might be there is such as some race condition?

Outcomes