Skip to main content
philippe_chapus
Associate
January 19, 2011
Question

Systick priority

  • January 19, 2011
  • 2 replies
  • 609 views
Posted on January 19, 2011 at 17:51

Systick priority

    This topic has been closed for replies.

    2 replies

    philippe_chapus
    Associate
    May 17, 2011
    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

    Tesla DeLorean
    Guru
    May 17, 2011
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..