<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LPC MicrocontrollersのトピックRe: UART interrupt issue</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/UART-interrupt-issue/m-p/948530#M37705</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/nxf46116" rel="nofollow noopener noreferrer" target="_blank"&gt;nxf46116&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your input and I think I managed to get it to work. The application is now running over a day twice, which will not be a use case at all and as a result, I can mark it fixed "for me".&lt;/P&gt;&lt;P&gt;Besides the interrupts of the two UARTs (1) + (2) I have furthermore an interrupt for an input GPIO (3), an interrupt for a PWM (4) and the CAN interrupt which I mentioned above (5). What solved the issue here was changing the interrupt priorities via&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="token function"&gt;NVIC_SetPriority&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; n&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In Detail:&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; width: 52.3179%;"&gt;&lt;THEAD&gt;&lt;TR style="background-color: #efefef; height: 25px;"&gt;&lt;TH style="width: 10%; height: 25px;"&gt;Interrupt&lt;/TH&gt;&lt;TH style="width: 17%; height: 25px;"&gt;priority (erroneous case)&lt;/TH&gt;&lt;TH style="width: 15.6856%; height: 25px;"&gt;priority (working case)&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 10%; height: 25px;"&gt;UART0_IRQn&lt;/TD&gt;&lt;TD style="width: 17%; height: 25px;"&gt;( 0x01&amp;lt;&amp;lt;3 ) | 0x01 = 9&lt;/TD&gt;&lt;TD style="width: 15.6856%; height: 25px;"&gt;14&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 10%; height: 25px;"&gt;UART1_IRQn&lt;/TD&gt;&lt;TD style="width: 17%; height: 25px;"&gt;5&lt;/TD&gt;&lt;TD style="width: 15.6856%; height: 25px;"&gt;14&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 10%; height: 25px;"&gt;EINT2_IRQn&lt;/TD&gt;&lt;TD style="width: 17%; height: 25px;"&gt;5&lt;/TD&gt;&lt;TD style="width: 15.6856%; height: 25px;"&gt;14&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 10%; height: 25px;"&gt;CAN_IRQn&lt;/TD&gt;&lt;TD style="width: 17%; height: 25px;"&gt;2&lt;/TD&gt;&lt;TD style="width: 15.6856%; height: 25px;"&gt;14&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 10%; height: 25px;"&gt;PWM1_IRQn&lt;/TD&gt;&lt;TD style="width: 17%; height: 25px;"&gt;( 0x01&amp;lt;&amp;lt;3 ) | 0x01 = 9&lt;/TD&gt;&lt;TD style="width: 15.6856%; height: 25px;"&gt;14&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not use any priority grouping (pre-empting), however, I cannot explain why this (obviously) fixed my faulty application. Any idea?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Jul 2019 09:01:22 GMT</pubDate>
    <dc:creator>volkerweber</dc:creator>
    <dc:date>2019-07-16T09:01:22Z</dc:date>
    <item>
      <title>UART interrupt issue</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/UART-interrupt-issue/m-p/948525#M37700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am facing a UART interrupt issue with my current setup which occurs not deterministically after a variable period of time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My setup in detail:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;LPC1768&lt;/LI&gt;&lt;LI&gt;FreeRTOS&lt;/LI&gt;&lt;LI&gt;2 UARTs:&lt;UL&gt;&lt;LI&gt;1 UART incoming data with 200 Hz is copied within the ISR into a ringbuffer and processed within a task&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;1 UART as console&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Output over CAN&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What happens (error description):&lt;/STRONG&gt;&lt;BR /&gt;After an undefined period of time (between 30 minutes and several hours) the UART callback related to receiving data is not called anymore. As a result, it seems that no new data is&amp;nbsp;avaiable as the ringbuffer head is not moved anymore. What I can see from the debugger is, that the program is still running. For data incoming with 100 Hz over UART, this issue seems not to occur.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Some things&amp;nbsp;I already tried:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;checked that the interrupt flag for receiving new data is still set&lt;/LI&gt;&lt;LI&gt;increased task stack sizes and ringbuffer size&lt;/LI&gt;&lt;LI&gt;compiled with -fstack-check to check for stack overflows&lt;/LI&gt;&lt;LI&gt;protected the ringbuffer with CRITICAL statements against reading and writing from the ISR and the task&lt;/LI&gt;&lt;LI&gt;checked the receiving data buffer: there is new data available (but the interrupt won't hit)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am running out of ideas how to further deal with this. Any suggestions are appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2019 06:06:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/UART-interrupt-issue/m-p/948525#M37700</guid>
      <dc:creator>volkerweber</dc:creator>
      <dc:date>2019-07-08T06:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: UART interrupt issue</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/UART-interrupt-issue/m-p/948526#M37701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Update: if I remove the terminal task from the application, the program apparently does not crash after a day of running. That seems weird as there is no action on this UART for the whole time. I keep investigating...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jul 2019 09:19:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/UART-interrupt-issue/m-p/948526#M37701</guid>
      <dc:creator>volkerweber</dc:creator>
      <dc:date>2019-07-09T09:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: UART interrupt issue</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/UART-interrupt-issue/m-p/948527#M37702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/volkerweber"&gt;volkerweber&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you let me know which UART (console or the ringbuffer) is the one that is not transmiting after sometime?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also,&amp;nbsp;as a suggestion, is important to use mutex to exclude the usage of the peripherals. Maybe you have a problem&amp;nbsp;with this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jul 2019 20:41:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/UART-interrupt-issue/m-p/948527#M37702</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2019-07-10T20:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: UART interrupt issue</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/UART-interrupt-issue/m-p/948528#M37703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/nxf46116"&gt;nxf46116&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your reply. Unfortunately, both UARTs stop working at the same time and both won't receive any interrupts anymore. Furthermore, I use a GPIO interrupt which also quits.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further investigation results:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;if I remove the console task, the program seems not to crash (as mentioned above)&lt;/LI&gt;&lt;LI&gt;if I remove the preemption bits from any NVIC_SetPriority argument, only the console task and the GPIO interrupt stop working. UART1 (the serial interface for data communication) still works.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attached my UART1 (data communication) implementation, could you please quick-check my UART initialization function (UART1_create)? Many thanks!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jul 2019 05:21:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/UART-interrupt-issue/m-p/948528#M37703</guid>
      <dc:creator>volkerweber</dc:creator>
      <dc:date>2019-07-11T05:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: UART interrupt issue</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/UART-interrupt-issue/m-p/948529#M37704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/volkerweber"&gt;volkerweber&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've checked your implementation in general looks good. Since in the project it seems you use some custom drivers I can say its due to an error configuration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But with the information you provide about the NVIC, I think it could be and error with sincronization from the two UARTs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you check the&amp;nbsp;ISPR bit from the UART1 interruption? If this is set, it means something happens that the interruption wasn't attended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know your findings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jul 2019 01:38:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/UART-interrupt-issue/m-p/948529#M37704</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2019-07-12T01:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: UART interrupt issue</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/UART-interrupt-issue/m-p/948530#M37705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/nxf46116" rel="nofollow noopener noreferrer" target="_blank"&gt;nxf46116&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your input and I think I managed to get it to work. The application is now running over a day twice, which will not be a use case at all and as a result, I can mark it fixed "for me".&lt;/P&gt;&lt;P&gt;Besides the interrupts of the two UARTs (1) + (2) I have furthermore an interrupt for an input GPIO (3), an interrupt for a PWM (4) and the CAN interrupt which I mentioned above (5). What solved the issue here was changing the interrupt priorities via&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="token function"&gt;NVIC_SetPriority&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; n&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In Detail:&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; width: 52.3179%;"&gt;&lt;THEAD&gt;&lt;TR style="background-color: #efefef; height: 25px;"&gt;&lt;TH style="width: 10%; height: 25px;"&gt;Interrupt&lt;/TH&gt;&lt;TH style="width: 17%; height: 25px;"&gt;priority (erroneous case)&lt;/TH&gt;&lt;TH style="width: 15.6856%; height: 25px;"&gt;priority (working case)&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 10%; height: 25px;"&gt;UART0_IRQn&lt;/TD&gt;&lt;TD style="width: 17%; height: 25px;"&gt;( 0x01&amp;lt;&amp;lt;3 ) | 0x01 = 9&lt;/TD&gt;&lt;TD style="width: 15.6856%; height: 25px;"&gt;14&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 10%; height: 25px;"&gt;UART1_IRQn&lt;/TD&gt;&lt;TD style="width: 17%; height: 25px;"&gt;5&lt;/TD&gt;&lt;TD style="width: 15.6856%; height: 25px;"&gt;14&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 10%; height: 25px;"&gt;EINT2_IRQn&lt;/TD&gt;&lt;TD style="width: 17%; height: 25px;"&gt;5&lt;/TD&gt;&lt;TD style="width: 15.6856%; height: 25px;"&gt;14&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 10%; height: 25px;"&gt;CAN_IRQn&lt;/TD&gt;&lt;TD style="width: 17%; height: 25px;"&gt;2&lt;/TD&gt;&lt;TD style="width: 15.6856%; height: 25px;"&gt;14&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 10%; height: 25px;"&gt;PWM1_IRQn&lt;/TD&gt;&lt;TD style="width: 17%; height: 25px;"&gt;( 0x01&amp;lt;&amp;lt;3 ) | 0x01 = 9&lt;/TD&gt;&lt;TD style="width: 15.6856%; height: 25px;"&gt;14&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not use any priority grouping (pre-empting), however, I cannot explain why this (obviously) fixed my faulty application. Any idea?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2019 09:01:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/UART-interrupt-issue/m-p/948530#M37705</guid>
      <dc:creator>volkerweber</dc:creator>
      <dc:date>2019-07-16T09:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: UART interrupt issue</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/UART-interrupt-issue/m-p/948531#M37706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/volkerweber"&gt;volkerweber&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If one of your interruptions happens to often, the lower priority interruption will never happen, I think that's why the UART lost in some point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have in count that the UART doesn't have recovery mechanism, like CAN that will repeat the transmission until some node sends an acknowledge. If you're receiving CAN transmission continuously the other interruptions will not trigger or will be pending until the higher priority interrupts are attended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2019 15:09:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/UART-interrupt-issue/m-p/948531#M37706</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2019-07-16T15:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: UART interrupt issue</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/UART-interrupt-issue/m-p/948532#M37707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/nxf46116"&gt;nxf46116&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your explanation sounds reasonable and could be the root cause of my problem. Anyway, the changes in the priority levels have solved the issue for me. I will now keep in mind&amp;nbsp;that choosing the priority levels of my interrupts is a&amp;nbsp;crucial thing and that the UARTs need more attention towards this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your support Alexis, it was really appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Volker&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jul 2019 07:38:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/UART-interrupt-issue/m-p/948532#M37707</guid>
      <dc:creator>volkerweber</dc:creator>
      <dc:date>2019-07-17T07:38:11Z</dc:date>
    </item>
  </channel>
</rss>

