Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

InterruptInitialize Fails

129 views
Skip to first unread message

shai

unread,
Dec 9, 2007, 7:49:13 AM12/9/07
to
Hi,
I am encountering the following behaviour:
I start an event to wait on later and after that I call to the driver
to set up an interrupt synced with that event (not waiting on the
event yet).

The driver gets a sysIntr using a defined IRQ (the IRQ is supposed to
be OK), and then tries to call InitializeInterrupt with the sysIntr
returned and the event I opened earlier.

For some reason the InterruptInit fails (GetLastError() returns code
87, invalid parameter).

I wanted to see if it fails in the set of (OALIntrEnableIrqs,
BSPIntrEnableIrq) -> (from reading posts here and watching the
callstack I understood that the calling order is as follows -
InterruptInitialize->OEMInterruptEnable->OALIntrEnableIrqs-
>BSPIntrEnableIrq). My problem is that when placing a breakpoint in
either OALIntrEnableIrqs or BSPIntrEnableIrq they dont get hit, and
retailmsgs dont get printed as well, which means to my undrstanding
that they dont get called.

So, what can cause InterruptInitialize to fail before calling these?

Thanks,
Shai

shai

unread,
Dec 9, 2007, 8:13:30 AM12/9/07
to

I forgot to mention this is a PXA27X based platform. and I am using
wince 6.0

shai

unread,
Dec 10, 2007, 6:22:36 AM12/10/07
to
On Dec 9, 3:13 pm, shai <sha...@gmail.com> wrote:
> On Dec 9, 2:49 pm, shai <sha...@gmail.com> wrote:
>
>
>
>
>
> > Hi,
> > I am encountering the following behaviour:
> > I start an event to wait on later and after that I call to the driver
> > to set up an interrupt synced with that event (not waiting on the
> > event yet).
>
> > The driver gets a sysIntr using a defined IRQ (the IRQ is supposed to
> > be OK), and then tries to call InitializeInterrupt with the sysIntr
> > returned and the event I opened earlier.
>
> > For some reason the InterruptInit fails (GetLastError() returns code
> > 87, invalid parameter).
>
> > I wanted to see if it fails in the set of (OALIntrEnableIrqs,
> > BSPIntrEnableIrq) -> (from reading posts here and watching the
> > callstack I understood that the calling order is as follows -
> > InterruptInitialize->OEMInterruptEnable->OALIntrEnableIrqs->BSPIntrEnableIr-q). My problem is that when placing a breakpoint in

>
> > either OALIntrEnableIrqs or BSPIntrEnableIrq they dont get hit, and
> > retailmsgs dont get printed as well, which means to my undrstanding
> > that they dont get called.
>
> > So, what can cause InterruptInitialize to fail before calling these?
>
> > Thanks,
> > Shai
>
> I forgot to mention this is a PXA27X based platform. and I am using
> wince 6.0- Hide quoted text -
>
> - Show quoted text -

Anyone has suggestion where is agood place to start looking?
Thanks,
Shai

Dean Ramsier

unread,
Dec 10, 2007, 8:25:11 AM12/10/07
to
Not much to go wrong. Either the sysintr value you're using is bogus, or
the event is.

--
Dean Ramsier - eMVP
BSQUARE Corporation


"shai" <sha...@gmail.com> wrote in message
news:2e9e01ab-99e9-4e36...@b1g2000pra.googlegroups.com...

shai

unread,
Dec 12, 2007, 9:19:20 AM12/12/07
to
On Dec 10, 3:25 pm, "Dean Ramsier" <ramsiernos...@nospam.com> wrote:
> Not much to go wrong. Either the sysintr value you're using is bogus, or
> the event is.
>
> --
> Dean Ramsier - eMVP
> BSQUARE Corporation
>
> "shai" <sha...@gmail.com> wrote in message
>
> news:2e9e01ab-99e9-4e36...@b1g2000pra.googlegroups.com...
>
>
>
> > On Dec 9, 3:13 pm, shai <sha...@gmail.com> wrote:
> >> On Dec 9, 2:49 pm, shai <sha...@gmail.com> wrote:
>
> >> > Hi,
> >> > I am encountering the following behaviour:
> >> > I start an event to wait on later and after that I call to the driver
> >> > to set up an interrupt synced with that event (not waiting on the
> >> > event yet).
>
> >> > The driver gets a sysIntr using a defined IRQ (the IRQ is supposed to
> >> > be OK), and then tries to call InitializeInterrupt with the sysIntr
> >> > returned and the event I opened earlier.
>
> >> > For some reason the InterruptInit fails (GetLastError() returns code
> >> > 87, invalid parameter).
>
> >> > I wanted to see if it fails in the set of (OALIntrEnableIrqs,
> >> > BSPIntrEnableIrq) -> (from reading posts here and watching the
> >> > callstack I understood that the calling order is as follows -
> >> > InterruptInitialize->OEMInterruptEnable->OALIntrEnableIrqs->BSPIntrEnableIr--q).

> >> > My problem is that when placing a breakpoint in
>
> >> > either OALIntrEnableIrqs or BSPIntrEnableIrq they dont get hit, and
> >> > retailmsgs dont get printed as well, which means to my undrstanding
> >> > that they dont get called.
>
> >> > So, what can cause InterruptInitialize to fail before calling these?
>
> >> > Thanks,
> >> > Shai
>
> >> I forgot to mention this is a PXA27X based platform. and I am using
> >> wince 6.0- Hide quoted text -
>
> >> - Show quoted text -
>
> > Anyone has suggestion where is agood place to start looking?
> > Thanks,
> > Shai- Hide quoted text -

