AnsweredAssumed Answered

Interrupt Nesting on STM32F3Discovery

Question asked by keepcoding on May 30, 2014
Latest reply on May 30, 2014 by sung.chen_chung
Hi

Is there a way to disable interrupt nesting (preemption) on the STM32F3Discovery? By default, an interrupt seems to preempt a currently executing ISR. But I want the ISRs (especially those of DMA and EXTI interrupts) to be executed atomically. How can I achieve this?

Thanks
keepcoding


[edit] ok, I just found something:
// code before critical section
__set_BASEPRI(6 << (8 - __NVIC_PRIO_BITS));
// critical section
__set_BASEPRI(0U); // remove the BASEPRI masking
// code after critical section

So it looks like there is no such thing as atomicity in an ISR on the STM32 without disabling interrupts manually. Question: Do I potentially miss an interrupt during the time span when the interrupts are disabled or will it just be serviced after the ISR (when interrupts are reenabled)?

Outcomes