<?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: LPC1343 USB MSC ROM with Timer32B0 interrupts in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-USB-MSC-ROM-with-Timer32B0-interrupts/m-p/560783#M16019</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by TheFallGuy on Sat Mar 05 02:19:44 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Normally, these sorts of issues are because you haven't used "volatile" on variables that are volatile. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
int i ;
for(i=0; i&amp;lt;1000; i++)
&amp;nbsp; ;
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;will be completely optimized away by the compiler for -O1 and -O2. However:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
volatile int i ;
for(i=0; i&amp;lt;1000; i++)
&amp;nbsp; ;
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;will increment i from 0 thru 999 whatever level of optimization you have.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 02:10:30 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-16T02:10:30Z</dc:date>
    <item>
      <title>LPC1343 USB MSC ROM with Timer32B0 interrupts</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-USB-MSC-ROM-with-Timer32B0-interrupts/m-p/560779#M16015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by S3rd on Mon Feb 28 19:32:42 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a issue with USB connection failing if interrupts are active during the first 400ms or so of the connection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using a EA LPC1343 Quickstart board, and have implemented a single read only file MSC device using the internal USB ROM drivers.&amp;nbsp; All this seemed to work fine until I enabled the Timer32B0 capture input and interrupt to process a real world signal.&amp;nbsp; The signal has frequency of 100Hz and the interrupt is about 4us in duration, so not much CPU time used at all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems that the only way I can get the USB MSC device to connect correctly is to remove the input signal or disable the interrupt during the first 500ms of USB connection.&amp;nbsp; After that the file can be opened fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm guessing that there is some poled timing going on in the USB ROM code that is getting out of sync during initial negotiation if time is lost in other interrupts?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone provide any clarifaction on how&amp;nbsp; this ROM code works? And whether I need to always make sure interrupts are disabled during initial USB negotiation?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Simon&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:10:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-USB-MSC-ROM-with-Timer32B0-interrupts/m-p/560779#M16015</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 USB MSC ROM with Timer32B0 interrupts</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-USB-MSC-ROM-with-Timer32B0-interrupts/m-p/560780#M16016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by S3rd on Thu Mar 03 19:02:35 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Still no luck with this one.&amp;nbsp; I have some more info on this issue after spending another couple of days on it and looking at the packet data from my USB protocol analyzer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From reset if I delay enabling the Timer32B0 CAP0 interrupt a second, then the MSC drive is loaded and the file can be opened.&amp;nbsp; As soon as I add the 100Hz signal to the CAP0 input P1.5 and either restart without the 1 second delay, or drop the connection with a call to&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(*rom)-&amp;gt;pUSBD-&amp;gt;connect(FALSE);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;followed by &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(*rom)-&amp;gt;pUSBD-&amp;gt;connect(TRUE);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;after over writing my files data the USB Get Descriptor: Device command returns 64 bytes of what looks like garbage to the PC.&amp;nbsp; (E1 E1 2E E7 6E 70 B8 4F etc...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When things are working correclty the Get Descriptor: Device command returns 18 bytes &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(12 01 00 02 00 00 00 40 4E 21 01 01 10 00 04 20 48 01) as expected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Some how the timer interrupt is causing points to get messed up.&amp;nbsp; I've lowered the prioity of the timer interrupt to no effect.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did notice that the msdstate variable at 0x10000054 is always 0 when breaking after failure.&amp;nbsp; I have attached a dump of RAM between 0x10000050 and 0x10000180 of each case as there are a few differences.&amp;nbsp; Maybe those that know a bit more about the ROM code can see the issue?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there anyway to debug the ROM?&amp;nbsp; I'm using Code Red tools.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Simon&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:10:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-USB-MSC-ROM-with-Timer32B0-interrupts/m-p/560780#M16016</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 USB MSC ROM with Timer32B0 interrupts</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-USB-MSC-ROM-with-Timer32B0-interrupts/m-p/560781#M16017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by domen on Fri Mar 04 00:09:48 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Check with objdump if your application is using that code area? And if yes (simplest explanation for this problem), then fix the linker file.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:10:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-USB-MSC-ROM-with-Timer32B0-interrupts/m-p/560781#M16017</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 USB MSC ROM with Timer32B0 interrupts</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-USB-MSC-ROM-with-Timer32B0-interrupts/m-p/560782#M16018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by S3rd on Fri Mar 04 23:57:09 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I had looked at the listing and all looks good.&amp;nbsp; I think there is a timing issue or compiler issue as I have found today that it works fine if I use optimisation levels 1 or 2 (-O1 or -O2) for the compiler setting.&amp;nbsp; -O1 seems a good setting as I can still get reasonable debug info out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Simon&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:10:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-USB-MSC-ROM-with-Timer32B0-interrupts/m-p/560782#M16018</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 USB MSC ROM with Timer32B0 interrupts</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-USB-MSC-ROM-with-Timer32B0-interrupts/m-p/560783#M16019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by TheFallGuy on Sat Mar 05 02:19:44 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Normally, these sorts of issues are because you haven't used "volatile" on variables that are volatile. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
int i ;
for(i=0; i&amp;lt;1000; i++)
&amp;nbsp; ;
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;will be completely optimized away by the compiler for -O1 and -O2. However:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
volatile int i ;
for(i=0; i&amp;lt;1000; i++)
&amp;nbsp; ;
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;will increment i from 0 thru 999 whatever level of optimization you have.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:10:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-USB-MSC-ROM-with-Timer32B0-interrupts/m-p/560783#M16019</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:10:30Z</dc:date>
    </item>
  </channel>
</rss>

