<?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: i.MX6 USB Serial Downloader ROM bug? in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/i-MX6-USB-Serial-Downloader-ROM-bug/m-p/231507#M17472</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not very familiar with the boot loader itself, but I am familiar with USB.&lt;/P&gt;&lt;P&gt;I don't think you have to send 1024 bytes.&lt;/P&gt;&lt;P&gt;1024 is the maximum data size of a report descriptor. It is not the Max Packet Size.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MaxPacketSize is the Max size of a single packet. This max size depends on the speed and endpoint type.&lt;/P&gt;&lt;P&gt;For a control endpoint (this is where the report descriptor is transferred), the MaxPacketSize is 64 bytes for high speed, 8, 16 ,32 or 64 bytes for full speed and 8 bytes for low speed.&lt;/P&gt;&lt;P&gt;So, to transfer 1024 bytes on a high-speed control endpoint, you need 1024/64 = 16 packets.&lt;/P&gt;&lt;P&gt;All packets, except the last packet of the transfer must be MaxPacketSize long because a short packet indicates the end of the transfer.&lt;/P&gt;&lt;P&gt;Ex. To transfer 253 bytes you need 4 packets. Three of 64 bytes followed by one with 61 bytes. The 61 byte packet is a short packet and is the last packet of the transfer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that a device reports its MaxPacketSize in the report descriptor. It is the reported size that the host must use for MaxPacketSize.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Apr 2013 07:24:28 GMT</pubDate>
    <dc:creator>richard_stulens</dc:creator>
    <dc:date>2013-04-09T07:24:28Z</dc:date>
    <item>
      <title>i.MX6 USB Serial Downloader ROM bug?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX6-USB-Serial-Downloader-ROM-bug/m-p/231506#M17471</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;I'm using the i.MX6Q in USB boot mode and suspect I've found a ROM bug in the implementation of the Serial Download Protocol (SDP).&amp;nbsp; Someone please correct me where I've gone wrong...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to the reference manual (section 8.8.2.1.3) the WRITE_FILE command allows me to specify "Valid values for WRITE_FILE COMMAND, ADDRESS, DATA_COUNT".&amp;nbsp;&amp;nbsp; The issue is with DATA_COUNT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The USB HID protocol requires me to always send complete packets to the i.MX6Q.&amp;nbsp; As the output packet size is 1025 bytes (1024 of data preceded by a 0x02 for the Report ID), I must always send 1025 bytes of data even if DATA_COUNT in the SDP is smaller, but this is OK.&amp;nbsp; The problem I've got is that if I wish to send 2 bytes of data to address 0x00910000 then I must send a 1025 byte packet, and the i.MX6Q ROM then loads all 1024 bytes into memory starting at 0x00910000.&amp;nbsp; That is, it rounds DATA_COUNT up to whole packet sizes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've reproduced this behavior in sb_loader (part of the mfgtools), so it doesn't appear to be a bug of my own.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have I misunderstood something?&amp;nbsp; Clearly I can work around this by first reading the contents of the last K of memory I'm going to write into, then writing my own data on top of it, and transmitting it back.&amp;nbsp; But I'd rather not code up a hack (unless it isn't my bug).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Jan 2013 22:58:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX6-USB-Serial-Downloader-ROM-bug/m-p/231506#M17471</guid>
      <dc:creator>andrewtrotman</dc:creator>
      <dc:date>2013-01-20T22:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX6 USB Serial Downloader ROM bug?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX6-USB-Serial-Downloader-ROM-bug/m-p/231507#M17472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not very familiar with the boot loader itself, but I am familiar with USB.&lt;/P&gt;&lt;P&gt;I don't think you have to send 1024 bytes.&lt;/P&gt;&lt;P&gt;1024 is the maximum data size of a report descriptor. It is not the Max Packet Size.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MaxPacketSize is the Max size of a single packet. This max size depends on the speed and endpoint type.&lt;/P&gt;&lt;P&gt;For a control endpoint (this is where the report descriptor is transferred), the MaxPacketSize is 64 bytes for high speed, 8, 16 ,32 or 64 bytes for full speed and 8 bytes for low speed.&lt;/P&gt;&lt;P&gt;So, to transfer 1024 bytes on a high-speed control endpoint, you need 1024/64 = 16 packets.&lt;/P&gt;&lt;P&gt;All packets, except the last packet of the transfer must be MaxPacketSize long because a short packet indicates the end of the transfer.&lt;/P&gt;&lt;P&gt;Ex. To transfer 253 bytes you need 4 packets. Three of 64 bytes followed by one with 61 bytes. The 61 byte packet is a short packet and is the last packet of the transfer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that a device reports its MaxPacketSize in the report descriptor. It is the reported size that the host must use for MaxPacketSize.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 07:24:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX6-USB-Serial-Downloader-ROM-bug/m-p/231507#M17472</guid>
      <dc:creator>richard_stulens</dc:creator>
      <dc:date>2013-04-09T07:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX6 USB Serial Downloader ROM bug?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX6-USB-Serial-Downloader-ROM-bug/m-p/231508#M17473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Andrew, have your issues been answered? If yes, please click Correct Answer.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Yixing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Apr 2013 03:10:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX6-USB-Serial-Downloader-ROM-bug/m-p/231508#M17473</guid>
      <dc:creator>YixingKong</dc:creator>
      <dc:date>2013-04-17T03:10:45Z</dc:date>
    </item>
  </channel>
</rss>

