04-20-2015 01:57 AM
I'm trying to generate two interrupts from custom ip. But the application is getting hanged while enabling interrupts.
To generate interrupts, I followed the below process:
1. In user_logic.vhd file :
Int_Fpga_Ack_1 : out std_logic;
Int_Fpga_Ack_2 : out std_logic;
2. In customip.mpd file, I specified the signals as
PORT Int_Fpga_Ack_1 = "", DIR = O, SIGIS = INTERRUPT, SENSITIVITY = EDGE_RISING, INTERRUPT_PRIORITY = MEDIUM
PORT Int_Fpga_Ack_2 = "", DIR = O, SIGIS = INTERRUPT, SENSITIVITY = EDGE_RISING, INTERRUPT_PRIORITY = MEDIUM
3. In Ports tab, I connected these signals to microblaze_0_intc.
Software side, Idid the following things:
4. My Interrupt handler routines:
xil_printf("\n\r INTERRUPT 1 REGISTERED\n\r");
xil_printf("\n\r INTERRUPT 2 REGISTERED\n\r");
5. In main() function,
XIntc_EnableIntr(XPAR_MICROBLAZE_0_INTC_BASEADDR, XPAR_VOICE_DATA_IP_0_INT_FPGA_ACK_1_MASK |
My application is getting hanged at XIntc_EnableIntr. When I'm commenting this line, application is not getting hanged.
I'm not sure how to resolve this issue.
I have attached system.mhs file for more reference.
Any help will be appreciated.
04-20-2015 05:38 AM
It's generally a bad idea to print from an interrupt handler. Depending on the implementation, it could hang the program or just cause strange interleaved output. How did you determine where the program hanged? If I had to guess it's actually in the interrupt handler and not in the interrupt enable block. If you are debugging with printout, there is the possibility that the program itself is not hanged, but the output is broken because the the attempt to print during the interrupt handling. I'd suggest trying to change the handler to just set a flag (global static variable) and have the main program check the flag and print a message (and then clear the flag) when it sees that the flag has become set. This would tell you if the problem is really in the interrupt handler.
04-20-2015 07:53 AM
I was checking value of IER offset by storing it in a variable.
IER register value after commenting xintc_enable line was 0x000c (since my data width = 32 & two interrupts refer to ethernet & timer interrupts). Even after uncommenting the line, value is 0x000c (means custom ip interrupts did not get enabled) rather than 0x000f.
After uncommenting the line, application got hanged. Print statements within handlers are just for checking whether interrupts got enabled or not.
Is it correct method to directly write to IER register?
Can you suggest something how to resolve the issue.