<?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: How can I use the Watchdog functionality in MQX? in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/How-can-I-use-the-Watchdog-functionality-in-MQX/m-p/200672#M4455</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi O.O Life,&lt;/P&gt;&lt;P&gt;To test I placed a breakpoint in the task watchdog handle_watchdog_expiry() function after the printf call.&lt;/P&gt;&lt;P&gt;If my core watchdog was setup to expire quickly then just hitting the breakpoint and stepping or resuming execution would show that the core watchdog generated a reset.&amp;nbsp;Alternatively you can set breakpoint in _bsp_core_wd_isr() interrupt,&amp;nbsp;run the code, break/halt and wait for longer than what the core watchdog timeout is and then resume execution to see if core watchdog interrupt breakpoint gets hit.&amp;nbsp; If yes then use the "View--&amp;gt;Register" pull-down to inspect the RSR bits.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The RSR bits BWT and WDR are for the backup watchdog timer and not the core timer example I'm showing you.&amp;nbsp; So those bits should not be setting.&lt;/P&gt;&lt;P&gt;NOTE: RSR register is read-only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the SOFT bit sets, that implies that the core watchdog interrupt fired properly as it is its code that issues the Soft Reset by setting the setting the SOFTRST bit in the RCR register.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I re-ran my code that outputs the RSR register value and it shows External Reset (0x04) then after the task watchdog expires and my debugger hits breakpoint and I wait until the core watchdog times out, I resume execution and the RSR now is Soft (0x20).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is how to read the RSR:&lt;/P&gt;&lt;P&gt;VMCF5225_STRUCT_PTR reg_ptr = _PSP_GET_IPSBAR();&lt;BR /&gt;printf("\n %d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RSR: 0x%P", n, reg_ptr-&amp;gt;CCM.RSR);&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 May 2010 02:42:29 GMT</pubDate>
    <dc:creator>DavidS</dc:creator>
    <dc:date>2010-05-19T02:42:29Z</dc:date>
    <item>
      <title>How can I use the Watchdog functionality in MQX?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/How-can-I-use-the-Watchdog-functionality-in-MQX/m-p/200669#M4452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CPU: MCF52259&lt;/P&gt;&lt;P&gt;Tool: CW 7.2&lt;/P&gt;&lt;P&gt;OS: MQX 3.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to error recovery using watchdog functionality.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tested example located in mqx folder.&lt;/P&gt;&lt;P&gt;(C:\Program Files\Freescale\Freescale MQX 3.4\mqx\examples\watchdog)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Call other function in Watchdog handler function&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;handle_watchdog_expiry()&lt;/STRONG&gt;&amp;nbsp;function is working and seems good.&lt;/P&gt;&lt;P&gt;However, some function is not working correctly in this function for example TCP/IP send function.&lt;/P&gt;&lt;P&gt;Is it correct?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Detecting watchdog status&amp;nbsp;when boot up&lt;/P&gt;&lt;P&gt;I just want to RESET using RCR register when watchdog expired.&lt;/P&gt;&lt;P&gt;Then, how can I detect when I boot up,&amp;nbsp;it is watchdog reset or normal reset?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. Normal Watchdog strategy in MQX on MCF52259&lt;/P&gt;&lt;P&gt;Is there any example or article about watchdog usage on MQX?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for reading this.&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;O.O Life.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 May 2010 07:55:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/How-can-I-use-the-Watchdog-functionality-in-MQX/m-p/200669#M4452</guid>
      <dc:creator>OOLife</dc:creator>
      <dc:date>2010-05-17T07:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use the Watchdog functionality in MQX?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/How-can-I-use-the-Watchdog-functionality-in-MQX/m-p/200670#M4453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi O. O Life,&lt;/P&gt;&lt;P&gt;The examples/watchdog is actually setting up a task software watchdog timer.&amp;nbsp; This timer&amp;nbsp;is using the BSP tick timer (PIT0) to test whether the task watchdog has expired and not using the on-chip core watchdog module.&lt;/P&gt;&lt;P&gt;The on-chip core watchdog is partially setup in the init_bsp.c file.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Several things need to be added to make the core watchdog operate:&lt;/P&gt;&lt;P&gt;1) create a core watchdog ISR that can implement the software reset operation (RCR register bit 7).&lt;/P&gt;&lt;P&gt;2) initialize the ICR for core watchdog and clear the IMRL bit for the software watchdog (bit 8).&lt;/P&gt;&lt;P&gt;3) register/install the ISR (_int_install_isr())&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hassles:&lt;/P&gt;&lt;P&gt;- once core watchdog is running, system is hard to debug and the timer does not stop when debugger halts processor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Read RSR register (in Reset Controller Module right after the RCR definition) to check what caused the reset.&amp;nbsp; My code is not doing that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've attached my enhanced version of the example/watchdog source code file that sets everything up.&amp;nbsp; I'm running from internal flash and you can monitor the serial port to see the value of "n" being printed.&amp;nbsp; If you wait&amp;nbsp;~10 seconds&amp;nbsp;the task handle_watchdog_expiry() function gets called.&lt;/P&gt;&lt;P&gt;If you halt in that function on the ___mqx_exit(1); function call,&amp;nbsp;then the core watchdog will time out quickly and once you resume running the system will have reset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that I lowered the core watchdog timeout value in init_bsp.c _bsp_setup_watchdog() as follows:&lt;/P&gt;&lt;P&gt;| MCF5225_SCM_CWCR_CWT(BSP_WATCHDOG_DELAY-2);&amp;nbsp;//DES added -2 to speed testing&lt;BR /&gt;Otherwise you would have to halt the debugger and wait about a minute to get&amp;nbsp;the core watchdog to timeout.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 May 2010 00:53:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/How-can-I-use-the-Watchdog-functionality-in-MQX/m-p/200670#M4453</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2010-05-18T00:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use the Watchdog functionality in MQX?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/How-can-I-use-the-Watchdog-functionality-in-MQX/m-p/200671#M4454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi DavidS..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much about answer my question and sharing your code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tested my code according to your comment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, my code is not working.&lt;/P&gt;&lt;P&gt;When I boot up, I read the RSR register.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RSR Register value&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Power On ==&amp;gt; 0x48 &lt;SPAN&gt;&lt;/SPAN&gt;It's good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Soft Reset ==&amp;gt; 0x20 &amp;nbsp; It also good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Watchdog Reset ==&amp;gt; 0x20 different from my expectation. (actually, my expectation value is 0x10 or 0x80)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My application already use Soft Reset(RCR=0x80) functionality, so I want to know there is watchdog reset or not.&lt;/P&gt;&lt;P&gt;But, I don't catch the watchdog reset condition by reading RSR register...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I reset my system with the SET bit BWT or WDR in RSR register.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you comment about this?&lt;/P&gt;&lt;P&gt;or, could you show me the reading RSR register reading example?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, Thank you very much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards..&lt;/P&gt;&lt;P&gt;O.O Life&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 May 2010 11:39:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/How-can-I-use-the-Watchdog-functionality-in-MQX/m-p/200671#M4454</guid>
      <dc:creator>OOLife</dc:creator>
      <dc:date>2010-05-18T11:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use the Watchdog functionality in MQX?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/How-can-I-use-the-Watchdog-functionality-in-MQX/m-p/200672#M4455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi O.O Life,&lt;/P&gt;&lt;P&gt;To test I placed a breakpoint in the task watchdog handle_watchdog_expiry() function after the printf call.&lt;/P&gt;&lt;P&gt;If my core watchdog was setup to expire quickly then just hitting the breakpoint and stepping or resuming execution would show that the core watchdog generated a reset.&amp;nbsp;Alternatively you can set breakpoint in _bsp_core_wd_isr() interrupt,&amp;nbsp;run the code, break/halt and wait for longer than what the core watchdog timeout is and then resume execution to see if core watchdog interrupt breakpoint gets hit.&amp;nbsp; If yes then use the "View--&amp;gt;Register" pull-down to inspect the RSR bits.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The RSR bits BWT and WDR are for the backup watchdog timer and not the core timer example I'm showing you.&amp;nbsp; So those bits should not be setting.&lt;/P&gt;&lt;P&gt;NOTE: RSR register is read-only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the SOFT bit sets, that implies that the core watchdog interrupt fired properly as it is its code that issues the Soft Reset by setting the setting the SOFTRST bit in the RCR register.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I re-ran my code that outputs the RSR register value and it shows External Reset (0x04) then after the task watchdog expires and my debugger hits breakpoint and I wait until the core watchdog times out, I resume execution and the RSR now is Soft (0x20).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is how to read the RSR:&lt;/P&gt;&lt;P&gt;VMCF5225_STRUCT_PTR reg_ptr = _PSP_GET_IPSBAR();&lt;BR /&gt;printf("\n %d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RSR: 0x%P", n, reg_ptr-&amp;gt;CCM.RSR);&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 May 2010 02:42:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/How-can-I-use-the-Watchdog-functionality-in-MQX/m-p/200672#M4455</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2010-05-19T02:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use the Watchdog functionality in MQX?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/How-can-I-use-the-Watchdog-functionality-in-MQX/m-p/200673#M4456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi DavidS..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When system boot up, I can distinguish RESET type.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards.&lt;/P&gt;&lt;P&gt;O.O Life&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>Wed, 19 May 2010 14:41:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/How-can-I-use-the-Watchdog-functionality-in-MQX/m-p/200673#M4456</guid>
      <dc:creator>OOLife</dc:creator>
      <dc:date>2010-05-19T14:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use the Watchdog functionality in MQX?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/How-can-I-use-the-Watchdog-functionality-in-MQX/m-p/200674#M4457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;you are talking about an attached source code... where can I find it?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2016 12:10:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/How-can-I-use-the-Watchdog-functionality-in-MQX/m-p/200674#M4457</guid>
      <dc:creator>davidaustinsorr</dc:creator>
      <dc:date>2016-11-14T12:10:37Z</dc:date>
    </item>
  </channel>
</rss>

