解决方案
Nested Interrupts is currently supported in the GIC Interrupt Controller on the Zynq SoC in version 2013.4/14.7. If you are using this version, then proceed to step 3.
If you are using an older version and would like to add nested interrupt capability, then unzip the ZIP file that is attached at the end of this answer record) into your local EDK install directory:
Copy standalone_v3_10_a from 54128.zip to:
<XILINX_EDK>\sw\libs\bsp
Copy scugic_v1_04_a from 54128.zip to:
<XILINX_EDK>\sw\XilinxProcessorIPLib\drivers
Then follow these two steps:
- Create BSP
Create a Board Support Package
In SDK, File -> New -> Board Support Package and select the standalone from the dropdown
Configure the BSP to match your application settings, and make sure that the ps7_scugic_0 driver version is set to 1.04.a:

- Create, or Link your existing application to the newly created BSP.
To link a pre-existing application, right-click on the application, select Properties -> Project References and untick the old BSP and add the newly created BSP allowing Nested Interrupts
- Add Nested Interrupt capability to your application
To allow Nested Interrupts in your application, add the function below during the GIC initialization before XilExceptionInit is called:
XScuGic_CPUWriteReg(IntcInstancePtr, XSCGIC_BIN_PT_OFFSET,0x03);
In the Interrupt handler, the user must ensure that the source of the current interrupt is cleared and enable Nested Interrupts using the function:
Xil_EnableNestInterrupts();
After calling this macro, Nested Interrupts will be allowed. However, only interrupts with higher group priority than the existing interrupt being processed.
The user must include the header file:
#include "xil_exception.h"
Similarily, before exiting the Interrupt handler, the Nested Interrupts must be disabled:
Xil_DisableNestedInterrupts();
Note: Added to this AR there is a nested_interrupt_demo.c that can be used to verify the nested interrupts. To test this create a simple zc702 with two timers on the Zynq SoC Processor Subsystem.
Export to SDK, follow the instructions above. Create an Empty application and import the nested_interrupt_demo.c.