cancel
Showing results for 
Search instead for 
Did you mean: 

Systick priority

philippe_chapus
Associate II
Posted on January 19, 2011 at 17:51

Systick priority

2 REPLIES 2
Posted on May 17, 2011 at 14:21

Why are you setting the SubPriority?

  /* Configure the NVIC Preemption Priority Bits */

  NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);

 NVIC_SetPriority(SysTick_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(), 0, 0));

  /* Enable the USART3 Interrupt */

  NVIC_InitStructure.NVIC_IRQChannel                    = USART3_IRQn;

  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority  = 1;

  NVIC_InitStructure.NVIC_IRQChannelSubPriority         = 0;

  NVIC_InitStructure.NVIC_IRQChannelCmd                 = ENABLE;

  NVIC_Init(&NVIC_InitStructure);   /* Enable the USART2 Interrupt  */

  NVIC_InitStructure.NVIC_IRQChannel                    = USART2_IRQn;

  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority  = 2;

  NVIC_InitStructure.NVIC_IRQChannelSubPriority         = 0;

  NVIC_InitStructure.NVIC_IRQChannelCmd                 = ENABLE;

  NVIC_Init(&NVIC_InitStructure);

You should also consider setting the priority AFTER using Systick_Config(), because it sets the LOWEST priority.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
philippe_chapus
Associate II
Posted on May 17, 2011 at 14:21

Hi,

Thank you clive1 for your rapid answer !!!

I have spend 1 day to find this bug, without success.

I hav'nt seen that Systick_Config() set the lowest priority, and it is called after my priority setting.

Philippe