<?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>Kinetis Software Development Kit中的主题 Terminating LPUART Rx DMA with IDLE/ILIE (for variable length packets)</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Terminating-LPUART-Rx-DMA-with-IDLE-ILIE-for-variable-length/m-p/766911#M7779</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm writing code to support the Modbus RTU protocol with variable-length packets.&amp;nbsp; One of its&amp;nbsp;distinguishing features is that the end of a packet is indicated by a gap (3.5 byte periods) in received data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working with the FRDM KL27Z dev board.&amp;nbsp; I'd like to receive Modbus&amp;nbsp;packets via an LPUART DMA setup, perhaps&amp;nbsp;by modifying&amp;nbsp;the example given in:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {sdk2.2.1}/boards/frdmkl27z/driver_examples/lpuart/dma_transfer/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the length of&amp;nbsp;a Modbus RTU&amp;nbsp;packet isn't known ahead of time, I need a way to stop the DMA at the end of the packet.&amp;nbsp; My&amp;nbsp;thought is to enable the LPUARTx_STAT.IDLE interrupt (by setting LPUARTx_CTRL.ILIE).&amp;nbsp; When I receive that interrupt, it signifies the end of the Modbus packet, so I can&amp;nbsp;stop the DMA reception in progress.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far, I've not gotten it to work -- any pointers or examples would be welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H3 id="toc-hId-1596941953"&gt;What I've tried (and what doesn't work)&lt;/H3&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried adding the following to the lpuart_dma_transfer.c example:&lt;/P&gt;&lt;PRE&gt;void DEMO_LPUART_IRQ_HANDLER(void) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; LPUART_Type *base = DEMO_LPUART;
&amp;nbsp;&amp;nbsp;&amp;nbsp; base-&amp;gt;STAT |= LPUART_STAT_IDLE_MASK;
&amp;nbsp;&amp;nbsp;&amp;nbsp; rxBufferEmpty = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp; rxOnGoing = false;
}&lt;/PRE&gt;&lt;PRE&gt;main() {
&amp;nbsp;&amp;nbsp;&amp;nbsp; ...
&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;LPUART_EnableInterrupts(DEMO_LPUART, &lt;SPAN class=""&gt;kLPUART_IdleLineInterruptEnable&lt;/SPAN&gt;);
&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;EnableIRQ(DEMO_LPUART_IRQn);
&amp;nbsp;&amp;nbsp;&amp;nbsp; ...
}&lt;/PRE&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P&gt;What I observe is that it calls the IRQ_HANDER repeatedly, even though I disable the IDLE interrupt.&amp;nbsp; Within the interrupt, I don't see what is causing the repeated interrupt:&lt;/P&gt;&lt;PRE&gt;&amp;nbsp; &amp;nbsp; base-&amp;gt;BAUD =&amp;nbsp;0x1f20000d
&amp;nbsp; &amp;nbsp; base-&amp;gt;STAT =&amp;nbsp;0x00c00000 

&lt;/PRE&gt;&lt;P&gt;In other words, BAUD has not enabled any interrupts, and STAT indicates TDRE and TC is true but no enabled interrupts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Jan 2018 19:14:03 GMT</pubDate>
    <dc:creator>robertpoor</dc:creator>
    <dc:date>2018-01-05T19:14:03Z</dc:date>
    <item>
      <title>Terminating LPUART Rx DMA with IDLE/ILIE (for variable length packets)</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Terminating-LPUART-Rx-DMA-with-IDLE-ILIE-for-variable-length/m-p/766911#M7779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm writing code to support the Modbus RTU protocol with variable-length packets.&amp;nbsp; One of its&amp;nbsp;distinguishing features is that the end of a packet is indicated by a gap (3.5 byte periods) in received data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working with the FRDM KL27Z dev board.&amp;nbsp; I'd like to receive Modbus&amp;nbsp;packets via an LPUART DMA setup, perhaps&amp;nbsp;by modifying&amp;nbsp;the example given in:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {sdk2.2.1}/boards/frdmkl27z/driver_examples/lpuart/dma_transfer/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the length of&amp;nbsp;a Modbus RTU&amp;nbsp;packet isn't known ahead of time, I need a way to stop the DMA at the end of the packet.&amp;nbsp; My&amp;nbsp;thought is to enable the LPUARTx_STAT.IDLE interrupt (by setting LPUARTx_CTRL.ILIE).&amp;nbsp; When I receive that interrupt, it signifies the end of the Modbus packet, so I can&amp;nbsp;stop the DMA reception in progress.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far, I've not gotten it to work -- any pointers or examples would be welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H3 id="toc-hId-1596941953"&gt;What I've tried (and what doesn't work)&lt;/H3&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried adding the following to the lpuart_dma_transfer.c example:&lt;/P&gt;&lt;PRE&gt;void DEMO_LPUART_IRQ_HANDLER(void) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; LPUART_Type *base = DEMO_LPUART;
&amp;nbsp;&amp;nbsp;&amp;nbsp; base-&amp;gt;STAT |= LPUART_STAT_IDLE_MASK;
&amp;nbsp;&amp;nbsp;&amp;nbsp; rxBufferEmpty = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp; rxOnGoing = false;
}&lt;/PRE&gt;&lt;PRE&gt;main() {
&amp;nbsp;&amp;nbsp;&amp;nbsp; ...
&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;LPUART_EnableInterrupts(DEMO_LPUART, &lt;SPAN class=""&gt;kLPUART_IdleLineInterruptEnable&lt;/SPAN&gt;);
&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;EnableIRQ(DEMO_LPUART_IRQn);
&amp;nbsp;&amp;nbsp;&amp;nbsp; ...
}&lt;/PRE&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P&gt;What I observe is that it calls the IRQ_HANDER repeatedly, even though I disable the IDLE interrupt.&amp;nbsp; Within the interrupt, I don't see what is causing the repeated interrupt:&lt;/P&gt;&lt;PRE&gt;&amp;nbsp; &amp;nbsp; base-&amp;gt;BAUD =&amp;nbsp;0x1f20000d
&amp;nbsp; &amp;nbsp; base-&amp;gt;STAT =&amp;nbsp;0x00c00000 

&lt;/PRE&gt;&lt;P&gt;In other words, BAUD has not enabled any interrupts, and STAT indicates TDRE and TC is true but no enabled interrupts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jan 2018 19:14:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Terminating-LPUART-Rx-DMA-with-IDLE-ILIE-for-variable-length/m-p/766911#M7779</guid>
      <dc:creator>robertpoor</dc:creator>
      <dc:date>2018-01-05T19:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: Terminating LPUART Rx DMA with IDLE/ILIE (for variable length packets)</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Terminating-LPUART-Rx-DMA-with-IDLE-ILIE-for-variable-length/m-p/766912#M7780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;BR /&gt;This is because the demo calls two function LPUART_EnableTxDMA and LPUART_EnableRxDMA. These two functions open RIE and TIE. So each time it received or transmit a data, an interrupt will be sent. You can delete the sentence which enable the interrupt in these two functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2018 09:01:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Terminating-LPUART-Rx-DMA-with-IDLE-ILIE-for-variable-length/m-p/766912#M7780</guid>
      <dc:creator>jingpan</dc:creator>
      <dc:date>2018-01-16T09:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Terminating LPUART Rx DMA with IDLE/ILIE (for variable length packets)</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Terminating-LPUART-Rx-DMA-with-IDLE-ILIE-for-variable-length/m-p/766913#M7781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jing:&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I disable RIE and TIE, will the DMA module still receive data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2018 15:25:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Terminating-LPUART-Rx-DMA-with-IDLE-ILIE-for-variable-length/m-p/766913#M7781</guid>
      <dc:creator>robertpoor</dc:creator>
      <dc:date>2018-01-16T15:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: Terminating LPUART Rx DMA with IDLE/ILIE (for variable length packets)</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Terminating-LPUART-Rx-DMA-with-IDLE-ILIE-for-variable-length/m-p/766914#M7782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;Yes it will.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jan 2018 04:48:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Terminating-LPUART-Rx-DMA-with-IDLE-ILIE-for-variable-length/m-p/766914#M7782</guid>
      <dc:creator>jingpan</dc:creator>
      <dc:date>2018-01-17T04:48:18Z</dc:date>
    </item>
  </channel>
</rss>

