This is the mail archive of the ecos-devel@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: ARM FIQ handling problem


In case you did not already know, on the ARM7TDMI, there are multiple
register sets, with different registers in use during different CPU states.
(Some registers are shared across states.)

The IRQ state and the FIQ state are separate. They have different stack
pointers and could (if programmed properly) use separate areas of memory for
their stacks. If this is not done, then problems could arise. However, the
ARM won't handle a second interrupt until the first one is acknowledged. The
eCos code might be counting on that. (I have not looked at it.)

Feel free to correct any wrong understanding on my part.

-----Original Message-----
From: ecos-devel-owner@sources.redhat.com
[mailto:ecos-devel-owner@sources.redhat.com] On Behalf Of R&D4
Sent: Thursday, October 28, 2004 9:51 AM
To: eCosDevel
Subject: ARM FIQ handling problem

Hi all,
I'm experiencing some problems in using FIQ and IRQ over and ARM7TDMI.
I have a "slow" (10ms) timer used for eCos scheduling and one, faster 
(100us), used by my application to do its work.
Due realtime constrain of my app I have to treat the faster as FIQ, so it 
is not delayed by others IRQ.

Here is where my problems rise: everything works fine (IRQ and FIQ routine 
are called in the right way) only for a while, after that something goes 
wrong and an undefined exception is rised. The instruction is usually 
placed somewhere in user code (most of times in the thread idle routine).

I have also noticed that when the exception is rised the __exception_stack 
is corrupted.
Please also note that when setting the faster timer as IRQ too there are no 
problems at all...

To me it sounds like there are some problems in the interaction between IRQ 
and FIQ, maybe in some situation that happen only not so often...

I have noticed that FIQ are handled much like IRQ, only with the special 
care of setting FIQ disable flags too.
So them both use the same __exception_stack as temporary stack: what if an 
IRQ is interrupted by a FIQ, which uses the same __exception_stack to save 
its status (or is it impossible to have such a kind of problem due FIQ 
disabling while the IRQ code is using that stack)?

Any clue about where can be the problem?

Thanks in advance!



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]