>
> - Show quoted text -

Problem solved!
I was sure at first I had a problem with the SYSINTR I was using, but
it turned out to be the event handle. I used a driver from CE 5 and an
application was supplying the event handle for me, so as you can guess
interruptinitialzie failed because the pointer was bogus in the
driver's context.

using the post:
http://groups.google.com/group/microsoft.public.windowsce.platbuilder/browse_thread/thread/63a4495704f113af/e11f31bfa5be37c2?lnk=st&q=duplicatehandle+wince#e11f31bfa5be37c2

I fixed it (hopefully next time I encounter this stuff I'll know
better... What can you do - I am new to this stuff)

Thanks,
Shai

shai

unread,
Dec 13, 2007, 3:56:57 AM12/13/07
to
On Dec 12, 4:19 pm, shai <sha...@gmail.com> wrote:
> On Dec 10, 3:25 pm, "Dean Ramsier" <ramsiernos...@nospam.com> wrote:
>
>
>
>
>
> > Not much to go wrong. Either the sysintr value you're using is bogus, or
> > the event is.
>
> > --
> > Dean Ramsier - eMVP
> > BSQUARE Corporation
>
> > "shai" <sha...@gmail.com> wrote in message
>
> >news:2e9e01ab-99e9-4e36...@b1g2000pra.googlegroups.com...
>
> > > On Dec 9, 3:13 pm, shai <sha...@gmail.com> wrote:
> > >> On Dec 9, 2:49 pm, shai <sha...@gmail.com> wrote:
>
> > >> > Hi,
> > >> > I am encountering the following behaviour:
> > >> > I start an event to wait on later and after that I call to the driver
> > >> > to set up an interrupt synced with that event (not waiting on the
> > >> > event yet).
>
> > >> > The driver gets a sysIntr using a defined IRQ (the IRQ is supposed to
> > >> > be OK), and then tries to call InitializeInterrupt with the sysIntr
> > >> > returned and the event I opened earlier.
>
> > >> > For some reason the InterruptInit fails (GetLastError() returns code
> > >> > 87, invalid parameter).
>
> > >> > I wanted to see if it fails in the set of (OALIntrEnableIrqs,
> > >> > BSPIntrEnableIrq) -> (from reading posts here and watching the
> > >> > callstack I understood that the calling order is as follows -
> > >> >InterruptInitialize->OEMInterruptEnable->OALIntrEnableIrqs->BSPIntrEnableIr---q).

> > >> > My problem is that when placing a breakpoint in
>
> > >> > either OALIntrEnableIrqs or BSPIntrEnableIrq they dont get hit, and
> > >> > retailmsgs dont get printed as well, which means to my undrstanding
> > >> > that they dont get called.
>
> > >> > So, what can causeInterruptInitializeto fail before calling these?

>
> > >> > Thanks,
> > >> > Shai
>
> > >> I forgot to mention this is a PXA27X based platform. and I am using
> > >> wince 6.0- Hide quoted text -
>
> > >> - Show quoted text -
>
> > > Anyone has suggestion where is agood place to start looking?
> > > Thanks,
> > > Shai- Hide quoted text -
>
> > - Show quoted text -
>
> Problem solved!
> I was sure at first I had a problem with the SYSINTR I was using, but
> it turned out to be the event handle. I used a driver from CE 5 and an
> application was supplying the event handle for me, so as you can guess
> interruptinitialzie failed because the pointer was bogus in the
> driver's context.
>
> using the post:http://groups.google.com/group/microsoft.public.windowsce.platbuilder...

>
> I fixed it (hopefully next time I encounter this stuff I'll know
> better... What can you do - I am new to this stuff)
>
> Thanks,
> Shai- Hide quoted text -
>
> - Show quoted text -

Just wanted to put it together for the next newbie to come:
steps to setup interrupts in drivers:

1. call KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR)
2. call InterruptInitialize with the sysintr recieved (use
DuplicateHandle() if you recieved the handle from a user) - another
reason for this to fail with errorCode 87 (invalid parameter) is if
you didnt release the sysIntr properly before
--when done do the following
3.InterruptDisable(SysIntr)
4.KernelIoControl(IOCTL_HAL_RELEASE_SYSINTR)

now it is possible to close the event.

That's it I think.

Shai

prasan...@gmail.com

unread,
Dec 24, 2007, 8:48:06 AM12/24/07
to
Hi All,

I am trying to write an IST(interrupt service thread) for soft-reboot
on Windows Mobile 5 devices.

Could anybody please help me out ?

The call to InterruptInitialize() fails.

Also did anybody know the IRQ for Hard-Reboot....

Please provide me the IRQ list / SYSINTR list.

Thanks,
Prasant

shai

unread,
Dec 25, 2007, 4:07:38 AM12/25/07
to

Why does the call fail?

Bruce Eitman [eMVP]

unread,
Dec 25, 2007, 7:37:15 PM12/25/07
to
That typically isn't an interrupt event. If it is for you CPU, the
infomation would be in the datasheet and your BSP.

--
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net

Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member

<prasan...@gmail.com> wrote in message
news:744fee6b-9617-4ff8...@e23g2000prf.googlegroups.com...

0 new messages