<?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>S32 SDKのトピックLPUART transmit and receive data inside an interrupt</title>
    <link>https://community.nxp.com/t5/S32-SDK/LPUART-transmit-and-receive-data-inside-an-interrupt/m-p/748880#M328</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I m designing an event driven packet handler using LPUART and processor expert. I have two packet ques for transmission and reception. I have configured DMA to transfer packets. for example&lt;/P&gt;&lt;P&gt;void on_tx_complete(void *driverState, uart_event_t event, void *userData)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;GetPacketFromQue(&amp;amp;&lt;SPAN&gt;txbuff&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;LPUART_DRV_SendData(INST_LPUART1, (uint8_t *)txbuff, strlen(welcomeMsg));&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this is not working. But when i do it in the main loop, it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the same problem for reception. I have called&amp;nbsp;LPUART_DRV_ReceiveData(INST_LPUART1, &amp;amp;rx_byte, 1UL); in the main loop to enable reception in interrupt. So i get the first byte inside the interrupt. But then i call&amp;nbsp;&lt;SPAN&gt;LPUART_DRV_ReceiveData(INST_LPUART1, &amp;amp;rx_byte, 1UL);&amp;nbsp; inside the interrupt. it hangs and continuously executing the interrupt.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void on_rx_complete(void *driverState, uart_event_t event, void *userData)&lt;BR /&gt;{&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;LPUART_DRV_ReceiveData(INST_LPUART1, &amp;amp;rx_byte, 1UL);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But as long as in call this inside the main loop it works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one help me on this. I want to build it in event driven mode. I want to enable reception and transmit data inside interrupts. Can you provide me an example or some guidance. I have attached the project below. I m using S32 DS and S32K144_SDK_gcc v0.8.6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 12 May 2018 05:21:01 GMT</pubDate>
    <dc:creator>kasundinesh</dc:creator>
    <dc:date>2018-05-12T05:21:01Z</dc:date>
    <item>
      <title>LPUART transmit and receive data inside an interrupt</title>
      <link>https://community.nxp.com/t5/S32-SDK/LPUART-transmit-and-receive-data-inside-an-interrupt/m-p/748880#M328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I m designing an event driven packet handler using LPUART and processor expert. I have two packet ques for transmission and reception. I have configured DMA to transfer packets. for example&lt;/P&gt;&lt;P&gt;void on_tx_complete(void *driverState, uart_event_t event, void *userData)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;GetPacketFromQue(&amp;amp;&lt;SPAN&gt;txbuff&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;LPUART_DRV_SendData(INST_LPUART1, (uint8_t *)txbuff, strlen(welcomeMsg));&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this is not working. But when i do it in the main loop, it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the same problem for reception. I have called&amp;nbsp;LPUART_DRV_ReceiveData(INST_LPUART1, &amp;amp;rx_byte, 1UL); in the main loop to enable reception in interrupt. So i get the first byte inside the interrupt. But then i call&amp;nbsp;&lt;SPAN&gt;LPUART_DRV_ReceiveData(INST_LPUART1, &amp;amp;rx_byte, 1UL);&amp;nbsp; inside the interrupt. it hangs and continuously executing the interrupt.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void on_rx_complete(void *driverState, uart_event_t event, void *userData)&lt;BR /&gt;{&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;LPUART_DRV_ReceiveData(INST_LPUART1, &amp;amp;rx_byte, 1UL);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But as long as in call this inside the main loop it works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one help me on this. I want to build it in event driven mode. I want to enable reception and transmit data inside interrupts. Can you provide me an example or some guidance. I have attached the project below. I m using S32 DS and S32K144_SDK_gcc v0.8.6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 May 2018 05:21:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-SDK/LPUART-transmit-and-receive-data-inside-an-interrupt/m-p/748880#M328</guid>
      <dc:creator>kasundinesh</dc:creator>
      <dc:date>2018-05-12T05:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: LPUART transmit and receive data inside an interrupt</title>
      <link>https://community.nxp.com/t5/S32-SDK/LPUART-transmit-and-receive-data-inside-an-interrupt/m-p/748881#M329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually i fixed it by editing the lpuart_driver.c&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/28083i27832F3D78FBECDE/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Earlier it was under the callback function. But after i moved it above, it started working. Is there a specific reason to do it after the callback. Or was it designed to used with RTOS. Or is there any other workarounds for this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 May 2018 05:51:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-SDK/LPUART-transmit-and-receive-data-inside-an-interrupt/m-p/748881#M329</guid>
      <dc:creator>kasundinesh</dc:creator>
      <dc:date>2018-05-12T05:51:50Z</dc:date>
    </item>
  </channel>
</rss>

