Other Parts Discussed in Thread: HALCOGEN
Hi,
I can't post my code here, but I will try to explain my scenario and I'd like to ask if this is a valid scenario or not. Our project has 2 interrupts (IRQ and FIQ). The IRQ (RTI - compare 1) runs every 1 millisecond and the FIQ (RTI - compare 0) runs every 125 microseconds. The 1ms interrupt takes more than 200 us to finish its execution and it eventually uses the emulated eeprom code provided by ti (FAPI). The diagram below shows how they are related by:
The X represents the CPU processing. As you can see, sometimes the IRQ can be interrupted by the FIQ and when it occurs, the FIQ process its code, returns, but the interrupt stack related to the IRQ is corrupted and at the return of the IRQ, the system crashes. It seems to me the FIQ, for some reason, is destroying the stack saved by the IRQ.
Questions:
- Does the FAPI support being interrupted by FIQ when it is running in the interrupt service called by an IRQ?
- Is the approach (FIQ+IRQ) mentioned above a valid one?
PS: If I modify the code, changing the FIQ to IRQ and using the code provided by TI which allows the IRQ to be preempted by another IRQ of high priority, the problem doesn't manifest, it runs as expected.
Kind Regards,
Thiago Esteves
