element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet & Tria Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Avnet Boards General Enable interrupt with Vivado
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 4 replies
  • Subscribers 354 subscribers
  • Views 1011 views
  • Users 0 members are here
Related

Enable interrupt with Vivado

Former Member
Former Member over 12 years ago

Hello,

I'm trying to use interrupt from a custom IP.

I have enable the Fabric Interrupt on the customize IP of the Zynq. I have a pin on my Block Design and I can connect my interrupt source.

But when I export my design to SDK and create a BSP I have nothing about interrupt on my xparameter.h
Only SCUGIC Base address but nothing about interrupt ID or Handler like we can see on Lab06.

Have I missed something ?

Thank a lot for reply.

Mau00EFck

  • Sign in to reply
  • Cancel
  • Former Member
    0 Former Member over 12 years ago

    The only thik I messed is the new Vivado version.

    Evevry think work fine with Vivado 2013.4

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to Former Member

    Since it works, could please provide a sample of your SDK code where you setup the interuupt and connect the handler.
    Thanks.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago

    Every think work with he timer IP provided by Xilinx. But with my custome IP I have my interruption on the definition of the xparameter.h but nothing for the Cononical definition. So the interruption is not catched on the programm...

    I can't find a solution.

    I find how to add interrupt port on vivado but I don't know wich parameter I have to add...

    Maybe a bug on Vivado, I don't know...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago

    I have the same problem.
    In XPS Release Version 14.4 i create my periphiral (AXI_Lite) and add vhdl-code in user_logic (simple counter) ,when counter = X"1000" i set interrupt signal Half_cnt_IRQ <= '1';

    In MPD i add:
    PORT Half_cnt_IRQ= "", DIR = O, SIGIS = INTERRUPT, SENSITIVITY = EDGE_RISING

    This port i connect to IRQ_F2P.
    In my xparameters i see code:
    /******************************************************************/

    /* Definitions for Fabric interrupts connected to ps7_scugic_0 */
    #define XPAR_FABRIC_AXI_GPIO_0_IP2INTC_IRPT_INTR 91
    #define XPAR_FABRIC_CORE_CONNECTION_0_HALF_CNT_IRQ_INTR 90

    /******************************************************************/

    /* Canonical definitions for Fabric interrupts connected to ps7_scugic_0 */
    #define XPAR_FABRIC_GPIO_0_VEC_ID XPAR_FABRIC_AXI_GPIO_0_IP2INTC_IRPT_INTR

    /******************************************************************/
    In SDK v.14.4 code:
    Interrupt from switches work fine (i comment this code now), counter write in memory - OK, but interrupt don't working.


    #define SWITCH_INTERRUPTt1
    #define SWs_DEVICE_IDttXPAR_AXI_GPIO_0_DEVICE_ID
    /******************INTERRUPT*************************/
    #define GIC_INTCtttttXScuGic
    #define GIC_INTC_HANDLERtttXScuGic_InterruptHandler
    #define GIC_INTC_DEVICE_ID      tXPAR_PS7_SCUGIC_0_DEVICE_ID
    #define CNT_INTC_VEC_IDttttXPAR_FABRIC_CORE_CONNECTION_0_HALF_CNT_IRQ_INTR
    #define SWs_INTERRUPT_IDtttXPAR_FABRIC_GPIO_0_VEC_ID
    /*-----------------------------------------------------------*/
    static GIC_INTC Intc;
    XGpio tttGpioSW; ttt/* The Instance of the AXI GPIO Driver */

    static void prvTest( void *pvParameters );
    u32 cnt_buf[2048];
    u32 DataIn[2048] __attribute__ ((aligned (32), section(".buffer")));
    int Status;
    u8 interrupt_flag = 0;

    int main( void )
    {
    tStatus += XGpio_Initialize(&GpioSW, SWs_DEVICE_ID);
    tif (Status != XST_SUCCESS) {
    ttreturn XST_FAILURE;
    t}
    tStatus += SetupInterruptSystemGIC();
    tenable_interrupts();

    tprvInitializeExceptions();
    t// Start tasks
    txTaskCreate( prvTest, ( signed char * ) "Test_msg", configMINIMAL_STACK_SIZE, NULL, test_TASK_PRIORITY, NULL );
    t// Start the tasks and timer running.
    tvTaskStartScheduler();
    twhile (1);
    }

    /*--------------------------TEST-----------------------------*/
    static void prvTest( void *pvParameters )
    {
    txil_printf("Start testing ZedBoardr
    ");
    t// config and start counter
    tCORE_CONNECTION_mWriteReg(XPAR_CORE_CONNECTION_0_BASEADDR, CORE_CONNECTION_SLV_REG0_OFFSET,t21);t// speed writing in bram
    tCORE_CONNECTION_mWriteReg(XPAR_CORE_CONNECTION_0_BASEADDR, CORE_CONNECTION_SLV_REG1_OFFSET,t1);tt// start
    t
    twhile (1)
    t{
    ttif (interrupt_flag == 1)
    tt{
    tttcopy_buff(cnt_buf, DataIn, sizeof(cnt_buf));
    tttinterrupt_flag = 0;
    tt}

    ttif (interrupt_flag == 2)
    tt{
    tttxil_printf("Interrupt switch
    r");
    tttinterrupt_flag = 0;
    tt}
    t}

    }
    void Cnt_Isr(void *InstancePtr)
    {
    tinterrupt_flag = 1;
    }

    int SetupInterruptSystemGIC()
    {
    tint Result;
    tGIC_INTC *IntcInstancePtr = &Intc;
    tXScuGic_Config *IntcConfig;

    tIntcConfig = XScuGic_LookupConfig(GIC_INTC_DEVICE_ID);
    tif (NULL == IntcConfig) {
    ttreturn XST_FAILURE;
    t}
    tResult = XScuGic_CfgInitialize(IntcInstancePtr, IntcConfig,
    tttttIntcConfig->CpuBaseAddress);
    tif (Result != XST_SUCCESS) {
    ttreturn XST_FAILURE;
    t}
    t//XScuGic_SetPriorityTriggerType(IntcInstancePtr, SWs_INTERRUPT_ID, t 0xA0, 0x2);t// always
    tXScuGic_SetPriorityTriggerType(IntcInstancePtr, CNT_INTC_VEC_ID, t 0xA0, 0x3);t// rising edge
    t// Connect the interrupt handler


    t//Result += XScuGic_Connect(IntcInstancePtr, SWs_INTERRUPT_ID,  (Xil_ExceptionHandler)SwitchIsr,t&GpioSW);
    tResult += XScuGic_Connect(IntcInstancePtr, CNT_INTC_VEC_ID,  (Xil_ExceptionHandler)Cnt_Isr,t(void *) 0);

    tif (Result != XST_SUCCESS) {
    ttreturn XST_FAILURE;
    t}

    t//Enable the interrupt for the GPIO, TIMER device.
    t//XScuGic_Enable(IntcInstancePtr, SWs_INTERRUPT_ID);
    tXScuGic_Enable(IntcInstancePtr, CNT_INTC_VEC_ID);

    t// Enable the GPIO channel interrupts so that push  switch
    t//XGpio_InterruptEnable(&GpioSW,  SWITCH_INTERRUPT);
    t//XGpio_InterruptGlobalEnable(&GpioSW);
    t// Initialize the exception table and register the interrupt
    tXil_ExceptionInit();
    tXil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT, (Xil_ExceptionHandler)GIC_INTC_HANDLER, IntcInstancePtr);
    tXil_ExceptionDisable();

    treturn XST_SUCCESS;
    }

    void enable_interrupts()
    {
    tXil_ExceptionEnable();
    treturn;
    }

    void disable_interrupts()
    {
    tXil_ExceptionDisable();
    treturn;
    }

    where I was mistaken ?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube