<?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>topic Re: USB CDC sending data while closed in MCUXpresso SDK</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-CDC-sending-data-while-closed/m-p/1617199#M4253</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/197361"&gt;@Therry&lt;/a&gt;&amp;nbsp;well, we don't have any examples of such programs in our SDK, an apology.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Mar 2023 01:16:19 GMT</pubDate>
    <dc:creator>CarlosGarabito</dc:creator>
    <dc:date>2023-03-17T01:16:19Z</dc:date>
    <item>
      <title>USB CDC sending data while closed</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-CDC-sending-data-while-closed/m-p/1609160#M4224</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm new to developing with USB. I new using the LPCXpresso55S28 Board and with the help of the SDK (version 2.13.0) i manage to get USB CDC working. I have only one question.&lt;/P&gt;&lt;P&gt;Our applications pushes data over the USB. When the serial port is closed (not disconnected) the data is buffer en when the port is opened again old data is received and then the new data. For example:&lt;/P&gt;&lt;P&gt;Msg1&lt;BR /&gt;Msg2&lt;BR /&gt;Msg3&lt;BR /&gt;- port closed&lt;BR /&gt;wait some time&lt;BR /&gt;- port opened&lt;BR /&gt;Msg4 &amp;lt;- buffer message i don't want&lt;BR /&gt;Msg10&lt;BR /&gt;Msg11&lt;BR /&gt;Msg12&lt;/P&gt;&lt;P&gt;I was wondering if it is possible to either detect if a port is closed so the MCU application can stop sending without the use of hardware flow control. Or clear the buffered message when the port is opened again.&lt;/P&gt;&lt;P&gt;With kind regards,&lt;BR /&gt;Therry&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 10:53:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-CDC-sending-data-while-closed/m-p/1609160#M4224</guid>
      <dc:creator>Therry</dc:creator>
      <dc:date>2023-03-03T10:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: USB CDC sending data while closed</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-CDC-sending-data-while-closed/m-p/1611774#M4229</link>
      <description>&lt;P style="margin: 0in; font-family: Montserrat; font-size: 12.0pt;" lang="es-MX"&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/197361"&gt;@Therry&lt;/a&gt;&amp;nbsp;, in the SDK there are several examples with the use of the USB CDC and the send msg, it is only a matter of reading the README documents to understand the project, on the other hand, you can find more information in the community on this topic, it is only a question of interpreting it for your project and the MCU you have, I leave some links that may be useful for you.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Montserrat; font-size: 12.0pt;" lang="es-MX"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Montserrat; font-size: 12.0pt;" lang="es-MX"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Montserrat; font-size: 12.0pt;" lang="es-MX"&gt;&lt;A href="https://community.nxp.com/t5/LPCware-Archive-Content/LPC-USB-Serial-I-O-Library/ta-p/1129296" target="_blank"&gt;https://community.nxp.com/t5/LPCware-Archive-Content/LPC-USB-Serial-I-O-Library/ta-p/1129296&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Montserrat; font-size: 12.0pt;" lang="es-MX"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Montserrat; font-size: 12.0pt;" lang="es-MX"&gt;&lt;A href="https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-detect-if-USB-connected/m-p/626039" target="_blank"&gt;https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-detect-if-USB-connected/m-p/626039&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Montserrat; font-size: 12.0pt;" lang="es-MX"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Montserrat; font-size: 12.0pt;" lang="es-MX"&gt;&lt;A href="https://community.nxp.com/t5/i-MX-RT/imx-rt1061-USB-device-connection-detect/m-p/1330851" target="_blank"&gt;https://community.nxp.com/t5/i-MX-RT/imx-rt1061-USB-device-connection-detect/m-p/1330851&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Montserrat; font-size: 12.0pt;" lang="es-MX"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Montserrat; font-size: 12.0pt;" lang="es-MX"&gt;&lt;A href="https://community.nxp.com/t5/i-MX-RT/What-is-the-best-way-to-detect-attaching-and-detaching-of-an-usb/m-p/1086414" target="_blank"&gt;https://community.nxp.com/t5/i-MX-RT/What-is-the-best-way-to-detect-attaching-and-detaching-of-an-usb/m-p/1086414&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Montserrat; font-size: 12.0pt;" lang="es-MX"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Montserrat; font-size: 12.0pt;" lang="es-MX"&gt;&lt;A href="https://community.nxp.com/t5/MCUXpresso-SDK/USB-HID-Gereric-buffer-issue/m-p/811496" target="_blank"&gt;https://community.nxp.com/t5/MCUXpresso-SDK/USB-HID-Gereric-buffer-issue/m-p/811496&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Montserrat; font-size: 12.0pt;" lang="es-MX"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Montserrat; font-size: 12.0pt;" lang="es-MX"&gt;Have a good day&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2023 16:55:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-CDC-sending-data-while-closed/m-p/1611774#M4229</guid>
      <dc:creator>CarlosGarabito</dc:creator>
      <dc:date>2023-03-08T16:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: USB CDC sending data while closed</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-CDC-sending-data-while-closed/m-p/1613986#M4236</link>
      <description>&lt;P&gt;Dear &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/195771"&gt;@CarlosGarabito&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;I checked the information you send but couldn't find a a solution for my problem. The problems you provided are about physical disconnecting the USB. I'm looking for a detection of a logical connection (opening and closing the COM port)&lt;/P&gt;&lt;P&gt;With kind regards,&lt;BR /&gt;Therry Angenent&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 10:42:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-CDC-sending-data-while-closed/m-p/1613986#M4236</guid>
      <dc:creator>Therry</dc:creator>
      <dc:date>2023-03-13T10:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: USB CDC sending data while closed</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-CDC-sending-data-while-closed/m-p/1617199#M4253</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/197361"&gt;@Therry&lt;/a&gt;&amp;nbsp;well, we don't have any examples of such programs in our SDK, an apology.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 01:16:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-CDC-sending-data-while-closed/m-p/1617199#M4253</guid>
      <dc:creator>CarlosGarabito</dc:creator>
      <dc:date>2023-03-17T01:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: USB CDC sending data while closed</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-CDC-sending-data-while-closed/m-p/1617680#M4256</link>
      <description>&lt;P&gt;Dear &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/195771"&gt;@CarlosGarabito&lt;/a&gt;&amp;nbsp;, Is there a way to clear the send buffer when the COM port is logically opened? For example when the event kUSB_DeviceCdcEventSetLineCoding is received.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 13:19:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-CDC-sending-data-while-closed/m-p/1617680#M4256</guid>
      <dc:creator>Therry</dc:creator>
      <dc:date>2023-03-17T13:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: USB CDC sending data while closed</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-CDC-sending-data-while-closed/m-p/1636124#M4294</link>
      <description>&lt;P&gt;For future reference:&lt;/P&gt;&lt;P&gt;I solved my case. What I did is adding a timeout when writing to the USB “USB_DeviceCdcAcmSend()”. This timeout was canceled when the event “kUSB_DeviceCdcEventSendResponse” happens and no data needs to be send.&lt;/P&gt;&lt;P&gt;If the timeout was triggered the function “USB_DeviceCancel()”is called to remove the data from the buffer.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 09:43:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-CDC-sending-data-while-closed/m-p/1636124#M4294</guid>
      <dc:creator>Therry</dc:creator>
      <dc:date>2023-04-19T09:43:36Z</dc:date>
    </item>
  </channel>
</rss>

