Doubt about interrupts in xilinx zedboard BSP

Thomas Doerfler Thomas.Doerfler at imd-systems.de
Wed Apr 19 06:12:47 UTC 2017


Hello,

one short request from me: If you got the solution, please post a sketch
of it here. It is good to have this list as a reference not only for
problems, but also for solutions ;-)

Kind regards,

Thomas.

Am 18.04.2017 um 10:54 schrieb Sergio Paracuellos:
> 
> 
> 	
> 
> 2017-04-18 10:15 GMT+02:00 Thomas Doerfler
> <thomas.doerfler at embedded-brains.de
> <mailto:thomas.doerfler at embedded-brains.de>>:
> 
>     Hi,
> 
> 
> Hi,
>  
> 
>     does this link help?
> 
>     https://forums.xilinx.com/t5/Zynq-All-Programmable-SoC/Zynq-Clear-Pending-SGI/td-p/747038
>     <https://forums.xilinx.com/t5/Zynq-All-Programmable-SoC/Zynq-Clear-Pending-SGI/td-p/747038>
> 
> 
> 
> Of course it helps :) Thank you very much. I am going to check this.
> 
>  
> 
> 
> 
>     wkr,
> 
>     Thomas.
> 
> 
> Cheers,
>     Sergio Paracuellos
>  
> 
> 
>     Am 18.04.2017 um 10:11 schrieb Sergio Paracuellos:
>     >
>     >
>     >
>     >
>     >
>     > 2017-04-18 9:28 GMT+02:00 Thomas Doerfler
>     > <thomas.doerfler at embedded-brains.de
>     <mailto:thomas.doerfler at embedded-brains.de>
>     > <mailto:thomas.doerfler at embedded-brains.de
>     <mailto:thomas.doerfler at embedded-brains.de>>>:
>     >
>     >     Hi,
>     >
>     >
>     > Hi,
>     >
>     >
>     >     what kind of interrupt source do you have? I assume that the
>     intterrupt
>     >     source keeps it interrupt request active, until you have done
>     something
>     >     in the interrupt source registers that makes the interrupt
>     inactive
>     >     again.
>     >
>     >
>     >
>     > The interrupt is a Software Generated Interrupt one which uses
>     SGI0 HW IRQ.
>     >
>     > The interrupt pending bit for the vector is being cleared in
>     > bsp_interrupt_dispatch() routine for the arm's based bsp's.
>     >
>     > It should be enough to get this working, but it seems it is not.
>     > Something that I have to keep in mind?
>     >
>     >
>     >
>     >     Example: If you interrupt source is a UART receiver, the interrupt
>     >     request usually stays active until you have pulled all the
>     received UART
>     >     bytes from the UART receive data register...
>     >
>     >     wkr,
>     >
>     >     Thomas.
>     >
>     >
>     > Cheers,
>     >     Sergio Paracuellos
>     >
>     >
>     >
>     >     Am 18.04.2017 um 09:24 schrieb Sergio Paracuellos:
>     >     > 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>
>     >     >
>     >     > #define MAX_NUMBER_OF_MESSAGES 5
>     >     >
>     >     > #define INTERRUPT_VECTOR_NUMBER 100
>     >     >
>     >     > volatile int seq;
>     >     >
>     >     > void MyInterruptHandler(void *arg)
>     >     > {
>     >     >     puts("Interrupt handler called\n");
>     >     >     seq++;
>     >     > }
>     >     >
>     >     > rtems_task Init(rtems_task_argument argument)
>     >     > {
>     >     >     rtems_status_code sc;
>     >     >
>     >     >     sc = rtems_interrupt_handler_install(
>     >     >                            INTERRUPT_VECTOR_NUMBER,
>     >     >                            "MY_INTERRUPT",
>     >     >                            RTEMS_INTERRUPT_UNIQUE,
>     >     >                            (rtems_interrupt_handler)
>     >     MyInterruptHandler,
>     >     >                             NULL
>     >     >            );
>     >     >
>     >     >      if (sc != RTEMS_SUCCESSFUL)
>     >     >      {
>     >     >            puts("MyInterruptHandler ->
>     >     rtems_interrupt_handler_install()
>     >     > error: %d\n", sc);
>     >     >            exit(-1);
>     >     >       }
>     >     >
>     >     >      puts("Waiting for messages...\n");
>     >     >
>     >     >      /* wait for five interrupts to be triggered */
>     >     >     while (1)
>     >     >     {
>     >     >           if (seq == MAX_NUMBER_OF_MESSAGES)
>     >     >               break;
>     >     >      }
>     >     >
>     >     >      puts("Max number of messages retrieved\n");
>     >     >      exit(0);
>     >     > }
>     >     >
>     >     > 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,
>     >     >
>     >     > Cheers,
>     >     >     Sergio Paracuellos
>     >     >
>     >     >
>     >     >
>     >     >
>     >     >
>     >     > _______________________________________________
>     >     > users mailing list
>     >     > users at rtems.org <mailto:users at rtems.org>
>     <mailto:users at rtems.org <mailto:users at rtems.org>>
>     >     > http://lists.rtems.org/mailman/listinfo/users
>     <http://lists.rtems.org/mailman/listinfo/users>
>     >     <http://lists.rtems.org/mailman/listinfo/users
>     <http://lists.rtems.org/mailman/listinfo/users>>
>     >     >
>     >
>     >     --
>     >     --------------------------------------------
>     >     embedded brains GmbH
>     >     Thomas Doerfler
>     >     Dornierstr. 4
>     >     D-82178 Puchheim
>     >     Germany
>     >     email: Thomas.Doerfler at embedded-brains.de
>     <mailto:Thomas.Doerfler at embedded-brains.de>
>     >     <mailto:Thomas.Doerfler at embedded-brains.de
>     <mailto:Thomas.Doerfler at embedded-brains.de>>
>     >     Phone: +49-89-18 94 741-12 <tel:%2B49-89-18%2094%20741-12>
>     <tel:%2B49-89-18%2094%20741-12>
>     >     Fax:   +49-89-18 94 741-09 <tel:%2B49-89-18%2094%20741-09>
>     <tel:%2B49-89-18%2094%20741-09>
>     >     PGP: Public key available on request.
>     >
>     >     Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>     >     _______________________________________________
>     >     users mailing list
>     >     users at rtems.org <mailto:users at rtems.org>
>     <mailto:users at rtems.org <mailto:users at rtems.org>>
>     >     http://lists.rtems.org/mailman/listinfo/users
>     <http://lists.rtems.org/mailman/listinfo/users>
>     >     <http://lists.rtems.org/mailman/listinfo/users
>     <http://lists.rtems.org/mailman/listinfo/users>>
>     >
>     >
> 
>     --
>     --------------------------------------------
>     embedded brains GmbH
>     Thomas Doerfler
>     Dornierstr. 4
>     D-82178 Puchheim
>     Germany
>     email: Thomas.Doerfler at embedded-brains.de
>     <mailto:Thomas.Doerfler at embedded-brains.de>
>     Phone: +49-89-18 94 741-12 <tel:%2B49-89-18%2094%20741-12>
>     Fax:   +49-89-18 94 741-09 <tel:%2B49-89-18%2094%20741-09>
>     PGP: Public key available on request.
> 
>     Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
> 
> 
> 
> 
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users
> 

-- 
IMD Ingenieurbuero fuer Microcomputertechnik
Thomas Doerfler           Herbststrasse 8
D-82178 Puchheim          Germany
email:    Thomas.Doerfler at imd-systems.de
PGP public key available on request



More information about the users mailing list