<?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>LPC Microcontrollers中的主题 Re: Crossworks implementation of USB bootloader</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Crossworks-implementation-of-USB-bootloader/m-p/523010#M5646</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by wmues on Sun Jan 27 04:50:56 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Bill,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you wrote:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Makes sort of sense, it wants pD to reference a member of the structure it points to, even though it is being cast to uint8_t."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No, it is cast to "uint8_t *".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you tried "((uint8_t *)pD) += "?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 17:59:08 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T17:59:08Z</dc:date>
    <item>
      <title>Crossworks implementation of USB bootloader</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Crossworks-implementation-of-USB-bootloader/m-p/523009#M5645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by williamjsell on Fri Jan 25 12:11:05 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;firstly, I searched to see if there was a port of the AN10866 USB bootloader over to Rowley Crossworks in the public domain, but no luck here, so if anyone has done this... :) ...so figured this should not be too hard, but I ran into a couple of snags.&amp;nbsp; The keyword __packed is not supported by Crossworks, so I used the #pragma pack(1), which should work the same way.&amp;nbsp; I then ran into a code issue.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the declaration:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;USB_COMMON_DESCRIPTOR *pD;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the initialization:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pD = (USB_COMMON_DESCRIPTOR *)USB_ConfigDescriptor;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Keil compiler builds fine, but Crossworks bitches on this statement:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(uint8_t *)pD += ((USB_CONFIGURATION_DESCRIPTOR *)pD)-&amp;gt;wTotalLength;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;with the message&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"lvalue required as left operand of assignment"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Makes sort of sense, it wants pD to reference a member of the structure it points to, even though it is being cast to uint8_t.&amp;nbsp; Looks like the author is attempting to increment the pointer by wTotalLength.&amp;nbsp; I am a little lost here.&amp;nbsp; Firstly, looks like it should work, but I tried several different iterations and I get the same message...any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:59:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Crossworks-implementation-of-USB-bootloader/m-p/523009#M5645</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Crossworks implementation of USB bootloader</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Crossworks-implementation-of-USB-bootloader/m-p/523010#M5646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by wmues on Sun Jan 27 04:50:56 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Bill,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you wrote:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Makes sort of sense, it wants pD to reference a member of the structure it points to, even though it is being cast to uint8_t."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No, it is cast to "uint8_t *".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you tried "((uint8_t *)pD) += "?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:59:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Crossworks-implementation-of-USB-bootloader/m-p/523010#M5646</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Crossworks implementation of USB bootloader</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Crossworks-implementation-of-USB-bootloader/m-p/523011#M5647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by williamjsell on Mon Jan 28 10:30:15 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;no, that did not work.&amp;nbsp; Removing the cast of (uint8_t *) works, but is this the intent of the author?&amp;nbsp; The line &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pD += ((USB_CONFIGURATION_DESCRIPTOR *)pD)-&amp;gt;wTotalLength;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;compiles, but this is not how I would have done this.&amp;nbsp; Surely it would have been safer to have written &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pD += sizeof(USB_CONFIGURATION_DESCRIPTOR);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;it is unclear is wTotalLength is referring to the size of the structure, or to some offset which the programmer has not made clear to the reader.&amp;nbsp; I will keep digging and post my findings...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Bill&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:59:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Crossworks-implementation-of-USB-bootloader/m-p/523011#M5647</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:59:09Z</dc:date>
    </item>
  </channel>
</rss>

