Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - pidin irq reporting strange IRQ number: (6 Items)
   
pidin irq reporting strange IRQ number  
Hello. I am working with the Xilinx ZCU104 using the most recent QNX 7.1 BSP.

We have set up the GPIO to read on one of the PMOD's a 3.3v PPS from a GPS unit. We know that the pulses are arriving as
 we can see them when we poll the appropriate input register bit. We have enabled the interrupt for that bit.

The IRQ I need to attach to is 48 (0x30). Calls to InterruptAttach() or InterruptAttachEvent() return a valid ID (13 in 
my case) and for all intents and purposes everything is fine. Except the handlers don't catch any interrupt.

A pidin irq shows that the interrupt registered is 200 (0xc8). Not 48.

How can this be? What might be happening to cause this? All the other IRQ's are fine and properly reported by pidin 
(like those used by the I2C and other drivers). Only 48 causes this behaviour.

I'm out of ideas as to how do deal with this. The FPGA (a Xilinx specialist but from the Petalinux world) is also 
scratching his head. We're not sure if it's something we have done on the PL (FPGA) side or not. What could we do there 
to provoke QNX into reporting a different IRQ?

Thanks,

Geoff.
Associations:
wiki1582:
              BuildKernelWithIDE - 111 - asyr aubsd(deleted)
            
Re: pidin irq reporting strange IRQ number  
On that platform, IRQ 48 is what's known as a cascade interrupt. A single interrupt which represents several others 
which are demuxed by specific callouts. You cannot attach directly to it, instead you attach to one of the demuxed 
interrupt vectors (which start at 200 for this particular cascade).
See init_intrinfo.c in your BSP
Re: pidin irq reporting strange IRQ number  
> On that platform, IRQ 48 is what's known as a cascade interrupt. A single 
> interrupt which represents several others which are demuxed by specific 
> callouts. You cannot attach directly to it, instead you attach to one of the 
> demuxed interrupt vectors (which start at 200 for this particular cascade).
> See init_intrinfo.c in your BSP

Thanks for that!

I'll take a look at that file (init_intrinfo.c) over the weekend (it's early Sat morning here) and with the Xilinx FPGA 
guru who is working with me (and knows nothing about QNX)  try and get the GPIO interrupt working on Monday.

Am I correct however in assuming that even though InterruptAttach() returns a valid ID for IRQ 48  there is actually 
more work to be done to get it working? If so, is it likely to be work on the QNX side or FPGA (PL) side? Or both?

It's the first time either of us have had to get this particular GPIO interrupt working with QNX but I gather from what 
you say Petalinux would behave the same way. Is this correct? If so, and we can get that working, it should therefore be
 relatively straight forward to get it working with QNX.

Geoff.
Re: pidin irq reporting strange IRQ number  
It is possible that your Linux distro behaves the same way, e.g. the kernel does the demuxing for you. More likely than 
not, the logical vector numbers are different then. However it is equally possible that in your Linux you must attach to
 the cascade vector and do the demuxing yourself.

Regards,
Al
Re: pidin irq reporting strange IRQ number  
Thanks to the pointer Michael gave me in regards to the cascading interrupts, and reference to init_intrinfo.c, I was 
able to figure it out. It turned out that I had to attach to IRQ 296 - which was a far cry from 48! :-)

It's all working fine now.

So thank you Michael - you have saved me much grief!

Geoff.
Re: pidin irq reporting strange IRQ number  
> It is possible that your Linux distro behaves the same way, e.g. the kernel 
> does the demuxing for you. More likely than not, the logical vector numbers 
> are different then. However it is equally possible that in your Linux you must
>  attach to the cascade vector and do the demuxing yourself.
> 
> Regards,
> Al

I was quite happy to not have to endure the horror of trying to figure out how to do this with Linux! :-) After 35 years
 using QNX I was reticent about having to go there!

Once I was able to figure out which IRQ I needed to map to it was plain sailing and I ended up back in my comfort zone.

Geoff