<?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 lpcusb API MS_Host_ReadDeviceBlocks issue in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/lpcusb-API-MS-Host-ReadDeviceBlocks-issue/m-p/573275#M18766</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by michele sponchiado on Thu Jan 07 10:47:24 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Dear sirs,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using your LPC4357 and actually I am very happy of it!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately, I am facing a weird error while using the lpcusb API MS_Host_ReadDeviceBlocks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The routine seems to fail when the number of sector passed as parameter is 9:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not sure this happens every time we need 9 sectors, but surely in one occasion the routine was failing in this exact condition.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here some other info :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; - if I read 8 sectors, then 1 sector, it succeeds&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; - the sectors I am reading are "good", no borderline or bad sectors or so&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; - the error happens when reading a file: the file is read using chunk of 16*512 bytes maximum, so toward the end of the file I have a spare number of blocks and the problem happens&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; - when the error happens, it seems that the data are read out OK, but the status part is missing: when trying to read the status from the pipe, it returns uninitialized data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; - so I patched the calling routine, the FSUSB_DiskReadSectors, to loop reading always a "power-of-two" number of sectors from the MS_Host_ReadDeviceBlocks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i.e. to read 9 sectors, I will read first 8 blocks, then 1 block&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; to read 12 sectors, I will read first 8, then 4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; - this way, at this moment, it seems I have no more errors while reading sectors from USB&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; - but I am not happy with such a patch&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I would ask you:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; - have you any hints about this strange condition?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many many thanks for your support!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 18:58:24 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T18:58:24Z</dc:date>
    <item>
      <title>lpcusb API MS_Host_ReadDeviceBlocks issue</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/lpcusb-API-MS-Host-ReadDeviceBlocks-issue/m-p/573275#M18766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by michele sponchiado on Thu Jan 07 10:47:24 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Dear sirs,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using your LPC4357 and actually I am very happy of it!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately, I am facing a weird error while using the lpcusb API MS_Host_ReadDeviceBlocks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The routine seems to fail when the number of sector passed as parameter is 9:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not sure this happens every time we need 9 sectors, but surely in one occasion the routine was failing in this exact condition.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here some other info :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; - if I read 8 sectors, then 1 sector, it succeeds&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; - the sectors I am reading are "good", no borderline or bad sectors or so&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; - the error happens when reading a file: the file is read using chunk of 16*512 bytes maximum, so toward the end of the file I have a spare number of blocks and the problem happens&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; - when the error happens, it seems that the data are read out OK, but the status part is missing: when trying to read the status from the pipe, it returns uninitialized data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; - so I patched the calling routine, the FSUSB_DiskReadSectors, to loop reading always a "power-of-two" number of sectors from the MS_Host_ReadDeviceBlocks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i.e. to read 9 sectors, I will read first 8 blocks, then 1 block&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; to read 12 sectors, I will read first 8, then 4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; - this way, at this moment, it seems I have no more errors while reading sectors from USB&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; - but I am not happy with such a patch&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I would ask you:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; - have you any hints about this strange condition?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many many thanks for your support!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:58:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/lpcusb-API-MS-Host-ReadDeviceBlocks-issue/m-p/573275#M18766</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:58:24Z</dc:date>
    </item>
  </channel>
</rss>

