how to ucos-III zynq gpio interrupt

how to ucos-III zynq gpio interrupt

Home Forums Example Projects how to ucos-III zynq gpio interrupt

This topic contains 5 replies, has 4 voices, and was last updated by 1 year, 2 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #24271

    mike tran

    Hi UCOS,

    Microzed (xc7z020clg400-1),, xilinx vivado/sdk 2016.2

    I am testing gpio interrupt of UCOS-III on Microzed.

    Borrowed xilinx vivado/sdk program (helloworld Adam Taylor Part 13.docx ‏16 KB) from

    However, I have trouble to migrate to UCOS-III, particularly I donot know how to define gpio interrupt in UCOS-III. Reference to AXI Timer 1 from

    I started as follow, but the program kept interrupted even without button-push.

    //Enable interrupts for all the pins in bank 0.
    XGpioPs_SetIntrTypePin(&Gpio, pbsw, XGPIOPS_IRQ_TYPE_EDGE_RISING);

    //Enable the GPIO interrupts of Bank 0.
    XGpioPs_IntrEnablePin(&Gpio, pbsw);

    UCOS_IntVectSet(GPIO_INTERRUPT_ID, 0, DEF_BIT_00, myIntrHandler, &Gpio);

    If I commented out XGpioPs_IntrEnablePin(&Gpio, pbsw); then the program never enter interrupt ISR.

    Please advise, thanks in advance.



    mike tran

    solved problem by myself. why no one touch this post?


    Farukh Chaudhry


    I read your post, but was unable to provide a good reason for your problem. What was the solution?


    mike tran

    Hi Farukh Chaudhry,

    Thank you for your attention.

    The program cannot jump out of ISR routine, which means interrupt Handler needs to clear the interrupt by itself. Therefore, I added XGpioPs_IntrClearPin(&Gpio, pbsw) and solved the problem.

    void myIntrHandler (void *p_arg, CPU_INT32U cpu)
    XGpioPs_IntrClearPin(&Gpio, pbsw);

    OS_ERR os_err;
    printf(“enter interrupt \n\r”);

    OSSemPost(&GPIO1Semaphore, 0, &os_err);




    Monica Yadav

    Hi Mike,

    I am also trying to implement Gpio Interrupt controller using microblaze on ucosii. But I am stuck as the proper documentation of ucos interrupt control driver is not available. Could you please attach your code for the reference.
    I would be very thankful


    hi mike , i don’t work with your processor but i had same problem and i solved but i have a new problem .
    please see this topic thanks 😉

    help about interrupt uc/os 2.91 lpc1768

    anyway , my problem is i can’t use again of interrupt means i can use 1 time then interrupt don’t active again , if i active again OS go to halt ,can you help me?

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

View the complete site map