I am using Aurix Tricore TC27x board. Here I am using two interrupts, one interrupt will occur for every 5us(High Priority) and another interrupt will occur for every 100us(Low Priority). The time for executing the 100us(Low Priority) interrupt is 40us, so while executing the 100us(Low Priority) interrupt if 5us(High Priority) interrupt comes context switching is not happening.
After completing the Low priority interrupt then only switching is happening to High Priority interrupt. Because of this I lost data.
Why it is not preempted?
Thanks in Advance.
As Martin James already mentioned in his comment and Steve Mitchell in his answer, you need to re-enable interrupts in the ISR. In TASKING Compiler, this is done a bit more intuitively with the
__enable_
statement in the function definition:If you don't use the
__enable_
statement, the ISR can't be interrupted, even if it has a lower priority than a more recent priority. After finishing the ISR, the IRQ with the highest priority (=highest number) of all pending IQRs is served.For other compilers read the user manual of your compiler or have a look at the "TriCore TC1.6P & TC1.6E Core Architecture User Manual" from Infineon in the section about the Interrupt System.