<?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>MQX Software Solutions中的主题 USB CDC buffer initialization</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-CDC-buffer-initialization/m-p/811053#M17929</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Hi,&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;I'm using K70 with MQX system&amp;nbsp;and USB CDC as virtual COM port to send data. From time to time, I can see 12 bytes of data corruption within the sent data package from the receive side. I checked the buffer used to send data by calling USB_Class_CDC_Send_Data() and found that the buffer is allocated by malloc(). I changed the initialization by calling the function in MQX library _mem_alloc_uncached() and the data corruption went away.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;I tried to look for the reference on the reference manual about data buffer used in USB transaction but I couldn't find anything. Is there any recommendations on the buffer used in USB has to be allocated in the uncached memory? I want to make sure my change was not just shifting the timing and drive the real problem elsewhere.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;The USB is configured in high-speed mode and use a bulk size of 512. USB is running in device mode using EHCI as device controller. Our hardware board is using a USB3300 PHY.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Thanks in advance!&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Best Regards,&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Lecheng&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Jul 2018 23:36:14 GMT</pubDate>
    <dc:creator>SantiZ</dc:creator>
    <dc:date>2018-07-13T23:36:14Z</dc:date>
    <item>
      <title>USB CDC buffer initialization</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-CDC-buffer-initialization/m-p/811053#M17929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Hi,&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;I'm using K70 with MQX system&amp;nbsp;and USB CDC as virtual COM port to send data. From time to time, I can see 12 bytes of data corruption within the sent data package from the receive side. I checked the buffer used to send data by calling USB_Class_CDC_Send_Data() and found that the buffer is allocated by malloc(). I changed the initialization by calling the function in MQX library _mem_alloc_uncached() and the data corruption went away.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;I tried to look for the reference on the reference manual about data buffer used in USB transaction but I couldn't find anything. Is there any recommendations on the buffer used in USB has to be allocated in the uncached memory? I want to make sure my change was not just shifting the timing and drive the real problem elsewhere.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;The USB is configured in high-speed mode and use a bulk size of 512. USB is running in device mode using EHCI as device controller. Our hardware board is using a USB3300 PHY.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Thanks in advance!&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Best Regards,&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Lecheng&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jul 2018 23:36:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-CDC-buffer-initialization/m-p/811053#M17929</guid>
      <dc:creator>SantiZ</dc:creator>
      <dc:date>2018-07-13T23:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: USB CDC buffer initialization</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-CDC-buffer-initialization/m-p/811054#M17930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" class="" data-content-finding="Community" data-userid="312308" data-username="vctveron" href="https://community.nxp.com/people/vctveron"&gt;Lecheng &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;User application buffers used by USB EHCI Class drivers have to reside in un-cached memory space.&lt;/P&gt;&lt;P&gt;I hope it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jul 2018 03:14:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-CDC-buffer-initialization/m-p/811054#M17930</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2018-07-20T03:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: USB CDC buffer initialization</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-CDC-buffer-initialization/m-p/811055#M17931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the confirmation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a nice day,&lt;/P&gt;&lt;P&gt;Lecheng&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jul 2018 15:25:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-CDC-buffer-initialization/m-p/811055#M17931</guid>
      <dc:creator>SantiZ</dc:creator>
      <dc:date>2018-07-20T15:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: USB CDC buffer initialization</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-CDC-buffer-initialization/m-p/811056#M17932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would it be acceptable to use a cached buffer and&amp;nbsp;call _DCACHE_FLUSH_MLINES to flush the cache right before sending the data on USB?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Rand Monteleone&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Apr 2019 18:26:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-CDC-buffer-initialization/m-p/811056#M17932</guid>
      <dc:creator>rand_monteleone</dc:creator>
      <dc:date>2019-04-05T18:26:03Z</dc:date>
    </item>
  </channel>
</rss>

