Interrupt problem

Hello All,

I am able to attach the interrupt using InterruptAttach(). I am attaching
interrupt number 11, (IRQ 11) , which is an interrupt from external device.

I have created a isr_thread,this is the place where I am attaching
interrupt. I am getting the interrupt at Hardware level which I can see by
using the CRO.
but it is not executing the isr and thus it will be always in
“InterruptWait” state.I am able to acces the device , using mmap() function.
My question is should write a separate resource manager for getting the
interrupt.

here is function source code,

void * isr_thread(void *posixpoo)
{
ThreadCtl(_NTO_TCTL_IO,0);
event.sigev_notify = SIGEV_INTR ;
interruptID =
InterruptAttach(11,isr,NULL,0,_NTO_INTR_FLAGS_TRK_MSK);
if(interruptID = = -1)
printf(“COULD NOT ATTACH INTERRUPTS\n”);
for(;:wink:
{

InterruptWait(0,NULL);
InterruptDisable();
}


}


const struct sigevent *isr(void *arg,int notusedID)
{
return(&event);

}

Please help me,
Thanks in advance.
Rajarama

Rajarama wrote:

Hello All,

I am able to attach the interrupt using InterruptAttach(). I am attaching
interrupt number 11, (IRQ 11) , which is an interrupt from external device.

I have created a isr_thread,this is the place where I am attaching
interrupt. I am getting the interrupt at Hardware level which I can see by
using the CRO.
but it is not executing the isr and thus it will be always in
“InterruptWait” state.I am able to acces the device , using mmap() function.
My question is should write a separate resource manager for getting the
interrupt.

here is function source code,

void * isr_thread(void *posixpoo)
{
ThreadCtl(_NTO_TCTL_IO,0);
event.sigev_notify = SIGEV_INTR ;
interruptID =
InterruptAttach(11,isr,NULL,0,_NTO_INTR_FLAGS_TRK_MSK);
if(interruptID = = -1)
printf(“COULD NOT ATTACH INTERRUPTS\n”);
for(;:wink:
{

InterruptWait(0,NULL);
InterruptDisable();
^^^^^^^^^^^^^^^^^^^

should be —> InterruptUnmask

Regard

Armin


}


}


const struct sigevent *isr(void *arg,int notusedID)
{
return(&event);

}

Please help me,
Thanks in advance.
Rajarama

Hello,

Thanks you. I have tried to use InterruptUnmask,still it’s not working.

Is it necessary to call isr from resource manager?

Thanks

With Regards

Rajarama

“Armin Steinhoff” <a-steinhoff@web.de> wrote in message
news:ce50mq$2br$1@inn.qnx.com

Rajarama wrote:
Hello All,

I am able to attach the interrupt using InterruptAttach(). I am
attaching
interrupt number 11, (IRQ 11) , which is an interrupt from external
device.

I have created a isr_thread,this is the place where I am attaching
interrupt. I am getting the interrupt at Hardware level which I can see
by
using the CRO.
but it is not executing the isr and thus it will be always in
“InterruptWait” state.I am able to acces the device , using mmap()
function.
My question is should write a separate resource manager for getting the
interrupt.

here is function source code,

void * isr_thread(void *posixpoo)
{
ThreadCtl(_NTO_TCTL_IO,0);
event.sigev_notify = SIGEV_INTR ;
interruptID =
InterruptAttach(11,isr,NULL,0,_NTO_INTR_FLAGS_TRK_MSK);
if(interruptID = = -1)
printf(“COULD NOT ATTACH INTERRUPTS\n”);
for(;:wink:
{

InterruptWait(0,NULL);
InterruptDisable();
^^^^^^^^^^^^^^^^^^^
should be —> InterruptUnmask

Regard

Armin


}


}


const struct sigevent *isr(void *arg,int notusedID)
{
return(&event);

}

Please help me,
Thanks in advance.
Rajarama

Rajarama wrote:

Hello,

Thanks you. I have tried to use InterruptUnmask,still it’s not working.

Is it necessary to call isr from resource manager?

No … this is the responsibility of the system.
Please see further comments inline …

Regards

Armin


Thanks

With Regards

Rajarama

“Armin Steinhoff” <> a-steinhoff@web.de> > wrote in message
news:ce50mq$2br$> 1@inn.qnx.com> …

Rajarama wrote:

Hello All,

I am able to attach the interrupt using InterruptAttach(). I am

attaching

interrupt number 11, (IRQ 11) , which is an interrupt from external

device.

  • do you have a PCI ort ISA bus device ?
  • Interrupt sharing by two devices ??
  • x86 processor system ??


    If it is not a x86 system … try to use InterruptAttachEvent.

I have created a isr_thread,this is the place where I am attaching
interrupt. I am getting the interrupt at Hardware level which I can see

by

using the CRO.
but it is not executing the isr and thus it will be always in
“InterruptWait” state.I am able to acces the device , using mmap()

function.

My question is should write a separate resource manager for getting the
interrupt.

here is function source code,

void * isr_thread(void *posixpoo)
{
ThreadCtl(_NTO_TCTL_IO,0);
^^^^^^^^^

doing it it once is enough …

event.sigev_notify = SIGEV_INTR ;
interruptID =
InterruptAttach(11,isr,NULL,0,_NTO_INTR_FLAGS_TRK_MSK);
if(interruptID = = -1)
printf(“COULD NOT ATTACH INTERRUPTS\n”);
for(;:wink:
{

InterruptWait(0,NULL);
InterruptDisable();

^^^^^^^^^^^^^^^^^^^
should be —> InterruptUnmask

InterruptUnmask(11, interruptID) ??

Regard

Armin



}


}


const struct sigevent *isr(void *arg,int notusedID)
{

->> you have to reset the interrupt at hardware level!

return(&event);

}

Please help me,
Thanks in advance.
Rajarama

\

Rajarama <rpuranika@nordson.com> wrote:

Hello All,

I am able to attach the interrupt using InterruptAttach(). I am attaching
interrupt number 11, (IRQ 11) , which is an interrupt from external device.

interrupt. I am getting the interrupt at Hardware level which I can see by
using the CRO.
but it is not executing the isr and thus it will be always in
“InterruptWait” state.I am able to acces the device , using mmap() function.
My question is should write a separate resource manager for getting the
interrupt.

You shouldn’t need a seperate resource manager.

Also, from the code you give, how can you tell that the interrupt
didn’t fire? It looks like your thread will just unblock, disable,
then immediately call InterruptWait() again. So, I would expect it
to always look like it was in InteruptWait() state.

here is function source code,

void * isr_thread(void *posixpoo)
{
ThreadCtl(_NTO_TCTL_IO,0);
event.sigev_notify = SIGEV_INTR ;
interruptID =
InterruptAttach(11,isr,NULL,0,_NTO_INTR_FLAGS_TRK_MSK);
if(interruptID = = -1)
printf(“COULD NOT ATTACH INTERRUPTS\n”);
for(;:wink:
{

InterruptWait(0,NULL);
InterruptDisable();
}



}

Is this a re-typing of the code, or a direct copy into the
editor?

If a direct copy, then the line:

if(interruptID = = -1)

As it doesn’t look syntactically correct.

If a re-typing, then it is hard to know whether there is a problem
or not, because this code looks mostly ok.

Well, doing a InterruptDisable() without doing an explicit matching
InterruptEnable() is bad programming, but the InterruptWait() call
will (as a side-effect) re-enable interrupts as it is a kernel call
(and all kernel calls re-enable interrupts), so this should run
for each interrupt. BUT anytime you looked at it, you would see
it blocked, because if it wasn’t blocked, you wouldn’t be looking
at it – it would be running.

-David

QNX Training Services
http://www.qnx.com/services/training/
Please followup in this newsgroup if you have further questions.

Armin Steinhoff <a-steinhoff@web.de> wrote:

Rajarama wrote:
Hello All,

InterruptAttach(11,isr,NULL,0,_NTO_INTR_FLAGS_TRK_MSK);
if(interruptID = = -1)
printf(“COULD NOT ATTACH INTERRUPTS\n”);
for(;:wink:
{

InterruptWait(0,NULL);
InterruptDisable();
^^^^^^^^^^^^^^^^^^^
should be —> InterruptUnmask

It shouldn’t neccessarily be so. He attached an ISR, not an
event, so he doesn’t need an automatic unmask, as there is no
automatic mask.

(Of course, masking & unmasking the particular interrupt is better
policy than disabling and enabling, and if that is what you meant,
then you are correct.)

-David

QNX Training Services
http://www.qnx.com/services/training/
Please followup in this newsgroup if you have further questions.

I has a similar problem with the parallel port interrupt…

To solve it, I had to press space bar for boot options when I boot up into
QNX, and then disable the PCI Bios Interrupt mapping
thing, I can’t remember what exectly its called :wink:… but it seemed that the
interupts the PCI Bios assigned, were re-assigned by QNX… I’m not sure if
you are using PCI, i assume you are… but try looking under the Disable
enumerators menu in the boot options screen…

I hope this helps…

best regards,
grant



“Rajarama” <rpuranika@nordson.com> wrote in message
news:ce4lic$n2r$1@inn.qnx.com

Hello All,

I am able to attach the interrupt using InterruptAttach(). I am attaching
interrupt number 11, (IRQ 11) , which is an interrupt from external
device.

I have created a isr_thread,this is the place where I am attaching
interrupt. I am getting the interrupt at Hardware level which I can see by
using the CRO.
but it is not executing the isr and thus it will be always in
“InterruptWait” state.I am able to acces the device , using mmap()
function.
My question is should write a separate resource manager for getting the
interrupt.

here is function source code,

void * isr_thread(void *posixpoo)
{
ThreadCtl(_NTO_TCTL_IO,0);
event.sigev_notify = SIGEV_INTR ;
interruptID =
InterruptAttach(11,isr,NULL,0,_NTO_INTR_FLAGS_TRK_MSK);
if(interruptID = = -1)
printf(“COULD NOT ATTACH INTERRUPTS\n”);
for(;:wink:
{

InterruptWait(0,NULL);
InterruptDisable();
}


}


const struct sigevent *isr(void *arg,int notusedID)
{
return(&event);

}

Please help me,
Thanks in advance.
Rajarama