cancel
Showing results for 
Search instead for 
Did you mean: 

Interrupt Priority

hervett
Associate II
Posted on November 09, 2008 at 21:04

Interrupt Priority

5 REPLIES 5
hervett
Associate II
Posted on May 17, 2011 at 12:50

Hello everybody,

I have problems with my STM32 with the cinfiguration of my interrupt's prioities.

I have at the same time my RTCinterrupt on for my calendar, my Timer interrupt for generating a signal, and I have too a keyboard. All these things works with interrupt and i don't know how can i configure the priority. RTC must be the first, the Timer the second and my Keyboard the third. Because now, when i test my program ( see attached files ) My RTCinterrupt STOP when I push a button of my keyboard and restart when i stop to push on the button .

And I don't know why. Maybe I Have to disable interrupts before configuring them, but i don't ENABLE them before, just after the configuration.

I can resolve MY problem alone if you tell me how the priority interrupt works.

Really Thank you.

I put my Interuptconfig() and the begining of the main on attached files.

pt1
Associate II
Posted on May 17, 2011 at 12:50

Hi Hervett,

I have the same problem but nobody could solve it. My request is still waiting for solution from raisonance. I've tried several setting of the preemption and the subpriority but nothing works. At the moment it seems

to me that it's a constructional defect of the STM32.

I need that the timer1 interrupt interrupts the usart1 interrupt. But it

don't work.

Best regards Edi

hervett
Associate II
Posted on May 17, 2011 at 12:50

Hello...

I's always glad to know that we are not alone with problems..... and today it is always the same thing so I deleted all the lines in my program tlking about priority and it's half working .....when I push a button on EXTI9_5, RTC don't stop but when I push a button on EXTI10_15, RTC stop.......I think I will change the order of the activation of interupts and I will see.....and I ask again, if someone has documentation I will take them !! and I think PT1 too :D !!

Regards.

pt1
Associate II
Posted on May 17, 2011 at 12:50

Hi Hervett,

oh yeah I'll take it too :-]

Best regards Edi

picguy
Associate II
Posted on May 17, 2011 at 12:50

A few general comments from senior citizen long time software engineer about interrupts. The key is get in and get out quickly.

With that in mind many designs can use a single interrupt priority and work just fine. That’s what I had to do in the days of the 8085. Just get in and get out quickly.

In my big STM32 application the RS-232 LAN has the max priority. Until I revisit the serial port IDLE bit vs. DMA (or use external LAN hardware) I have to take an interrupt per byte. Clever code reduced the ISR overhead to less than 40 total clocks per byte (out of 160 clocks from byte to byte.)

My ADC started from a timer. My interrupt on ADC done had to finish within my 8 KHz ADC sample window. That ISR did little more than stuff bytes into a table.

My 1 KHz timer interrupt timer for my task scheduler had even a lower priority. No big deal.

If your code spends much of its time in an ISR you have to be careful about interrupt priorities. In that case make your fastest interrupt the highest priority.

I had a curious problem with the SVC priority. I hang in my SVC handler looping to find a task to run. With everything at the same priority things hung until I put the SVC priority at the lowest possible level. If my previous sentence “does not compute� then RTFM until it does.

I hate to end by saying RTFM. Read not only the STM32 docs but also the ARM Cortex docs. Keep these handy as you write your application. Don’t use anything you don’t understand. This includes the STM32 interface code, NVIC_InitTypeDef etc.

Three months scratching your head debugging will save you a week of reading the docs.