<?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: usb WDH interrupt not always happening</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/usb-WDH-interrupt-not-always-happening/m-p/519911#M3402</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by ezharkov on Thu Aug 21 09:44:45 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;What I'm using is based on one of the pre-lpcopen releases (lpc177x_8x\Drivers\source\lpc177x_8x_usbhost.c). They don't seem to have a similar file for lpc175x_6x. But my guess is that it is pretty much the same thing as what you are using.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(I have not personally seen the problem myself yet. Everything seemed to work just fine for me. Both on LPC1788 and on an LPC176x. But another developer noticed a problem on an LPC1788 and it looked very similar to what you describe. I.e., slight changes to seemingly unrelated parts of the code would make the problem show up or go away.)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 17:41:06 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T17:41:06Z</dc:date>
    <item>
      <title>usb WDH interrupt not always happening</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/usb-WDH-interrupt-not-always-happening/m-p/519906#M3397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by alager on Tue Aug 19 20:52:14 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;We have a project that copies a file from a USB flash drive on an lpc1768.&amp;nbsp; On some builds the copy goes fine, no issues.&amp;nbsp; But then on other builds, with minor changes to other unrelated modules, the WDH interrupt is not happening.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And then we can make mods to yet other modules, and then we DO get the interrupt.&amp;nbsp; It's very strange.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We are using the stack written by NXP, Ravikanth.P.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When the issue shows up we are sitting in this while loop forever:&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca" style="border:1px solid black;background-color:#cacaca;border:1px solid black;background-color:#cacaca;border:1px solid black;background-color:#cacaca;border:1px solid black;background-color:#cacaca;border:1px solid black;background-color:#cacaca;border:1px solid black;background-color:#cacaca;border:1px solid black;background-color:#cacaca;background-color:#cacaca;border:1px solid black;background-color:#cacaca;border:1px solid black;background-color:#cacaca;border:1px solid black;background-color:#cacaca;border:1px solid black;background-color:#cacaca;border:1px solid black;background-color:#cacaca;border:1px solid black;"&gt; &lt;PRE&gt;void&amp;nbsp; Host_WDHWait (void)
{
&amp;nbsp; while (!HOST_WdhIntr) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; ;
&amp;nbsp; }
&amp;nbsp; HOST_WdhIntr = 0;
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;More information:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I found that adding back modCounter to EINT3_IRQHandler(), even when not&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;referenced in the code, it increases bss use by 4 bytes and allows the WDH interrupt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;to happen, but if I remove it, then we never get the interrupt!&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca" style="border:1px solid black;background-color:#cacaca;border:1px solid black;background-color:#cacaca;border:1px solid black;background-color:#cacaca;border:1px solid black;background-color:#cacaca;border:1px solid black;background-color:#cacaca;border:1px solid black;background-color:#cacaca;border:1px solid black;background-color:#cacaca;background-color:#cacaca;border:1px solid black;background-color:#cacaca;border:1px solid black;background-color:#cacaca;border:1px solid black;background-color:#cacaca;border:1px solid black;background-color:#cacaca;border:1px solid black;background-color:#cacaca;border:1px solid black;"&gt; &lt;PRE&gt;void EINT3_IRQHandler( void )
{
static unsigned int modCounter; // &amp;lt;-- removing this causes the WDH interrupt to never happen

//Make sure the falling edge for p0[17] sent us here
if( LPC_GPIOINT-&amp;gt;IO0IntStatF &amp;amp; (1ul &amp;lt;&amp;lt; 17ul ) )
{
gMeterCounter++;

//pulse meter 1
LPC_GPIOINT-&amp;gt;IO0IntClr |=&amp;nbsp; (1ul &amp;lt;&amp;lt; 17ul );//clear the interrupt flag
}
else
if( LPC_GPIOINT-&amp;gt;IO0IntStatF &amp;amp; (1ul &amp;lt;&amp;lt; 25ul ) )
{
//pulse meter2
LPC_GPIOINT-&amp;gt;IO0IntClr |=&amp;nbsp; (1ul &amp;lt;&amp;lt; 25ul );//clear the interrupt flag
}
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've attached the map file of each build, I don't understand how this "harmless" change can affect the USB module like this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for any help you can give,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Aaron&lt;/SPAN&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337907" rel="nofollow noopener noreferrer" target="_blank"&gt;wo-modCounter.txt.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337907" rel="nofollow noopener noreferrer" target="_blank"&gt;w-modCounter.txt.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:41:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/usb-WDH-interrupt-not-always-happening/m-p/519906#M3397</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: usb WDH interrupt not always happening</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/usb-WDH-interrupt-not-always-happening/m-p/519907#M3398</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 Wed Aug 20 04:01:46 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Is HOST_WdhIntr declared "volatile"?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wolfgang&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:41:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/usb-WDH-interrupt-not-always-happening/m-p/519907#M3398</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: usb WDH interrupt not always happening</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/usb-WDH-interrupt-not-always-happening/m-p/519908#M3399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by alager on Wed Aug 20 08:43:30 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;yes it is:&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&amp;nbsp; USB_INT32U&amp;nbsp;&amp;nbsp; HOST_WdhIntr&amp;nbsp; = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Semaphore to wait until the TD is submitted&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&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 17:41:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/usb-WDH-interrupt-not-always-happening/m-p/519908#M3399</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: usb WDH interrupt not always happening</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/usb-WDH-interrupt-not-always-happening/m-p/519909#M3400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by ezharkov on Wed Aug 20 10:50:20 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;We also have a project (LPC1788) in which we sometimes do not get a WDH interrupt. Therefore, I'd like to hear what you find out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:41:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/usb-WDH-interrupt-not-always-happening/m-p/519909#M3400</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: usb WDH interrupt not always happening</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/usb-WDH-interrupt-not-always-happening/m-p/519910#M3401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by alager on Thu Aug 21 09:19:21 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you using the same USB stack, from the cmsis2 examples?&amp;nbsp; Or are you using the open lpc example?&amp;nbsp; I'm looking at using the new open plc version, they were release in early this year.&amp;nbsp; maybe they're better?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But it still seems odd since it's the hardware module that is not behaving correctly.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:41:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/usb-WDH-interrupt-not-always-happening/m-p/519910#M3401</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: usb WDH interrupt not always happening</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/usb-WDH-interrupt-not-always-happening/m-p/519911#M3402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by ezharkov on Thu Aug 21 09:44:45 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;What I'm using is based on one of the pre-lpcopen releases (lpc177x_8x\Drivers\source\lpc177x_8x_usbhost.c). They don't seem to have a similar file for lpc175x_6x. But my guess is that it is pretty much the same thing as what you are using.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(I have not personally seen the problem myself yet. Everything seemed to work just fine for me. Both on LPC1788 and on an LPC176x. But another developer noticed a problem on an LPC1788 and it looked very similar to what you describe. I.e., slight changes to seemingly unrelated parts of the code would make the problem show up or go away.)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:41:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/usb-WDH-interrupt-not-always-happening/m-p/519911#M3402</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: usb WDH interrupt not always happening</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/usb-WDH-interrupt-not-always-happening/m-p/519912#M3403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by alager on Wed Aug 27 10:34:36 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;No one else has faced this issue?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:41:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/usb-WDH-interrupt-not-always-happening/m-p/519912#M3403</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: usb WDH interrupt not always happening</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/usb-WDH-interrupt-not-always-happening/m-p/519913#M3404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by alager on Thu Sep 04 08:25:17 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;As a follow up, I did comparisons with the versions that did work, with the version that did not work.&amp;nbsp; The only thing I could find was that the memory from alloc ( for the usb buffers), was on an 8 byte boundary for the one that fails.&amp;nbsp; The two that work were both on 16 byte boundaries.&amp;nbsp; So I added some code to align the memory to 16 byte boundaries, and that seems to have fixed it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The weird part is that looking through the lpcopen code, it appears to be aligned on 4 byte boundaries, so I'm not sure if this will totally fix my issue, but it is for now, until things fail again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Aaron&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:41:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/usb-WDH-interrupt-not-always-happening/m-p/519913#M3404</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:41:07Z</dc:date>
    </item>
  </channel>
</rss>

