<div dir="ltr"><div><div><div><br></div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><table style="font-family:calibri;letter-spacing:normal;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255)" border="0"><tbody><tr><td><br></td><td style="font-size:11px;padding:25px 10px 10px" valign="top"><br></td></tr><tr><td style="font-size:12px;font-family:calibri" colspan="2"><br></td></tr></tbody></table></div></div></div>2017-04-18 9:28 GMT+02:00 Thomas Doerfler <span dir="ltr"><<a target="_blank" href="mailto:thomas.doerfler@embedded-brains.de">thomas.doerfler@embedded-brains.de</a>></span>:<br><div class="gmail_quote"><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">Hi,<br></blockquote><div><br>Hi,<br><br> </div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
<br>
what kind of interrupt source do you have? I assume that the intterrupt<br>
source keeps it interrupt request active, until you have done something<br>
in the interrupt source registers that makes the interrupt inactive again.<br></blockquote><div><br><br>The interrupt is a Software Generated Interrupt one which uses SGI0 HW IRQ.<br><br>The interrupt pending bit for the vector is being cleared in bsp_interrupt_dispatch() routine for the arm's based bsp's. <br><br><div>It should be enough to get this working, but it seems it is not. Something that I have to keep in mind?<br><br></div><br> </div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
<br>
Example: If you interrupt source is a UART receiver, the interrupt<br>
request usually stays active until you have pulled all the received UART<br>
bytes from the UART receive data register...<br>
<br>
wkr,<br>
<br>
Thomas.<br></blockquote><div><br><div>Cheers,<br></div>    Sergio Paracuellos <br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
<div><div class="gmail-h5"><br>
<br>
Am 18.04.2017 um 09:24 schrieb Sergio Paracuellos:<br>
> Hi all,<br>
><br>
> I am trying to exec some code over xilinx-zynq zedboard. The code tries<br>
> to make use of interrupts. I am installing the interrupt routine for the<br>
> interrupt vector  using rtems_interrupt_handler_<wbr>install routine which is<br>
> seems the correct one for this board. When the interrupt is trigered the<br>
> handler is correctly called but it becomes in a infinite loop status<br>
> when the interrupt is being handled. So is obvious that i am doing<br>
> something wrong. The pseudo code for this is like the following:<br>
><br>
> #include <bsp.h><br>
> #include <stdlib.h><br>
> #include <rtems/irq.h><br>
> #include <rtems/irq-extension.h><br>
><br>
> #define MAX_NUMBER_OF_MESSAGES 5<br>
><br>
> #define INTERRUPT_VECTOR_NUMBER 100<br>
><br>
> volatile int seq;<br>
><br>
> void MyInterruptHandler(void *arg)<br>
> {<br>
>     puts("Interrupt handler called\n");<br>
>     seq++;<br>
> }<br>
><br>
> rtems_task Init(rtems_task_argument argument)<br>
> {<br>
>     rtems_status_code sc;<br>
><br>
>     sc = rtems_interrupt_handler_<wbr>install(<br>
>                            INTERRUPT_VECTOR_NUMBER,<br>
>                            "MY_INTERRUPT",<br>
>                            RTEMS_INTERRUPT_UNIQUE,<br>
>                            (rtems_interrupt_handler) MyInterruptHandler,<br>
>                             NULL<br>
>            );<br>
><br>
>      if (sc != RTEMS_SUCCESSFUL)<br>
>      {<br>
>            puts("MyInterruptHandler -> rtems_interrupt_handler_<wbr>install()<br>
> error: %d\n", sc);<br>
>            exit(-1);<br>
>       }<br>
><br>
>      puts("Waiting for messages...\n");<br>
><br>
>      /* wait for five interrupts to be triggered */<br>
>     while (1)<br>
>     {<br>
>           if (seq == MAX_NUMBER_OF_MESSAGES)<br>
>               break;<br>
>      }<br>
><br>
>      puts("Max number of messages retrieved\n");<br>
>      exit(0);<br>
> }<br>
><br>
> The result is:<br>
><br>
> Waiting for messages...<br>
><br>
> Interrupt handler called<br>
> Interrupt handler called<br>
> Interrupt handler called<br>
> Interrupt handler called<br>
> Interrupt handler called<br>
> Interrupt handler called<br>
> Interrupt handler called<br>
> ....<br>
><br>
> Enters in a infinite loop calling the interrupt handler....<br>
><br>
> This similar code runs for me in other OS, so i am a little lost. Also,<br>
> I couldn't find any example of using interrupts for zedboard.<br>
><br>
> What is missing in this code?<br>
><br>
> Thanks in advance,<br>
><br>
> Cheers,<br>
>     Sergio Paracuellos<br>
><br>
><br>
><br>
><br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> users mailing list<br>
> <a href="mailto:users@rtems.org">users@rtems.org</a><br>
> <a target="_blank" rel="noreferrer" href="http://lists.rtems.org/mailman/listinfo/users">http://lists.rtems.org/<wbr>mailman/listinfo/users</a><br>
><br>
<br>
--<br>
------------------------------<wbr>--------------<br>
embedded brains GmbH<br>
Thomas Doerfler<br>
Dornierstr. 4<br>
D-82178 Puchheim<br>
Germany<br>
email: <a href="mailto:Thomas.Doerfler@embedded-brains.de">Thomas.Doerfler@embedded-<wbr>brains.de</a><br>
Phone: <a value="+4989189474112" href="tel:%2B49-89-18%2094%20741-12">+49-89-18 94 741-12</a><br>
Fax:   <a value="+4989189474109" href="tel:%2B49-89-18%2094%20741-09">+49-89-18 94 741-09</a><br>
PGP: Public key available on request.<br>
<br>
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
______________________________<wbr>_________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org">users@rtems.org</a><br>
<a target="_blank" rel="noreferrer" href="http://lists.rtems.org/mailman/listinfo/users">http://lists.rtems.org/<wbr>mailman/listinfo/users</a><br>
</blockquote></div><br></div></div>