/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / Interrupt preemption - is it implemented in STM32?

Username:     
Password:     
             

Forum

# 1   2011-04-16 17:17:48 Interrupt preemption - is it implemented in STM32?

pfandler
Member
From: Hungary
Registered: 2011-02-16
Posts: 26

Interrupt preemption - is it implemented in STM32?

Hi,

The "Insider's Guide To The STM32 ARM Based Microcontroller An Engineer's Introduction To The STM32 Series Version 1.8" doc writes this:

"2.4.5.2.1 Interrupt Pre-emption

The NVIC is also designed to allow high priority interrupts to pre-empt a currently running low priority interrupt. In this case the running interrupt is halted and a new stack frame is saved in the standard 12 cycles after which the high priority interrupt runs. When the priority interrupt is finished, the stack is automatically POPed and the low priority interrupt can resume execution."

However, there is no word about interrupt pre-emption in the STM32 reference manuals, nor in the MCU data sheets.

I also tried to get the interrupt preemption work, but without success. Here is a 1 year old unanswered question in the ST forum:

https://my.st.com/public/STe2ecommuniti … ?tags=nvic preemption priority interrupt

So the question is if interrupt preemption is implemented in STM32, or not? How can I get it work?

Thanks, Peter

Last edited by pfandler (2011-04-16 17:19:35)

Offline

 

# 2   2011-04-17 09:05:46 Interrupt preemption - is it implemented in STM32?

ntrf.zns
Member
From: Belgorod, Russia
Registered: 2009-11-01
Posts: 134

Re: Interrupt preemption - is it implemented in STM32?

Interrupt proirities are described in PM0056 "STM32F10xxx Cortex-M3 programming manual". See pages 35-36.

In short:
- The lowest priority value has highest priority.
- Priority grouping determines position of decimal point. NVIC_PriorityGroup_4 means divide priority value by 4 to get priority group.
- ONLY priority group is used for preemption. The rest of the value only determines the order of pending interrupts being handled.
- If two interrupts have the same priority the one that has smaller number is handled first.
- Decision on interrupt preemption is made during 6 cycles when stack is being saved.
- System exceprions are allways preempting other interrupts.

In your message on st forums you have the same interrupt priority group because you need to set priority grouping BEFORE configuring each interrupt.

Offline

 

# 3   2011-04-18 13:02:49 Interrupt preemption - is it implemented in STM32?

pfandler
Member
From: Hungary
Registered: 2011-02-16
Posts: 26

Re: Interrupt preemption - is it implemented in STM32?

Thanks very much, it is a good reference!

Offline

 

# 4   2011-04-19 06:23:03 Interrupt preemption - is it implemented in STM32?

yrt
Administrator
From: Grenoble-France
Registered: 2008-06-11
Posts: 520
Website

Re: Interrupt preemption - is it implemented in STM32?

You can also take a look at the example provided by the ST library : NVIC/Priority.

Offline

 

Board footer