Doubt about interrupts in xilinx zedboard BSP

Sergio Paracuellos sparacuellos at
Tue Apr 18 07:24:25 UTC 2017

Hi all,

I am trying to exec some code over xilinx-zynq zedboard. The code tries to
make use of interrupts. I am installing the interrupt routine for the
interrupt vector  using rtems_interrupt_handler_install routine which is
seems the correct one for this board. When the interrupt is trigered the
handler is correctly called but it becomes in a infinite loop status when
the interrupt is being handled. So is obvious that i am doing something
wrong. The pseudo code for this is like the following:

#include <bsp.h>
#include <stdlib.h>
#include <rtems/irq.h>
#include <rtems/irq-extension.h>



volatile int seq;

void MyInterruptHandler(void *arg)
    puts("Interrupt handler called\n");

rtems_task Init(rtems_task_argument argument)
    rtems_status_code sc;

    sc = rtems_interrupt_handler_install(
                           (rtems_interrupt_handler) MyInterruptHandler,

     if (sc != RTEMS_SUCCESSFUL)
           puts("MyInterruptHandler -> rtems_interrupt_handler_install()
error: %d\n", sc);

     puts("Waiting for messages...\n");

     /* wait for five interrupts to be triggered */
    while (1)
          if (seq == MAX_NUMBER_OF_MESSAGES)

     puts("Max number of messages retrieved\n");

The result is:

Waiting for messages...

Interrupt handler called
Interrupt handler called
Interrupt handler called
Interrupt handler called
Interrupt handler called
Interrupt handler called
Interrupt handler called

Enters in a infinite loop calling the interrupt handler....

This similar code runs for me in other OS, so i am a little lost. Also, I
couldn't find any example of using interrupts for zedboard.

What is missing in this code?

Thanks in advance,

    Sergio Paracuellos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the users mailing list