Doubt about interrupts in xilinx zedboard BSP
Sergio Paracuellos
sparacuellos at orbitalcs.com
Tue Apr 18 08:54:10 UTC 2017
2017-04-18 10:15 GMT+02:00 Thomas Doerfler <
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
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>>:
> >
> > 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>
> > > 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 <mailto:users at rtems.org>
> > 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
> Phone: +49-89-18 94 741-12
> Fax: +49-89-18 94 741-09
> PGP: Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20170418/472c2fe5/attachment-0002.html>
More information about the users
mailing list