I have started using ARM Cortex M0+ for GPIO Interrupts. I want to disable nesting feature from ARM Interrupts. Is there any way to do it.? I know by default, nesting is enabled in ARM, I want to disable it.
1 Answers
4
votes
ARM Cortex-M0/M0+ do not support interrupt priority grouping into preemption priority(nestable) and sub-priority (non-nestable) available on the M3/M4/M7 for example.
If you wish to prevent interrupt nesting; it would be necessary to either;
- set all interrupts to the same priority, or
- disable and re-enable interrupts on entry and exit to all handlers.
The first of these options is the simplest, but gives no control over execution order (which seldom matters for asynchronous events, but may lead to non-deterministic behaviour and timing). The second does not actually prevent nesting, but does allow nesting only before the lower-priority interrupt has disabled the interrupts - before it has started processing the actual event. The result is behaviour similar to that of sub-priorities available on Cortex-M3 etc.
M0+
without some significant contortions. Multiple different interrupt handlers, say on two GPIO ports, may preempt each other if the preempting interrupt source has been set to a higher priority. By default are all configured for the same priority level however and so this should not happen unless you've opted in. – doynax