<?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>Kinetis MicrocontrollersのトピックK10 Watchdog resets MCU despite refresh</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K10-Watchdog-resets-MCU-despite-refresh/m-p/166128#M960</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I put the following code in an interrupt that triggers every 1ms (just as a test), but my watchdog still resets my MCU. Why?&lt;/P&gt;&lt;P&gt;I'm certain it's the watchdog resetting me because I check the SRS register at startup to know the reason for any reboot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;WDOG_REFRESH = 0xA602; WDOG_REFRESH = 0xB480;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my function to initialize the Watchdog. Can anyone think of something I've missed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/* =================================================================================================  FUNCTION DESCRIPTION:== Initialize the Watchdog (COP).====  OUTPUTS:==      N/A == =============================================================================================*/void WATCHDOG__initialize  (  void  )    {    /* Enable interrupts for Watchdog. */    ARM_CORTEX_M4__enable_interrupt( INT_Watchdog );             WDOG_TOVALH = WDOG_TOVALH_TOVALHIGH( MAX_U16 );    WDOG_TOVALL = WDOG_TOVALL_TOVALLOW( MAX_U16 );        /* Unlock and enable the Watchdog timer. */        WDOG_UNLOCK = 0xC520;  WDOG_UNLOCK = 0xD928;    WDOG_STCTRLH |= WDOG_STCTRLH_WDOGEN_MASK | WDOG_STCTRLH_IRQRSTEN_MASK;        WDOG_REFRESH = 0xA602; WDOG_REFRESH = 0xB480;        } /* WATCHDOG__initialize() */&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 09:13:14 GMT</pubDate>
    <dc:creator>ignisuti</dc:creator>
    <dc:date>2020-10-29T09:13:14Z</dc:date>
    <item>
      <title>K10 Watchdog resets MCU despite refresh</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K10-Watchdog-resets-MCU-despite-refresh/m-p/166128#M960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I put the following code in an interrupt that triggers every 1ms (just as a test), but my watchdog still resets my MCU. Why?&lt;/P&gt;&lt;P&gt;I'm certain it's the watchdog resetting me because I check the SRS register at startup to know the reason for any reboot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;WDOG_REFRESH = 0xA602; WDOG_REFRESH = 0xB480;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my function to initialize the Watchdog. Can anyone think of something I've missed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/* =================================================================================================  FUNCTION DESCRIPTION:== Initialize the Watchdog (COP).====  OUTPUTS:==      N/A == =============================================================================================*/void WATCHDOG__initialize  (  void  )    {    /* Enable interrupts for Watchdog. */    ARM_CORTEX_M4__enable_interrupt( INT_Watchdog );             WDOG_TOVALH = WDOG_TOVALH_TOVALHIGH( MAX_U16 );    WDOG_TOVALL = WDOG_TOVALL_TOVALLOW( MAX_U16 );        /* Unlock and enable the Watchdog timer. */        WDOG_UNLOCK = 0xC520;  WDOG_UNLOCK = 0xD928;    WDOG_STCTRLH |= WDOG_STCTRLH_WDOGEN_MASK | WDOG_STCTRLH_IRQRSTEN_MASK;        WDOG_REFRESH = 0xA602; WDOG_REFRESH = 0xB480;        } /* WATCHDOG__initialize() */&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:13:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K10-Watchdog-resets-MCU-despite-refresh/m-p/166128#M960</guid>
      <dc:creator>ignisuti</dc:creator>
      <dc:date>2020-10-29T09:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: K10 Watchdog resets MCU despite refresh</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K10-Watchdog-resets-MCU-despite-refresh/m-p/166129#M961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anyone?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2012 21:25:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K10-Watchdog-resets-MCU-despite-refresh/m-p/166129#M961</guid>
      <dc:creator>ignisuti</dc:creator>
      <dc:date>2012-05-30T21:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: K10 Watchdog resets MCU despite refresh</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K10-Watchdog-resets-MCU-despite-refresh/m-p/166130#M962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the problem is, you're trying to refresh the WDOG immediately after unlocking it.&amp;nbsp;A watch dog refresh won't be seen&amp;nbsp;withing the WCT window&amp;nbsp;after an unlock. In the unlocking and updating section(23.3.1) of the WDOG chapter,&amp;nbsp;it states:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Also, an attempted refresh operation between the two writes of the unlock sequence and in the WCT time following a successful unlock, goes undetected.&lt;/EM&gt;&lt;EM&gt;﻿&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You don't need to unlock the WDOG when you refresh it.﻿&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2012 01:04:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K10-Watchdog-resets-MCU-despite-refresh/m-p/166130#M962</guid>
      <dc:creator>ndavies</dc:creator>
      <dc:date>2012-05-31T01:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: K10 Watchdog resets MCU despite refresh</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K10-Watchdog-resets-MCU-despite-refresh/m-p/166131#M963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try writing the WDOG_TOVAL[HL] registers after the unlock operation. IIRC, WDOG punishes writes to these regs with reset when locked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2012 18:37:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K10-Watchdog-resets-MCU-despite-refresh/m-p/166131#M963</guid>
      <dc:creator>konrada</dc:creator>
      <dc:date>2012-05-31T18:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: K10 Watchdog resets MCU despite refresh</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K10-Watchdog-resets-MCU-despite-refresh/m-p/166132#M964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fellas, sorry for the late follow-up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did try your suggestions, but did not have any luck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Konrada, What do you mean by WDOG_TOVAL[HL]?&lt;/P&gt;&lt;P&gt;Is this what you mean? I'm already doing this.&lt;/P&gt;&lt;PRE&gt;WDOG_TOVALH = WDOG_TOVALH_TOVALHIGH( MAX_U16 );&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:13:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K10-Watchdog-resets-MCU-despite-refresh/m-p/166132#M964</guid>
      <dc:creator>ignisuti</dc:creator>
      <dc:date>2020-10-29T09:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: K10 Watchdog resets MCU despite refresh</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K10-Watchdog-resets-MCU-despite-refresh/m-p/166133#M965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Retriggering the watchdog when it hasn't been enabled causes a reset - therefore ensure carefully that the watchdog has in fact been enabled correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) I use the following initialisation sequence&lt;/P&gt;&lt;PRE&gt;UNLOCK_WDOG(); // this sequence must be performed within 20 bus cycles and the writes are possible for the WCT periodWDOG_TOVALL = 2000;WDOG_TOVALH = 0;WDOG_STCTRLH = (WDOG_STCTRLH_STNDBYEN | WDOG_STCTRLH_WAITEN | WDOG_STCTRLH_STOPEN | WDOG_STCTRLH_WDOGEN); // watchdog enabled to generate reset on 2s timeout (no further updates allowed)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I note that you write the timeout before unlocking the watchdog - maybe this is the cause of difficulties (?). Also the above writes the low value followed by high value (ordering may not be important but best check).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:13:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K10-Watchdog-resets-MCU-despite-refresh/m-p/166133#M965</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2020-10-29T09:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: K10 Watchdog resets MCU despite refresh</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K10-Watchdog-resets-MCU-despite-refresh/m-p/166134#M966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Hi, I recently came across this problem and you are also stuck at the same place.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;From the reference manual, the refresh code must be executed within 20 bus clock cycles after first trigger.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I feel the refresh may execute within 20 bus cycles but another refresh trigger may be kicked before the 20 bus cycles of the previous refresh was over. What i conclude from this is you need to wait for sometime before you execute the refresh again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;The best thing to do is and THE SOLUTION TO THIS PROBLEM FOR ME was to add a very small delay before executing the refresh to the watch dog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;REFRESH DOESNOT REQUIRE UNLOCKING OF THE WATCHDOG REGISTERS&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Best Regards&lt;BR /&gt;Kashyap Gada&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jun 2013 07:43:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K10-Watchdog-resets-MCU-despite-refresh/m-p/166134#M966</guid>
      <dc:creator>kashyapgada</dc:creator>
      <dc:date>2013-06-12T07:43:48Z</dc:date>
    </item>
  </channel>
</rss>

