cancel
Showing results for 
Search instead for 
Did you mean: 

Global/local interrupts in CubeMX?

LMI2
Lead
Posted on September 01, 2015 at 00:51

There is a checkbox named USART1 global inrterrupt in Cube NVIC settings. Are there any local interrupts?

I used settings for F100 cpu.
5 REPLIES 5
Posted on September 01, 2015 at 02:43

What is a local interrupt?

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
LMI2
Lead
Posted on September 01, 2015 at 11:54

A good question. I have no idea, but what are global interrupts then? CubeMX speaks about global interrupts, if there are global interrupts, there must be local ones too?

I hesitated enabling them because I thought that they were surely something special. And surely something which were not needed in my very basic programs. In worst case they would cause strange problems.

stm32cube-t
Senior III
Posted on October 11, 2015 at 22:44

Dear user,

Please refer to interrupt and event section of STM32 MCUs reference manuals for the list of interrupts. Some can be enabled/disabled at a global level via status registers.

LMI2
Lead
Posted on October 13, 2015 at 18:23

This looks like of somekind of documentation bug.

Aren't all interrupts global? And enabling or disabling interrupts has a global effect. That is normal for an interrupt. Now, when ST talks about global interrupts, it means there must be local ones too. The word is interrupt, adding global or local does not make sense.

Edit:''Some can be enabled/disabled at a global level via status registers.'' Again, how can an interrupt be enabled locally?

Posted on October 15, 2015 at 19:03

I'm not sure if you are trolling or trying for the Nobel prize in English syntax 🙂

Think of it like the breaker panel in your house. You have one jeezly big switch that turns off everything and a whole bunch of little switches that turn off the branch lines.

You can turn off the power to your bedroom so you can change a light switch by flicking off a single breaker. You don't have to throw the 200A breaker to your house, you could but it annoys the cat.

With the interrupt structure, you can enable individual interrupts, but if you are not using USB or DMA transaction half complete, you don't enable those interrupts (what you would call local interrupts). If you are getting into a particularly nasty piece of code and you must not be interrupted, you can set the interrupt priorities such that nothing can interrupt you (global). 

You do not want to enable interrupts until your code is ready to handle them, so you may do a global disable until after you are finished booting.

So, local interrupts don't exist if you are expecting them to be like local variables. Global means ALL OF THEM. There is no opposite of global.

Andrei from The Great White North