<?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のトピックRe: USB file read is slower</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-file-read-is-slower/m-p/429154#M14336</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Virendra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The possible cause is the delay when a NAK occurs in _usb_khci_atom_tr() shown below :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; case 0x0a: // NAK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; res = KHCI_ATOM_TR_NAK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (retry)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _time_delay(delay_const * (pipe_desc_ptr-&amp;gt;G.NAK_COUNT - retry));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; break;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A NAK is sent when the USB device is not ready to handle the request yet. The NAK interval depends on how fast the USB device can handle the request.&lt;/P&gt;&lt;P&gt;Therefore, if the Host is sending requests too fast and the device cannot keep up it will send NAKs more frequently.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the NAK occurs, the _time_delay() will cause a delay before next transfer can begin, thus affecting thoughput.&lt;/P&gt;&lt;P&gt;You can remove this _time_delay() and set USBCFG_DEFAULT_MAX_NAK_COUNT to (3000) to avoid a large delay to improve the performance on MQX 4.x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try the following changes :&lt;/P&gt;&lt;P&gt;- Comment out the delay function (file C:\Freescale\Freescale_MQX_4_2\usb\host\source\host\khci\khci.c, function _usb_khci_atom_tr() , lines 1203-1207)&lt;/P&gt;&lt;P&gt;- Change USBCFG_DEFAULT_MAX_NAK_COUNT definition (file C:\Freescale\Freescale_MQX_4_2\usb\host\source\include\host_cnfg.h, line 72) to 3000&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2015 15:32:16 GMT</pubDate>
    <dc:creator>cguarneri</dc:creator>
    <dc:date>2015-10-29T15:32:16Z</dc:date>
    <item>
      <title>USB file read is slower</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-file-read-is-slower/m-p/429153#M14335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a customized board based on K61fx512, We have a bootloader and application running on it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are using bootloader based on MQX OS which supports the USB. Bootloader code detect the USB and copy the .exe file from USB and write it to flash.&lt;/P&gt;&lt;P&gt;We have used demo code for USB from TWRK70 and using as USB Host for full speed mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our exe is around 2.2 MB of size, and the current bootloader USB code takes almost 1 min to read the exe file from USB.&lt;/P&gt;&lt;P&gt;This time is very much compare to USB supported speed, we are assuming that this file should transfer in 1 or 2 sec.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone tell us, why the time required to read 2MB file from USB is very high?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Virendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2015 13:32:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-file-read-is-slower/m-p/429153#M14335</guid>
      <dc:creator>virendrapatel</dc:creator>
      <dc:date>2015-10-26T13:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: USB file read is slower</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-file-read-is-slower/m-p/429154#M14336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Virendra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The possible cause is the delay when a NAK occurs in _usb_khci_atom_tr() shown below :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; case 0x0a: // NAK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; res = KHCI_ATOM_TR_NAK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (retry)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _time_delay(delay_const * (pipe_desc_ptr-&amp;gt;G.NAK_COUNT - retry));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; break;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A NAK is sent when the USB device is not ready to handle the request yet. The NAK interval depends on how fast the USB device can handle the request.&lt;/P&gt;&lt;P&gt;Therefore, if the Host is sending requests too fast and the device cannot keep up it will send NAKs more frequently.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the NAK occurs, the _time_delay() will cause a delay before next transfer can begin, thus affecting thoughput.&lt;/P&gt;&lt;P&gt;You can remove this _time_delay() and set USBCFG_DEFAULT_MAX_NAK_COUNT to (3000) to avoid a large delay to improve the performance on MQX 4.x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try the following changes :&lt;/P&gt;&lt;P&gt;- Comment out the delay function (file C:\Freescale\Freescale_MQX_4_2\usb\host\source\host\khci\khci.c, function _usb_khci_atom_tr() , lines 1203-1207)&lt;/P&gt;&lt;P&gt;- Change USBCFG_DEFAULT_MAX_NAK_COUNT definition (file C:\Freescale\Freescale_MQX_4_2\usb\host\source\include\host_cnfg.h, line 72) to 3000&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2015 15:32:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-file-read-is-slower/m-p/429154#M14336</guid>
      <dc:creator>cguarneri</dc:creator>
      <dc:date>2015-10-29T15:32:16Z</dc:date>
    </item>
  </channel>
</rss>

