This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Interrupt priority question

Hi,

It's about the STM32F103 uC.

According the NVIC datasheet as I understand:
- all uninitialized interrupts have their fixed default interrupt sequence number
- by default initially all interrupts get priority number 0 (meaning highest priority)
- if two uninitialized interrupts occur at the same time then the one with the lowest priority number is executed first
- interrupts can be initialized by assigning them to a group (3,4,5,6,7) and to a subgroup within

With initialized/uninitialized is ment connected to a group or not.

My questions are:

- (I assume) interrupts assigned to a lower numbered group do pre-empty higher numbered group interrupts, is this correct?

- can a lower-priority uninitialized interrupt A get a higher priority than a higher-priority uninitialized interrupt B by connecting A to a group?

- if so: does A pre-empty B or does A wait for B to finish?

- will a higher-priority uninitialized interrupt pre-empty or wait for a lower-priority uninitialized interrupt?

I cannot figure this out from the NVIC pdf.

Thanks

Henk

Parents
  • Hi,

    Well I studied the documentation a little more and read some test results on interrupt tests I had executed some time agoo. So I write down a summary to not forget it.

    For clarity:
    Pre-emptying means one interrupt interrupting another active interrupt.
    Non pre-emptying means one interrupt waits for another active interrupt to finish.

    There is no such thing as 'initialized' or 'uninitialized' interrupt. ;-)

    There are only 5 sets (numbered 3,4,5,6,7) of maingroup/subgroup priority combinations.

    Only 1 set out of 5 can be selected and applies to all relevant interrupts.

    A set contains 4 bits.

    For example set number 3 allows any interrupt being a member of 1 out of 4 different maingroups (selectable by highest 2 bits) and being a member of 1 out of 4 different subgroups (selectable by lower 2 bits).

    If interrupt A is a member of a higher priority maingroup (lower maingroup value) than interrupt B then interrupt A will pre-empty interrupt B.

    If interrupt A is a member of a lower priority maingroup (higher maingroup value) than interrupt B then interrupt A will wait until interrupt B has finished.

    Only maingroup priority uses pre-emptying.

    Subgroup priority never uses pre-emptying but waits for interrupts being finished.

    Within the same maingroup a higer priority subgroup will wait for a lower priority one to finish. Only when both occur at the same time the higher priority is executed first.

    With same maingroup number and same subgroup number the lower numbered interrupt according the default interrupt table is executed first when both occurr at the same moment.

    Thanks for listening...

    Henk

Reply
  • Hi,

    Well I studied the documentation a little more and read some test results on interrupt tests I had executed some time agoo. So I write down a summary to not forget it.

    For clarity:
    Pre-emptying means one interrupt interrupting another active interrupt.
    Non pre-emptying means one interrupt waits for another active interrupt to finish.

    There is no such thing as 'initialized' or 'uninitialized' interrupt. ;-)

    There are only 5 sets (numbered 3,4,5,6,7) of maingroup/subgroup priority combinations.

    Only 1 set out of 5 can be selected and applies to all relevant interrupts.

    A set contains 4 bits.

    For example set number 3 allows any interrupt being a member of 1 out of 4 different maingroups (selectable by highest 2 bits) and being a member of 1 out of 4 different subgroups (selectable by lower 2 bits).

    If interrupt A is a member of a higher priority maingroup (lower maingroup value) than interrupt B then interrupt A will pre-empty interrupt B.

    If interrupt A is a member of a lower priority maingroup (higher maingroup value) than interrupt B then interrupt A will wait until interrupt B has finished.

    Only maingroup priority uses pre-emptying.

    Subgroup priority never uses pre-emptying but waits for interrupts being finished.

    Within the same maingroup a higer priority subgroup will wait for a lower priority one to finish. Only when both occur at the same time the higher priority is executed first.

    With same maingroup number and same subgroup number the lower numbered interrupt according the default interrupt table is executed first when both occurr at the same moment.

    Thanks for listening...

    Henk

Children
No data