<?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: usb msd in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/usb-msd/m-p/580152#M24445</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rob65 on Thu Jun 02 01:41:16 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Zero&lt;/STRONG&gt;&lt;BR /&gt;Try to add volatile in usbhw.c [COLOR=Blue](blue is new[/COLOR]):&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
void delay (uint32_t length ) {
&amp;nbsp; [COLOR=Blue]volatile[/COLOR] uint32_t i;

&amp;nbsp; for ( i = 0; i &amp;lt; length; i++ );
&amp;nbsp; return;
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Remind me to exorcise all NXP example code from my PC :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Lesson 1 of any programming class will tell you that this is a very bad way of programming.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If one of my old NXP embedded programming colleagues would have written this we would have put him/her in a straight jacket and let him watch a Microsoft Windows programmer at work for a whole week &lt;SPAN class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;&lt;LI-EMOJI id="lia_grinning-face-with-smiling-eyes" title=":grinning_face_with_smiling_eyes:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Too bad it is not allowed to draw and quarter (DE: vierteilen) anymore (I might forget to program Asimov's laws in my next robot though :rolleyes:)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Making the variable volatile is the quick and dirty way of solving this unforgettable bug in NXP's example project.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The correct way of solving this is of course by using the systick timer to program a delay for a certain number of clock cycles. The current function will in no way delay the amount of clock cycles requested but an n-fold of cycles.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 23:58:20 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T23:58:20Z</dc:date>
    <item>
      <title>usb msd</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/usb-msd/m-p/580150#M24443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by rolanddeluca on Wed Jun 01 16:29:49 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to compile and run the usb msd demo in release mode on a lpc1343 lpcxpresso brd in xp but it will not connect.:mad:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I compile and run debug code it works fine. I can see the drive and read the txt file. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried usbconnect and usbvbus circuits below with no success.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://www.microbuilder.eu/Files/Projects/LPC1343RefDesign/LPC1343_Schematic_v1.6.pdf&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;any help appreciated.:confused:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:58:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/usb-msd/m-p/580150#M24443</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: usb msd</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/usb-msd/m-p/580151#M24444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Wed Jun 01 17:05:03 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Try to add volatile in usbhw.c [COLOR=Blue](blue is new[/COLOR]):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
void delay (uint32_t length ) {
&amp;nbsp; [COLOR=Blue]volatile[/COLOR] uint32_t i;

&amp;nbsp; for ( i = 0; i &amp;lt; length; i++ );
&amp;nbsp; return;
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:58:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/usb-msd/m-p/580151#M24444</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: usb msd</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/usb-msd/m-p/580152#M24445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rob65 on Thu Jun 02 01:41:16 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Zero&lt;/STRONG&gt;&lt;BR /&gt;Try to add volatile in usbhw.c [COLOR=Blue](blue is new[/COLOR]):&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
void delay (uint32_t length ) {
&amp;nbsp; [COLOR=Blue]volatile[/COLOR] uint32_t i;

&amp;nbsp; for ( i = 0; i &amp;lt; length; i++ );
&amp;nbsp; return;
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Remind me to exorcise all NXP example code from my PC :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Lesson 1 of any programming class will tell you that this is a very bad way of programming.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If one of my old NXP embedded programming colleagues would have written this we would have put him/her in a straight jacket and let him watch a Microsoft Windows programmer at work for a whole week &lt;SPAN class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;&lt;LI-EMOJI id="lia_grinning-face-with-smiling-eyes" title=":grinning_face_with_smiling_eyes:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Too bad it is not allowed to draw and quarter (DE: vierteilen) anymore (I might forget to program Asimov's laws in my next robot though :rolleyes:)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Making the variable volatile is the quick and dirty way of solving this unforgettable bug in NXP's example project.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The correct way of solving this is of course by using the systick timer to program a delay for a certain number of clock cycles. The current function will in no way delay the amount of clock cycles requested but an n-fold of cycles.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:58:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/usb-msd/m-p/580152#M24445</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: usb msd</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/usb-msd/m-p/580153#M24446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by rolanddeluca on Thu Jun 02 10:51:14 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;[SIZE=2]thanks, tried Zero's suggestion [COLOR=#7f0055][COLOR=#7f0055][B]volatile i [/B][COLOR=#000000]in delay with some success. I[/COLOR][/COLOR][/COLOR][COLOR=#7f0055][COLOR=#7f0055][COLOR=#000000]ts now connects and reads the ID but its not enumerating the endpoint. [/COLOR][/COLOR][/COLOR][/SIZE][SIZE=2]:rolleyes:[/SIZE]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:58:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/usb-msd/m-p/580153#M24446</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: usb msd</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/usb-msd/m-p/580154#M24447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by rolanddeluca on Thu Jun 02 11:00:39 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Looks like its the optimization level -O2.&amp;nbsp;&amp;nbsp; Works only with&amp;nbsp; -00 or -01. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;No drawing and quartering required.:)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:58:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/usb-msd/m-p/580154#M24447</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: usb msd</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/usb-msd/m-p/580155#M24448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Thu Jun 02 11:12:50 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;The original sample (with changed 'volatile' in delay) is working here without problems with Windows 7 and also XP. But of course I use my own hardware without prehistoric transistor :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So I would suggest to try a few other computers and then use a FET.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:58:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/usb-msd/m-p/580155#M24448</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: usb msd</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/usb-msd/m-p/580156#M24449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by larryvc on Thu Jun 02 11:26:26 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Rob65&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;If one of my old NXP embedded programming colleagues would have written this we would have put him/her in a straight jacket and let him watch a Microsoft Windows programmer at work for a whole week.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Was that for punishment or enlightenment?:confused::)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Zero&lt;/STRONG&gt;&lt;BR /&gt;But of course I use my own hardware without prehistoric transistor :)&lt;BR /&gt;So I would suggest to try a few other computers and then use a FET.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you elaborate on that or show your circuit?:)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:58:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/usb-msd/m-p/580156#M24449</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: usb msd</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/usb-msd/m-p/580157#M24450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by ktownsend on Fri Jun 03 04:54:26 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Zero&lt;/STRONG&gt;&lt;BR /&gt;The original sample (with changed 'volatile' in delay) is working here without problems with Windows 7 and also XP. But of course I use my own hardware without prehistoric transistor :)&lt;BR /&gt;So I would suggest to try a few other computers and then use a FET.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ouch :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A FET would indeed mean one resistor less, but I only have about 25 8mm reels on the pick and place machine (since they're like 500€ a piece) so I try to use the same common parts are much as possible to avoid changing reels all the time (just me being lazy, yes).&amp;nbsp; Pick and place machines are expensive enough, but it's the reel holders that kill you in the long run!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:58:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/usb-msd/m-p/580157#M24450</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: usb msd</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/usb-msd/m-p/580158#M24451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Fri Jun 03 05:02:30 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Even worse: 2 resistors :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://knowledgebase.nxp.com/showthread.php?t=1972&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:58:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/usb-msd/m-p/580158#M24451</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:58:25Z</dc:date>
    </item>
  </channel>
</rss>

