Skip to main content
John Hite
Associate III
January 31, 2017
Solved

NVIC_Init() and NVIC_PriorityGroupConfig()

  • January 31, 2017
  • 4 replies
  • 3021 views
Posted on January 31, 2017 at 21:19

The notes in misc.c for NVIC_Init() state that NVIC_Init() should be called first.

The notes for NVIC_PriorityGroupConfig() list 4 priority groups. What are these priority groups and how are they determined?

There are 5 groups of 4 bits so how are they to be packed into a uint32_t?

The function NVIC_Init() is called more than once in our code, I assume one call to NVIC_PriorityGroupConfig() covers all calls to NVIC_Init() and needs to precede all of them.

Thanks,

JH

    This topic has been closed for replies.
    Best answer by Tesla DeLorean
    Posted on January 31, 2017 at 21:56

    The processor implementation has 4-bits to describe priority and preemption, you get to determine the split of those 4-bits between the two.

    If you split as 2 and 2 you'd get 4 priority levels, and 4 premption levels. Premption means it can interrupt during an interrupt, otherwise they take turns via the tail-chaining as ordered by the priority.

    Joseph Yiu has some good books on the Cortex parts

    4 replies

    waclawek.jan
    Super User
    January 31, 2017
    Posted on January 31, 2017 at 21:34

    Read PM0214, ch. 2.3.6  Interrupt priority grouping.

    JW

    John Hite
    John HiteAuthor
    Associate III
    January 31, 2017
    Posted on January 31, 2017 at 22:49

    Thanks. I am gonna have to study that a while.

    Having to respond via e-mail as my browser won't bring up the forum

    sometimes, just spins.

    On Tue, Jan 31, 2017 at 3:34 PM, waclawek.jan <

    Tesla DeLorean
    Tesla DeLoreanBest answer
    Guru
    January 31, 2017
    Posted on January 31, 2017 at 21:56

    The processor implementation has 4-bits to describe priority and preemption, you get to determine the split of those 4-bits between the two.

    If you split as 2 and 2 you'd get 4 priority levels, and 4 premption levels. Premption means it can interrupt during an interrupt, otherwise they take turns via the tail-chaining as ordered by the priority.

    Joseph Yiu has some good books on the Cortex parts

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    John Hite
    John HiteAuthor
    Associate III
    February 2, 2017
    Posted on February 02, 2017 at 22:22

    I got it, I just need to spend more time reading it.