<?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 Watchdog kicks in for 22F in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Watchdog-kicks-in-for-22F/m-p/437397#M25541</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've got a working code running happily on Freedom eval stack.&amp;nbsp; Now the production board comes in, and the same software doesn't run anymore.&lt;BR /&gt;The only difference in the board is Eval board has 512 memory and the production is using 256 (MK22FN256xxx12).&lt;/P&gt;&lt;P&gt;I've made changes to the include paths/ files etc to use 256 instead of 512&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could trace the code and blinks some LEDs, however, then the watchdog kicks in.&lt;/P&gt;&lt;P&gt;I got stopped at &lt;SPAN style="color: #1f497d; font-family: Calibri, sans-serif; font-size: 14.6666669845581px;"&gt;Watchdog_IRQHandler.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Thread [1] &amp;lt;main&amp;gt; (Suspended : Signal : SIGTRAP:Trace/breakpoint trap)&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;Watchdog_IRQHandler() at startup_MK22F25612.S:356 0x518&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&amp;lt;signal handler called&amp;gt;() at 0xfffffff9&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;hardware_init() at hardware_init.c:37 0x9a7c&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;main() at main.c:478 0xa2f2&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I notice that we do go through the SystemInit (in system_MK22F25612.c) and the disabling of the watchdog.&amp;nbsp; But for most of my experiment, I did not stop there to make sure that I don't interfere with the startup timing within which we have to disable the watchdog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, how do I:&lt;BR /&gt;1. know that WDOG is already disabled?&lt;BR /&gt;In main, I could see watchdog registers as follows.&amp;nbsp; It seems like WDOG is already disabled in CTRLH.&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x1d2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CTRLH&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x&lt;/SPAN&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CTRLL&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x&lt;/SPAN&gt;4c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TOVALH&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x&lt;/SPAN&gt;4b4c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TOVALL&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x&lt;/SPAN&gt;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WINH&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x&lt;/SPAN&gt;10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WINL&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x&lt;/SPAN&gt;b480&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REFRESH&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x&lt;/SPAN&gt;d928&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNLOCK&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x&lt;/SPAN&gt;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TMROUTH&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x&lt;/SPAN&gt;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TMROUTL&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x0&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RSTCNT&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x&lt;/SPAN&gt;400&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRESC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Is it possible that in this production board I don't get to SystemInit fast enough, ie failed to disable the watchdog after time has expired?&lt;BR /&gt;Is there a way to check how many bus cycles have passed before I reach it?&lt;BR /&gt;Or, this doesn't make sense? I didn't really change the code coming from Freescale.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help/insights in very appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Oh another thing is, I was going to check if EWM is enabled by accident.&amp;nbsp; But we're not interested in enabling any watchdog so I doubt there'd be any "accident" like that.&amp;nbsp; But when I try to read that register, guess what, watchdog kicks in.&amp;nbsp; Here was how I tried to read it.&amp;nbsp; But even in eval board this happens, so I guess I'm not supposed to touch it anyways.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp[0]= EWM_CTRL;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp[1]= EWM_SERV;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp[2]= EWM_CMPL;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp[3]= EWM_CMPH;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp[4]= EWM_CLKPRESCALER;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Cecylia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Jul 2015 00:32:43 GMT</pubDate>
    <dc:creator>cwati</dc:creator>
    <dc:date>2015-07-23T00:32:43Z</dc:date>
    <item>
      <title>Watchdog kicks in for 22F</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Watchdog-kicks-in-for-22F/m-p/437397#M25541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've got a working code running happily on Freedom eval stack.&amp;nbsp; Now the production board comes in, and the same software doesn't run anymore.&lt;BR /&gt;The only difference in the board is Eval board has 512 memory and the production is using 256 (MK22FN256xxx12).&lt;/P&gt;&lt;P&gt;I've made changes to the include paths/ files etc to use 256 instead of 512&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could trace the code and blinks some LEDs, however, then the watchdog kicks in.&lt;/P&gt;&lt;P&gt;I got stopped at &lt;SPAN style="color: #1f497d; font-family: Calibri, sans-serif; font-size: 14.6666669845581px;"&gt;Watchdog_IRQHandler.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Thread [1] &amp;lt;main&amp;gt; (Suspended : Signal : SIGTRAP:Trace/breakpoint trap)&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;Watchdog_IRQHandler() at startup_MK22F25612.S:356 0x518&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&amp;lt;signal handler called&amp;gt;() at 0xfffffff9&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;hardware_init() at hardware_init.c:37 0x9a7c&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;main() at main.c:478 0xa2f2&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I notice that we do go through the SystemInit (in system_MK22F25612.c) and the disabling of the watchdog.&amp;nbsp; But for most of my experiment, I did not stop there to make sure that I don't interfere with the startup timing within which we have to disable the watchdog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, how do I:&lt;BR /&gt;1. know that WDOG is already disabled?&lt;BR /&gt;In main, I could see watchdog registers as follows.&amp;nbsp; It seems like WDOG is already disabled in CTRLH.&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x1d2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CTRLH&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x&lt;/SPAN&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CTRLL&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x&lt;/SPAN&gt;4c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TOVALH&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x&lt;/SPAN&gt;4b4c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TOVALL&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x&lt;/SPAN&gt;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WINH&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x&lt;/SPAN&gt;10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WINL&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x&lt;/SPAN&gt;b480&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REFRESH&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x&lt;/SPAN&gt;d928&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNLOCK&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x&lt;/SPAN&gt;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TMROUTH&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x&lt;/SPAN&gt;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TMROUTL&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x0&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RSTCNT&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;0x&lt;/SPAN&gt;400&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRESC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Is it possible that in this production board I don't get to SystemInit fast enough, ie failed to disable the watchdog after time has expired?&lt;BR /&gt;Is there a way to check how many bus cycles have passed before I reach it?&lt;BR /&gt;Or, this doesn't make sense? I didn't really change the code coming from Freescale.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help/insights in very appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Oh another thing is, I was going to check if EWM is enabled by accident.&amp;nbsp; But we're not interested in enabling any watchdog so I doubt there'd be any "accident" like that.&amp;nbsp; But when I try to read that register, guess what, watchdog kicks in.&amp;nbsp; Here was how I tried to read it.&amp;nbsp; But even in eval board this happens, so I guess I'm not supposed to touch it anyways.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp[0]= EWM_CTRL;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp[1]= EWM_SERV;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp[2]= EWM_CMPL;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp[3]= EWM_CMPH;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp[4]= EWM_CLKPRESCALER;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Cecylia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2015 00:32:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Watchdog-kicks-in-for-22F/m-p/437397#M25541</guid>
      <dc:creator>cwati</dc:creator>
      <dc:date>2015-07-23T00:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Watchdog kicks in for 22F</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Watchdog-kicks-in-for-22F/m-p/437398#M25542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Never minddd&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Turns out the SPI changes, from SPI1 to SPI0.&amp;nbsp; And, we forgot to change the interrupts for the SPI from PTD to PTC oh well.&lt;BR /&gt;So it's more like unhandled interrupt, not sure why it popped out as watchdog interrupt in the first place =)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void PORTD_IRQHandler(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIO_DRV_ClearPinIntFlag(mpu9250_int_pin.pinName);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data_avail = true;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void SPI1_IRQHandler(void)&amp;nbsp;&amp;nbsp;&amp;nbsp; /* sensor module uses SPI1 for invensense */&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DSPI_DRV_IRQHandler(HW_SPI1);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2015 01:35:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Watchdog-kicks-in-for-22F/m-p/437398#M25542</guid>
      <dc:creator>cwati</dc:creator>
      <dc:date>2015-07-23T01:35:31Z</dc:date>
    </item>
  </channel>
</rss>

