2012-11-13 04:11 AM
Hi all
Can higher priority interrupt interrupts lower priority in his execution? For example. When I am servicing DMA ISR routine with priority 0x01 and EXTI interruption with priority 0x00 if and only if happens. Does it preempt lower priority level ISR immediately or after finishing of that routine. While what I know just SysTick timer does it when it has higher priority then peripheral priority. But between two priorities like DMA and EXTI it was not successful when one of them was higher why? Next one question. I debug my applications with ST-link debugger on STM32F0 discovery board. In my one application I use ordinary delay functions from Discovery tutorial, and decrement TimingDelay variable through SysTick handler. That delay function is used in DMA ISR routine (SysTick interrupt has higher priority than DMA priority). But the problem is that. When I use higher optimization than Level 0 in uVision studio in ''Option for Target'' - ''C/C++'' bookmark, so it creates endless loop in this part of code ''while(TimingDelay != 0);'' even though the variable TimingDelay is already zero value. When I use optimization Level 0 everything works fine. I don't understand why? Thanks for your help.2012-11-13 07:32 AM
Using interrupt driven delays, and long while loops in interrupt code is to be generally avoided.
Check the volatile status of variables removed via optimization.2012-11-13 11:47 AM
Thanks for your help. I suppose that you know interrupt using delays from STM32f0 periph. library. So you know, that the part of function ''while (TimingDelay != 0)'' is not directly in interruption, but it is called from general source file. And just one thing what is done in SysTick interruption is decrementing TimingDelay by one. As I already wrote in my prevoius post that mistake was optimization. I wanted to know why. I think that your second hint should help me, but I don't know how to check volatile status of variables removed via optimization. Try to be more specific please.
Thanks for your help