<?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: Re: Slow in USB Mass Storage Detection in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Slow-in-USB-Mass-Storage-Detection/m-p/361509#M11861</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Pramod,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for my long delay. The USB MFS mass storage link driver usbmfs.c uses around 20 secs( USBCFG_MFS_LWSEM_TIMEOUT ) timeout in the read, write and open functions. The mentioned timeout could be reduced by changing the macro and recompiling the USB libraries of MQX. The result will be that the timeout will be less, and it is possible that some USB sticks that are currently compatible (with long response times), will not be compatible anymore. However, it could also improve the response of the system for a faster reply when the MSD device is not compatible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt; Sol &lt;BR /&gt; &lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Mar 2015 20:07:18 GMT</pubDate>
    <dc:creator>soledad</dc:creator>
    <dc:date>2015-03-25T20:07:18Z</dc:date>
    <item>
      <title>Slow in USB Mass Storage Detection</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Slow-in-USB-Mass-Storage-Detection/m-p/361506#M11858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am woroking with K70 on a custom board.&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I have modified the USB Mass storage example code SD card and working fine. The change I made is &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;From&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;case USB_MSC_DEVICE_READ_REQUEST :&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/EM&gt;&lt;BR /&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lba_data_ptr = (PTR_LBA_APP_STRUCT)val;&lt;/EM&gt;&lt;BR /&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #if RAM_DISK_APP&lt;/EM&gt;&lt;BR /&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; USB_mem_copy(g_disk.storage_disk + lba_data_ptr-&amp;gt;offset,&lt;/EM&gt;&lt;BR /&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lba_data_ptr-&amp;gt;buff_ptr, &lt;/EM&gt;&lt;BR /&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lba_data_ptr-&amp;gt;size);&lt;/EM&gt;&lt;BR /&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #endif&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/EM&gt;&lt;BR /&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/EM&gt;&lt;BR /&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;case USB_MSC_DEVICE_WRITE_REQUEST :&lt;/EM&gt;&lt;BR /&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lba_data_ptr = (PTR_LBA_APP_STRUCT)val;&lt;/EM&gt;&lt;BR /&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #if RAM_DISK_APP&lt;/EM&gt;&lt;BR /&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; USB_mem_copy(lba_data_ptr-&amp;gt;buff_ptr,&lt;/EM&gt;&lt;BR /&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; g_disk.storage_disk + lba_data_ptr-&amp;gt;offset,&lt;/EM&gt;&lt;BR /&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lba_data_ptr-&amp;gt;size);&lt;/EM&gt;&lt;BR /&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #endif&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/EM&gt;&lt;BR /&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;TO&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE style="border: 0px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;TBODY style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;case USB_MSC_DEVICE_READ_REQUEST :&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/EM&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lba_data_ptr = (PTR_LBA_APP_STRUCT)val;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fread(lba_data_ptr-&amp;gt;buff_ptr, 1, 1, filesystem_handle);&lt;/EM&gt;&lt;/P&gt;&lt;TABLE style="border: 0px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;TBODY style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/EM&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;case USB_MSC_DEVICE_WRITE_REQUEST :&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lba_data_ptr = (PTR_LBA_APP_STRUCT)val;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fwrite(lba_data_ptr-&amp;gt;buff_ptr, 1, 1, filesystem_hanlde);&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;The problem I am facing is it very slow for USB detection and data transfer with PC. Please let me know what I can do for speed transfer, currently it is 100kbps. &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Thanks,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Pramod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Mar 2015 14:09:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Slow-in-USB-Mass-Storage-Detection/m-p/361506#M11858</guid>
      <dc:creator>pramodk_g_</dc:creator>
      <dc:date>2015-03-05T14:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Slow in USB Mass Storage Detection</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Slow-in-USB-Mass-Storage-Detection/m-p/361507#M11859</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;First all I would like to apologize for the long delay on getting back to you.&amp;nbsp; Regarding your inquiry, the slow performance of the demo is not caused by slow USB performance, no matter using full or high speed USB module. It's because in the mfs-usb demo, it only read and write 512bytes at a time, this is not efficient.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The read and write API will cause underlying USB stack to issue UFI read10 commands for data transfer. Please try to increase the data buffer size and read more at a time, this will help improve performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;buffer = _mem_alloc(COPY_BLOCK_SIZE); // COPY_BLOCK_SIZE is 512&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (buffer == NULL) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; printf("Warning, unable to allocate copy buffer, copy will be slower\n" );&lt;/P&gt;&lt;P&gt;&amp;nbsp; copysize = sizeof(buffer);&lt;/P&gt;&lt;P&gt;&amp;nbsp; copybuffer= &amp;amp;buffer;&lt;/P&gt;&lt;P&gt;&amp;nbsp; } else {&lt;/P&gt;&lt;P&gt;&amp;nbsp; copysize = COPY_BLOCK_SIZE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; copybuffer= buffer;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; do {&lt;/P&gt;&lt;P&gt;&amp;nbsp; size = read(in_fd, copybuffer, copysize);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (size &amp;gt; 0) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; wsize = write(out_fd, copybuffer, size);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp; break;&lt;/P&gt;&lt;P&gt;&amp;nbsp; } while (wsize == size);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps !!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt; Sol &lt;BR /&gt; &lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2015 01:12:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Slow-in-USB-Mass-Storage-Detection/m-p/361507#M11859</guid>
      <dc:creator>soledad</dc:creator>
      <dc:date>2015-03-10T01:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Slow in USB Mass Storage Detection</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Slow-in-USB-Mass-Storage-Detection/m-p/361508#M11860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/soledad"&gt;soledad&lt;/A&gt; for the fat reply,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the confusion I have not used &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;mfs-usb demo for this&lt;/SPAN&gt;, I made this code from USB device Mass storage and SD card examples. Initially the USB example make RAMDISK as mass storage and I changed that for SD card. So please let me know what I can do for improving the Speed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Pramod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2015 15:02:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Slow-in-USB-Mass-Storage-Detection/m-p/361508#M11860</guid>
      <dc:creator>pramodk_g_</dc:creator>
      <dc:date>2015-03-10T15:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Slow in USB Mass Storage Detection</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Slow-in-USB-Mass-Storage-Detection/m-p/361509#M11861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Pramod,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for my long delay. The USB MFS mass storage link driver usbmfs.c uses around 20 secs( USBCFG_MFS_LWSEM_TIMEOUT ) timeout in the read, write and open functions. The mentioned timeout could be reduced by changing the macro and recompiling the USB libraries of MQX. The result will be that the timeout will be less, and it is possible that some USB sticks that are currently compatible (with long response times), will not be compatible anymore. However, it could also improve the response of the system for a faster reply when the MSD device is not compatible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt; Sol &lt;BR /&gt; &lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 20:07:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Slow-in-USB-Mass-Storage-Detection/m-p/361509#M11861</guid>
      <dc:creator>soledad</dc:creator>
      <dc:date>2015-03-25T20:07:18Z</dc:date>
    </item>
  </channel>
</rss>

