* Two timer in FIQ mode
@ 2004-11-19 10:40 Sicheri Marco
2004-11-19 12:35 ` Andrew Lunn
0 siblings, 1 reply; 7+ messages in thread
From: Sicheri Marco @ 2004-11-19 10:40 UTC (permalink / raw)
To: eCos Dev.List
I all,
I Have the Samsung s3c44b0x.
I'd like use two timer in interrupt mode.
So that i use the TIMER2 and the TIMER3 (use the cyg_interrupt_create()).
First step: run only the timer2 in fiq mode every 1ms. It works ok
Second step: run only the timer3 in fiq mode every 2ms. It works ok
Now: run timer2 in FIQ mode and the timer3 in IRQ mode. They work ok.
But: if i run timer2 in FIQ mode and the timer3 in FIQ mode, they don't
work, and the system is lock.
:-(
Can you help me?
Thanks,
Regards.
Ossequi, (Best Regards/Obrigado)
Marco SICHERI
CTS electronics - R&D Department
phone: +39 0125 235637, +39 0125 235630
e-mail: m.sicheri@ctsgroup.it
http://www.ctsgroup.it
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Two timer in FIQ mode
2004-11-19 10:40 Two timer in FIQ mode Sicheri Marco
@ 2004-11-19 12:35 ` Andrew Lunn
2004-11-19 13:40 ` Mark Salter
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Lunn @ 2004-11-19 12:35 UTC (permalink / raw)
To: Sicheri Marco; +Cc: eCos Dev.List
On Fri, Nov 19, 2004 at 11:43:39AM +0100, Sicheri Marco wrote:
> I all,
> I Have the Samsung s3c44b0x.
> I'd like use two timer in interrupt mode.
> So that i use the TIMER2 and the TIMER3 (use the cyg_interrupt_create()).
>
> First step: run only the timer2 in fiq mode every 1ms. It works ok
> Second step: run only the timer3 in fiq mode every 2ms. It works ok
> Now: run timer2 in FIQ mode and the timer3 in IRQ mode. They work ok.
> But: if i run timer2 in FIQ mode and the timer3 in FIQ mode, they don't
> work, and the system is lock.
FIQ is not heavily used so i would not be supprised if there were a
few bugs remaining. Probably its a reentrance problem, ie handling a
second FIQ will still handling the first. Take a look at vectors.S and
see if you can find such a problem.
Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Two timer in FIQ mode
2004-11-19 12:35 ` Andrew Lunn
@ 2004-11-19 13:40 ` Mark Salter
2004-11-19 13:59 ` Nick Garnett
2004-11-19 14:04 ` Sicheri Marco
0 siblings, 2 replies; 7+ messages in thread
From: Mark Salter @ 2004-11-19 13:40 UTC (permalink / raw)
To: Andrew Lunn; +Cc: Sicheri Marco, eCos Dev.List
On Fri, 2004-11-19 at 07:35, Andrew Lunn wrote:
> On Fri, Nov 19, 2004 at 11:43:39AM +0100, Sicheri Marco wrote:
> > I all,
> > I Have the Samsung s3c44b0x.
> > I'd like use two timer in interrupt mode.
> > So that i use the TIMER2 and the TIMER3 (use the cyg_interrupt_create()).
> >
> > First step: run only the timer2 in fiq mode every 1ms. It works ok
> > Second step: run only the timer3 in fiq mode every 2ms. It works ok
> > Now: run timer2 in FIQ mode and the timer3 in IRQ mode. They work ok.
> > But: if i run timer2 in FIQ mode and the timer3 in FIQ mode, they don't
> > work, and the system is lock.
>
> FIQ is not heavily used so i would not be supprised if there were a
> few bugs remaining. Probably its a reentrance problem, ie handling a
> second FIQ will still handling the first. Take a look at vectors.S and
> see if you can find such a problem.
>
That is probably the case.
It is good to keep in mind that FIQ support in vectors.S simply
uses the same handling as a normal IRQ. There is no advantage to
using an FIQ vs IRQ. The current code was intended to workaround
poorly designed hardware which used the FIQ input for normal
interrupts. Proper FIQ support would need to do something else.
--Mark
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Two timer in FIQ mode
2004-11-19 13:40 ` Mark Salter
@ 2004-11-19 13:59 ` Nick Garnett
2004-11-22 11:03 ` Sicheri Marco
2004-11-19 14:04 ` Sicheri Marco
1 sibling, 1 reply; 7+ messages in thread
From: Nick Garnett @ 2004-11-19 13:59 UTC (permalink / raw)
To: Mark Salter; +Cc: Andrew Lunn, Sicheri Marco, eCos Dev.List
Mark Salter <msalter@redhat.com> writes:
> On Fri, 2004-11-19 at 07:35, Andrew Lunn wrote:
> > On Fri, Nov 19, 2004 at 11:43:39AM +0100, Sicheri Marco wrote:
> > > I all,
> > > I Have the Samsung s3c44b0x.
> > > I'd like use two timer in interrupt mode.
> > > So that i use the TIMER2 and the TIMER3 (use the cyg_interrupt_create()).
> > >
> > > First step: run only the timer2 in fiq mode every 1ms. It works ok
> > > Second step: run only the timer3 in fiq mode every 2ms. It works ok
> > > Now: run timer2 in FIQ mode and the timer3 in IRQ mode. They work ok.
> > > But: if i run timer2 in FIQ mode and the timer3 in FIQ mode, they don't
> > > work, and the system is lock.
> >
> > FIQ is not heavily used so i would not be supprised if there were a
> > few bugs remaining. Probably its a reentrance problem, ie handling a
> > second FIQ will still handling the first. Take a look at vectors.S and
> > see if you can find such a problem.
> >
>
> That is probably the case.
>
> It is good to keep in mind that FIQ support in vectors.S simply
> uses the same handling as a normal IRQ. There is no advantage to
> using an FIQ vs IRQ. The current code was intended to workaround
> poorly designed hardware which used the FIQ input for normal
> interrupts. Proper FIQ support would need to do something else.
To underline this, FIQ is actually more expensive that IRQ because it
converts the state to look like an IRQ and then drops into the IRQ
handler. The intended way of using FIQ was always to either plug a
jump into the hardware FIQ vector, or install a VSR table entry. In
both cases these must point to an assembly routine that then handles
the interrupt and returns, without interacting with the rest of eCos.
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com/ The eCos and RedBoot experts
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Two timer in FIQ mode
2004-11-19 13:40 ` Mark Salter
2004-11-19 13:59 ` Nick Garnett
@ 2004-11-19 14:04 ` Sicheri Marco
2004-11-19 14:12 ` Sicheri Marco
1 sibling, 1 reply; 7+ messages in thread
From: Sicheri Marco @ 2004-11-19 14:04 UTC (permalink / raw)
To: Mark Salter, Andrew Lunn; +Cc: eCos Dev.List
You (Andrew and Mark) wrote:
> On Fri, 2004-11-19 at 07:35, Andrew Lunn wrote:
> > On Fri, Nov 19, 2004 at 11:43:39AM +0100, Sicheri Marco wrote:
> > > I all,
> > > I Have the Samsung s3c44b0x.
> > > I'd like use two timer in interrupt mode.
> > > So that i use the TIMER2 and the TIMER3 (use the
cyg_interrupt_create()).
> > >
> > > First step: run only the timer2 in fiq mode every 1ms. It works ok
> > > Second step: run only the timer3 in fiq mode every 2ms. It works ok
> > > Now: run timer2 in FIQ mode and the timer3 in IRQ mode. They work ok.
> > > But: if i run timer2 in FIQ mode and the timer3 in FIQ mode, they
don't
> > > work, and the system is lock.
> >
> > FIQ is not heavily used so i would not be supprised if there were a
> > few bugs remaining. Probably its a reentrance problem, ie handling a
> > second FIQ will still handling the first. Take a look at vectors.S and
> > see if you can find such a problem.
> >
>
> That is probably the case.
>
> It is good to keep in mind that FIQ support in vectors.S simply
> uses the same handling as a normal IRQ. There is no advantage to
> using an FIQ vs IRQ. The current code was intended to workaround
> poorly designed hardware which used the FIQ input for normal
> interrupts. Proper FIQ support would need to do something else.
>
> --Mark
I'd like use the FIQ vs IRQ because I don't want the variable time between
CPU 'signal' and the interrupt routine.
I check with the oscilloscope two signals: the CPU (CPU timer2 out toggle)
and a IO (PTF4).
In the FIQ mode, the time between these signal is constant (about 7us)
In the IRQ mode, the time between these signal is variable (from 7us to
150us)
This is a problem for my application. For this reason i choose the IRQ.
Now, Could I remove in the IRQ this variable time? Is it possible?
Thanks,
dS, MS.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Two timer in FIQ mode
2004-11-19 14:04 ` Sicheri Marco
@ 2004-11-19 14:12 ` Sicheri Marco
0 siblings, 0 replies; 7+ messages in thread
From: Sicheri Marco @ 2004-11-19 14:12 UTC (permalink / raw)
To: Mark Salter, Andrew Lunn; +Cc: eCos Dev.List
Sorry, I wrote and i misspelled, I want tell this:
I'd like use the FIQ vs IRQ because I don't want the variable time between
CPU 'signal' and the interrupt routine.
I check with the oscilloscope two signals: the CPU (CPU timer2 out toggle)
and a IO (PTF4).
In the FIQ mode, the time between these signal is constant (about 7us)
In the IRQ mode, the time between these signal is variable (from 7us to
150us)
This is a problem for my application. For this reason i choose the FIQ.
Now, Could I remove in the IRQ this variable time? Is it possible?
Thanks,
dS, MS.
>
> You (Andrew and Mark) wrote:
>
> > On Fri, 2004-11-19 at 07:35, Andrew Lunn wrote:
> > > On Fri, Nov 19, 2004 at 11:43:39AM +0100, Sicheri Marco wrote:
> > > > I all,
> > > > I Have the Samsung s3c44b0x.
> > > > I'd like use two timer in interrupt mode.
> > > > So that i use the TIMER2 and the TIMER3 (use the
> cyg_interrupt_create()).
> > > >
> > > > First step: run only the timer2 in fiq mode every 1ms. It works ok
> > > > Second step: run only the timer3 in fiq mode every 2ms. It works ok
> > > > Now: run timer2 in FIQ mode and the timer3 in IRQ mode. They work
ok.
> > > > But: if i run timer2 in FIQ mode and the timer3 in FIQ mode, they
> don't
> > > > work, and the system is lock.
> > >
> > > FIQ is not heavily used so i would not be supprised if there were a
> > > few bugs remaining. Probably its a reentrance problem, ie handling a
> > > second FIQ will still handling the first. Take a look at vectors.S and
> > > see if you can find such a problem.
> > >
> >
> > That is probably the case.
> >
> > It is good to keep in mind that FIQ support in vectors.S simply
> > uses the same handling as a normal IRQ. There is no advantage to
> > using an FIQ vs IRQ. The current code was intended to workaround
> > poorly designed hardware which used the FIQ input for normal
> > interrupts. Proper FIQ support would need to do something else.
> >
> > --Mark
>
> I'd like use the FIQ vs IRQ because I don't want the variable time between
> CPU 'signal' and the interrupt routine.
> I check with the oscilloscope two signals: the CPU (CPU timer2 out toggle)
> and a IO (PTF4).
> In the FIQ mode, the time between these signal is constant (about 7us)
> In the IRQ mode, the time between these signal is variable (from 7us to
> 150us)
> This is a problem for my application. For this reason i choose the IRQ.
> Now, Could I remove in the IRQ this variable time? Is it possible?
> Thanks,
> dS, MS.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Two timer in FIQ mode
2004-11-19 13:59 ` Nick Garnett
@ 2004-11-22 11:03 ` Sicheri Marco
0 siblings, 0 replies; 7+ messages in thread
From: Sicheri Marco @ 2004-11-22 11:03 UTC (permalink / raw)
To: eCos Dev.List, eCos Discus.List; +Cc: DAVE - Dave Supp, CTS - Bessolo Mirco
For resolve this problem, we think:
In the vector.S when the interrupt occur, immediately disable all
interrupts.
Could it be right?
Thanks,
dS,
Marco Sicheri.
This is the history:
> Mark Salter <msalter@redhat.com> writes:
>
> > On Fri, 2004-11-19 at 07:35, Andrew Lunn wrote:
> > > On Fri, Nov 19, 2004 at 11:43:39AM +0100, Sicheri Marco wrote:
> > > > I all,
> > > > I Have the Samsung s3c44b0x.
> > > > I'd like use two timer in interrupt mode.
> > > > So that i use the TIMER2 and the TIMER3 (use the
cyg_interrupt_create()).
> > > >
> > > > First step: run only the timer2 in fiq mode every 1ms. It works ok
> > > > Second step: run only the timer3 in fiq mode every 2ms. It works ok
> > > > Now: run timer2 in FIQ mode and the timer3 in IRQ mode. They work
ok.
> > > > But: if i run timer2 in FIQ mode and the timer3 in FIQ mode, they
don't
> > > > work, and the system is lock.
> > >
> > > FIQ is not heavily used so i would not be supprised if there were a
> > > few bugs remaining. Probably its a reentrance problem, ie handling a
> > > second FIQ will still handling the first. Take a look at vectors.S and
> > > see if you can find such a problem.
> > >
> >
> > That is probably the case.
> >
> > It is good to keep in mind that FIQ support in vectors.S simply
> > uses the same handling as a normal IRQ. There is no advantage to
> > using an FIQ vs IRQ. The current code was intended to workaround
> > poorly designed hardware which used the FIQ input for normal
> > interrupts. Proper FIQ support would need to do something else.
>
> To underline this, FIQ is actually more expensive that IRQ because it
> converts the state to look like an IRQ and then drops into the IRQ
> handler. The intended way of using FIQ was always to either plug a
> jump into the hardware FIQ vector, or install a VSR table entry. In
> both cases these must point to an assembly routine that then handles
> the interrupt and returns, without interacting with the rest of eCos.
>
> --
> Nick Garnett eCos Kernel Architect
> http://www.ecoscentric.com/ The eCos and RedBoot experts
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-11-22 11:03 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-19 10:40 Two timer in FIQ mode Sicheri Marco
2004-11-19 12:35 ` Andrew Lunn
2004-11-19 13:40 ` Mark Salter
2004-11-19 13:59 ` Nick Garnett
2004-11-22 11:03 ` Sicheri Marco
2004-11-19 14:04 ` Sicheri Marco
2004-11-19 14:12 ` Sicheri Marco
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).