<?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: LPC1549 WWDT not running [SOLVED] in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-WWDT-not-running-SOLVED/m-p/513217#M69</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by EtaPhi on Sun Mar 08 03:03:56 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I solved my issues with watchdog.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was wrong when I said that the watchdog is disabled during a debug session.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I succeded in debugging my watchdog code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course, it's impossible to set a breakpoint which is going to suspend execution while the watchdog is active because the watchdog generates a reset which disconnects the debugging probe.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The root of my issues is the WWDT_WDMOD_WDPROTECT bit in WD_MOD register. When I set this bit, the watchdog fails to start.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It may be a my fault, but the LPCOpen example does not show its use.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By the way, I found an error in the following statement of rev. 1.1 UM10736 (page 299):&lt;/SPAN&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;The Watchdog interrupt flag is set when the Watchdog counter reaches the value&lt;BR /&gt;specified by WARNINT. This flag is cleared when any reset occurs, and is cleared by&lt;BR /&gt;software by writing a 0 to this bit.&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error lies in the clearing sequence which must write a 1 to reset WDINT flag.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The LPCOpen driver (wwdt_15xx.c) is correct, since it contains the following code:&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;
/* Clear WWDT interrupt status flags */
void Chip_WWDT_ClearStatusFlag(LPC_WWDT_T *pWWDT, uint32_t status)
{
if (status &amp;amp; WWDT_WDMOD_WDTOF) {
pWWDT-&amp;gt;MOD &amp;amp;= (~WWDT_WDMOD_WDTOF) &amp;amp; WWDT_WDMOD_BITMASK;
}

if (status &amp;amp; WWDT_WDMOD_WDINT) {
pWWDT-&amp;gt;MOD |= WWDT_WDMOD_WDINT;
}
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EtaPhi&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 17:06:49 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T17:06:49Z</dc:date>
    <item>
      <title>LPC1549 WWDT not running [SOLVED]</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-WWDT-not-running-SOLVED/m-p/513214#M66</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by EtaPhi on Fri Feb 20 06:24:19 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm extending NXP IEC60335 library, because it doesn't check if WWDT is working and because some other security tests are missing (eg DMA controller test).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My code is simple.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After Cortex M3 registers test are passed, I look at SYSRSTSTAT register to find the reset source.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If WWDT forced a reset, a "magic number", which is stored in RAM, allows to tell a WWDT diagnostic reset from an unexpected one, so that the right action is taken.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If a Power-On, System or External reset restarted the core, WWDT dignostic code is executed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This code sets bit 22 of SYSAHBCLKCTRL0 to feed the clock to WWDT bus interface.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then bit 20 of PDRUNCFG is cleared to enable WDTOSC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;WWDT is then activated by storing 0x21 = WDEN + WDLOCK in WDMOD register.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;About 100 clock cycles are then wasted to wait at least 3 WDCLK cycles (the core is running @ 12 MHz; WDTOSC frequency should be 504 kHz) so that changes to WDMOD register may take effect.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My code then sends the sequence 0xAA 0x55 to the FEED register to start WWDT.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It finally reads WWDT TV register to check if WWDT started, but its value is always 0xFF.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Since there is a delay of 6 WDCLK cycles between two reads, I suppose that WDTOSC isn't running.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Why is WDTOSC not running?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If this behavoiur happens only during debug, how can I test my code?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BR&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EtaPhi&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:06:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-WWDT-not-running-SOLVED/m-p/513214#M66</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1549 WWDT not running [SOLVED]</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-WWDT-not-running-SOLVED/m-p/513215#M67</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by embd02161991 on Fri Feb 20 14:43:57 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you used LPCOpen WWDT example ? May be its a good starting point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Fcontent%2Fnxpfile%2Flpcopen-software-development-platform-lpc15xx-packages" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/nxpfile/lpcopen-software-development-platform-lpc15xx-packages&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;NXP Technical Support&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:06:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-WWDT-not-running-SOLVED/m-p/513215#M67</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1549 WWDT not running [SOLVED]</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-WWDT-not-running-SOLVED/m-p/513216#M68</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by EtaPhi on Sat Feb 21 03:43:09 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course I followed WWDT example, embd02161991!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The LPCOpen example can't be debugged too, because WWDT seems to be locked. Perhaps, LPCXpresso debugging tool chain disables WDOsc by using an undocumented feature.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As far as I can see, WWDT example runs fine on my LPCXpresso 1549 board&amp;nbsp; when it's standalone, but there is no way to debug it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My code follows what LPCOpen WWDT example does, but it's written in assembly because it replaces NXP IEC60335 code (i.e. Power On Self Test function) which is written in assembly too and runs before that C runtime is initialized.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm a little concerned about LPC1549 safety, because if a debugger can disable WWDT by using an undocumented feature, there is a (little) probability that a misbehaving code may disable it too...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your reply!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EtaPhi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:06:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-WWDT-not-running-SOLVED/m-p/513216#M68</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1549 WWDT not running [SOLVED]</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-WWDT-not-running-SOLVED/m-p/513217#M69</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by EtaPhi on Sun Mar 08 03:03:56 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I solved my issues with watchdog.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was wrong when I said that the watchdog is disabled during a debug session.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I succeded in debugging my watchdog code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course, it's impossible to set a breakpoint which is going to suspend execution while the watchdog is active because the watchdog generates a reset which disconnects the debugging probe.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The root of my issues is the WWDT_WDMOD_WDPROTECT bit in WD_MOD register. When I set this bit, the watchdog fails to start.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It may be a my fault, but the LPCOpen example does not show its use.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By the way, I found an error in the following statement of rev. 1.1 UM10736 (page 299):&lt;/SPAN&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;The Watchdog interrupt flag is set when the Watchdog counter reaches the value&lt;BR /&gt;specified by WARNINT. This flag is cleared when any reset occurs, and is cleared by&lt;BR /&gt;software by writing a 0 to this bit.&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error lies in the clearing sequence which must write a 1 to reset WDINT flag.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The LPCOpen driver (wwdt_15xx.c) is correct, since it contains the following code:&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;
/* Clear WWDT interrupt status flags */
void Chip_WWDT_ClearStatusFlag(LPC_WWDT_T *pWWDT, uint32_t status)
{
if (status &amp;amp; WWDT_WDMOD_WDTOF) {
pWWDT-&amp;gt;MOD &amp;amp;= (~WWDT_WDMOD_WDTOF) &amp;amp; WWDT_WDMOD_BITMASK;
}

if (status &amp;amp; WWDT_WDMOD_WDINT) {
pWWDT-&amp;gt;MOD |= WWDT_WDMOD_WDINT;
}
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EtaPhi&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:06:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-WWDT-not-running-SOLVED/m-p/513217#M69</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:06:49Z</dc:date>
    </item>
  </channel>
</rss>

