<?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>S32KのトピックRe: Watchdog fast test</title>
    <link>https://community.nxp.com/t5/S32K/Watchdog-fast-test/m-p/843930#M3428</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If you have still problems with the WDOG test, you can refer to:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-342049"&gt;https://community.nxp.com/docs/DOC-342049&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Nov 2018 12:11:47 GMT</pubDate>
    <dc:creator>danielmartynek</dc:creator>
    <dc:date>2018-11-27T12:11:47Z</dc:date>
    <item>
      <title>Watchdog fast test</title>
      <link>https://community.nxp.com/t5/S32K/Watchdog-fast-test/m-p/843929#M3427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having issues in handling the Watchdog fast test in the S32K116 EVB.&lt;/P&gt;&lt;P&gt;I do not perform the disable watchdog in system init, because if I disable it it clears the flags il WDOG_CS_TST and overwrites the content of the TOVAL register.&lt;/P&gt;&lt;P&gt;Saving the to a global variable is not going to work fine because then I lost the content during the INIT_bss(), so I want to use my own function just at the start of the main();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I edited the WDOG_Config from the SDK in order to set also test modes from the config structure; furthermore I start with cs variable set to zero instead of unsetting parameters because bitmasks then don't allow me to set the "user" configuration (see sample):&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;status_t WDOG_Config(WDOG_Type * const base,&lt;BR /&gt; const wdog_user_config_t * wdogUserConfig)&lt;BR /&gt;{&lt;BR /&gt; status_t status = STATUS_SUCCESS;&lt;BR /&gt; uint32_t cs = base-&amp;gt;CS;&lt;BR /&gt; bool tmp1 = WDOG_IsEnabled(base);&lt;BR /&gt; bool tmp2 = WDOG_IsUpdateEnabled(base);&lt;/P&gt;&lt;P&gt;INT_SYS_DisableIRQGlobal();&lt;/P&gt;&lt;P&gt;if ((tmp1 == false) &amp;amp;&amp;amp; (tmp2 == true))&lt;BR /&gt; {&lt;BR /&gt; /* Clear the bits used for configuration */&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt; cs &amp;amp;= ~(WDOG_CS_WIN_MASK | WDOG_CS_PRES_MASK | WDOG_CS_CLK_MASK | WDOG_CS_INT_MASK |&lt;BR /&gt; WDOG_CS_UPDATE_MASK | WDOG_CS_DBG_MASK | WDOG_CS_WAIT_MASK | WDOG_CS_STOP_MASK);&lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;cs = 0;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt; /* Construct CS register new value */&lt;BR /&gt; cs |= WDOG_CS_WIN(wdogUserConfig-&amp;gt;winEnable ? 1UL : 0UL);&lt;BR /&gt; cs |= WDOG_CS_PRES(wdogUserConfig-&amp;gt;prescalerEnable ? 1UL : 0UL);&lt;BR /&gt; cs |= WDOG_CS_CLK(wdogUserConfig-&amp;gt;clkSource);&lt;BR /&gt; cs |= WDOG_CS_INT(wdogUserConfig-&amp;gt;intEnable ? 1UL : 0UL);&lt;BR /&gt; cs |= WDOG_CS_UPDATE(wdogUserConfig-&amp;gt;updateEnable ? 1UL : 0UL);&lt;/P&gt;&lt;P&gt;&amp;nbsp; cs |= WDOG_CS_TST(&lt;SPAN style="background-color: #f6f6f6;"&gt;wdogUserConfig&lt;/SPAN&gt;-&amp;gt;testMode);&lt;BR /&gt;if (wdogUserConfig-&amp;gt;opMode.debug)&lt;BR /&gt; {&lt;BR /&gt; cs |= WDOG_CS_DBG_MASK;&lt;BR /&gt; }&lt;BR /&gt; if (wdogUserConfig-&amp;gt;opMode.wait)&lt;BR /&gt; {&lt;BR /&gt; cs |= WDOG_CS_WAIT_MASK;&lt;BR /&gt; }&lt;BR /&gt; if (wdogUserConfig-&amp;gt;opMode.stop)&lt;BR /&gt; {&lt;BR /&gt; cs |= WDOG_CS_STOP_MASK;&lt;BR /&gt; }&lt;BR /&gt; /* Reset interrupt flags */&lt;BR /&gt; cs |= WDOG_CS_FLG_MASK;&lt;BR /&gt; /* Enable WDOG in 32-bit mode */&lt;BR /&gt; cs |= WDOG_CS_EN_MASK | WDOG_CS_CMD32EN_MASK;&lt;/P&gt;&lt;P&gt;WDOG_UNLOCK(base);&lt;BR /&gt; /*LDRA_NOANALYSIS*/&lt;BR /&gt; /* The comment LDRA_NOANALYSIS only use to run code coverage */&lt;BR /&gt; while (!WDOG_IsUnlocked(base))&lt;BR /&gt; {&lt;BR /&gt; /* Wait until registers are unlocked */&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;base-&amp;gt;CS = cs;&lt;BR /&gt; base-&amp;gt;TOVAL = wdogUserConfig-&amp;gt;timeoutValue;&lt;BR /&gt; if (wdogUserConfig-&amp;gt;winEnable)&lt;BR /&gt; {&lt;BR /&gt; base-&amp;gt;WIN = wdogUserConfig-&amp;gt;windowValue;&lt;BR /&gt; }&lt;BR /&gt; /*LDRA_ANALYSIS*/&lt;BR /&gt; /* The comment LDRA_ANALYSIS only use to run code coverage */&lt;/P&gt;&lt;P&gt;while (WDOG_IsUnlocked(base))&lt;BR /&gt; {&lt;BR /&gt; /* Wait until the unlock window closes */&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;while (!WDOG_IsReconfigurationComplete(base))&lt;BR /&gt; {&lt;BR /&gt; /* Wait until the reconfiguration successful */&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; status = STATUS_ERROR;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;INT_SYS_EnableIRQGlobal();&lt;/P&gt;&lt;P&gt;return status;&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Using this function looks like my values are never updated, even if inspecting with embsysregs the values look fine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have read and read again the RM and look to the examples, still can't figure what's wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many questions here:&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) when I unlock the wdog writing to CNT, does the WDOG stop?&lt;/P&gt;&lt;P&gt;2) Do I have to disable the wdog and then update the configuration since I am not disabiling the wdog in system init?&lt;/P&gt;&lt;P&gt;3) DO I have to perform a complete initialization of the watchdog AFTER reset for each test case?&amp;nbsp;&lt;/P&gt;&lt;P&gt;4) What happens when into the WDOG both test case and disable flag&amp;nbsp;are written to the register?&lt;/P&gt;&lt;P&gt;5) &lt;SPAN&gt;What happens&amp;nbsp;&amp;nbsp;if I&amp;nbsp;unlock the WDOG&amp;nbsp;&lt;/SPAN&gt;after the POR writing to CNT?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;6)&amp;nbsp;To disable the WDOG do I need to write CS AND TOVAL?&amp;nbsp;Section 23.5.1 and 23.5.2 are not helping me in understanding this point.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;7) let's assume the first wdog reset happens because of the fast test. Do I need to reconfigure the update flag?I'ts not a POR so I suppose it shall keep the conf value?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;8)&amp;nbsp;let's assume both wdog reset&amp;nbsp;went fine and the update is still set&amp;nbsp; to 1.Now I have to set the test register to USER. Do I need to perform a full configuration of the wdog? Can I set back the update flag to 0?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B.R.&lt;/P&gt;&lt;P&gt;L.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Nov 2018 09:40:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Watchdog-fast-test/m-p/843929#M3427</guid>
      <dc:creator>Catosh</dc:creator>
      <dc:date>2018-11-16T09:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Watchdog fast test</title>
      <link>https://community.nxp.com/t5/S32K/Watchdog-fast-test/m-p/843930#M3428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If you have still problems with the WDOG test, you can refer to:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-342049"&gt;https://community.nxp.com/docs/DOC-342049&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2018 12:11:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Watchdog-fast-test/m-p/843930#M3428</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2018-11-27T12:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: Watchdog fast test</title>
      <link>https://community.nxp.com/t5/S32K/Watchdog-fast-test/m-p/843931#M3429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Daniel,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to solve my issues but I'll take a look to the example you provided - maybe I can learn something new!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2018 12:58:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Watchdog-fast-test/m-p/843931#M3429</guid>
      <dc:creator>Catosh</dc:creator>
      <dc:date>2018-11-27T12:58:39Z</dc:date>
    </item>
  </channel>
</rss>

