<?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: watchdog test in S32K</title>
    <link>https://community.nxp.com/t5/S32K/watchdog-test/m-p/1469836#M15814</link>
    <description>&lt;P&gt;&lt;SPAN&gt;According to the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Application description&lt;/STRONG&gt;:&amp;nbsp;&lt;SPAN&gt;If the FLASH configuration will be used, &lt;U&gt;then the code will use the Reset Control Module to detect if the reset was caused by the Watchdog and will stop the execution of the program.&lt;/U&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;U&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WDOG Interrupt Application description.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/182417i65AEA1C8E111F506/image-size/large?v=v2&amp;amp;px=999" role="button" title="WDOG Interrupt Application description.png" alt="WDOG Interrupt Application description.png" /&gt;&lt;/span&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;After reset caused by the Watchdog(line 128), user can add a flag in it. And then you can add your own function in while loop according to flag.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wdog_interrupt.png" style="width: 944px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/182416i873CB84A1E563F5E/image-size/large?v=v2&amp;amp;px=999" role="button" title="wdog_interrupt.png" alt="wdog_interrupt.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jun 2022 08:13:33 GMT</pubDate>
    <dc:creator>Robin_Shen</dc:creator>
    <dc:date>2022-06-07T08:13:33Z</dc:date>
    <item>
      <title>watchdog test</title>
      <link>https://community.nxp.com/t5/S32K/watchdog-test/m-p/1469370#M15801</link>
      <description>&lt;P&gt;Hello NXP team,&amp;nbsp;&lt;/P&gt;&lt;P&gt;i need to perfrom a simple watch dog test, to check if it reset the MCU.&lt;/P&gt;&lt;P&gt;i come with the following concept, could be wrong !&lt;/P&gt;&lt;P&gt;Configure the watchdog and configure the systick&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void Start_Wd_Test()
{
	s_refreshNumber = 0;
	/* Install IRQ handlers for WDOG and SysTick interrupts */
	INT_SYS_InstallHandler(WDOG_EWM_IRQn, WDOG_ISR, (isr_t *)0);
	INT_SYS_InstallHandler(SysTick_IRQn, SysTick_Handler_wd, (isr_t *)0);

	/* Enable Watchdog IRQ */
	INT_SYS_EnableIRQ(WDOG_EWM_IRQn);

	/* Configure and enable SysTick */
	SysTick_Init();
	SysTick_Enable();

	/* Initialize WDOG */
	WDOG_DRV_Init(INST_WATCHDOG1, &amp;amp;watchdog1_Config0);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;start counting and feeding the watchdog for 8 cycles, once elapsed the MCU should reset.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/* Initialize SysTick counter */
void SysTick_Init(void)
{
	S32_SysTick-&amp;gt;RVR = 0xFFFFFFul;
	S32_SysTick-&amp;gt;CVR = 0ul;
	S32_SysTick-&amp;gt;CSR = 0u;
}

/* Enable SysTick counter and interrupt */
void SysTick_Enable(void)
{
	S32_SysTick-&amp;gt;CSR = S32_SysTick_CSR_TICKINT(1u) | S32_SysTick_CSR_ENABLE(1);
}

/* Disable SysTick */
void SysTick_Disable(void)
{
	S32_SysTick-&amp;gt;CSR = 0ul;
}

/* SysTick IRQ handler */
void SysTick_Handler_wd(void)
{
	/* Variable that stores the number of Watchdog triggers */

	/* After 8 watchdog refreshes, the interrupt will no longer reset the wdog counter */
	if(s_refreshNumber &amp;lt; 8)
	{
		/* Reset Watchdog counter */
		WDOG_DRV_Trigger(INST_WATCHDOG1);
		//printf("watch dog reseted \r\n");
		/* Increment refresh number */
		s_refreshNumber++;
	}
	
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The mcu throw an error "Stoped at vector catch" , and i can no longer comunicate with it.&lt;/P&gt;&lt;P&gt;any suggestion on how to do this correctly ?&amp;nbsp;i mean once the MCU reseted,&amp;nbsp; it should print the status to serial consol&amp;nbsp; saying that the reset was perfromed correctly and the MCU should start working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 12:22:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/watchdog-test/m-p/1469370#M15801</guid>
      <dc:creator>Lily_31_amz</dc:creator>
      <dc:date>2022-06-06T12:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: watchdog test</title>
      <link>https://community.nxp.com/t5/S32K/watchdog-test/m-p/1469678#M15808</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The test content you mentioned seems to be very similar to the example &lt;STRONG&gt;wdog_interrupt&lt;/STRONG&gt; in the &lt;STRONG&gt;S32SDK_S32K1XX_RTM_4.0.2&lt;/STRONG&gt;. Have you read the introduction to this example?(file:///C:/NXP/S32DS.3.4/S32DS/software/S32SDK_S32K1XX_RTM_4.0.2/doc/html_S32K144/wdog_interrupt_s32k144_group.html)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WDOG Interrupt.png" style="width: 574px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/182395i5BBADC22C8318846/image-size/large?v=v2&amp;amp;px=999" role="button" title="WDOG Interrupt.png" alt="WDOG Interrupt.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Robin&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 03:48:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/watchdog-test/m-p/1469678#M15808</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2022-06-07T03:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: watchdog test</title>
      <link>https://community.nxp.com/t5/S32K/watchdog-test/m-p/1469736#M15812</link>
      <description>&lt;P&gt;Hello Robin,&lt;/P&gt;&lt;P&gt;yes this example was taking from the SDK, the watchdog functionalities is correct, after 8 cycles the MCU reset and stopps.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;is there a way after a reset happens, to restart the board automatically ? and eventually check in a register if the reset was done correctly ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;regards.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 06:22:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/watchdog-test/m-p/1469736#M15812</guid>
      <dc:creator>Lily_31_amz</dc:creator>
      <dc:date>2022-06-07T06:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: watchdog test</title>
      <link>https://community.nxp.com/t5/S32K/watchdog-test/m-p/1469836#M15814</link>
      <description>&lt;P&gt;&lt;SPAN&gt;According to the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Application description&lt;/STRONG&gt;:&amp;nbsp;&lt;SPAN&gt;If the FLASH configuration will be used, &lt;U&gt;then the code will use the Reset Control Module to detect if the reset was caused by the Watchdog and will stop the execution of the program.&lt;/U&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;U&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WDOG Interrupt Application description.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/182417i65AEA1C8E111F506/image-size/large?v=v2&amp;amp;px=999" role="button" title="WDOG Interrupt Application description.png" alt="WDOG Interrupt Application description.png" /&gt;&lt;/span&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;After reset caused by the Watchdog(line 128), user can add a flag in it. And then you can add your own function in while loop according to flag.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wdog_interrupt.png" style="width: 944px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/182416i873CB84A1E563F5E/image-size/large?v=v2&amp;amp;px=999" role="button" title="wdog_interrupt.png" alt="wdog_interrupt.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 08:13:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/watchdog-test/m-p/1469836#M15814</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2022-06-07T08:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: watchdog test</title>
      <link>https://community.nxp.com/t5/S32K/watchdog-test/m-p/1469859#M15820</link>
      <description>&lt;P&gt;Thanks a lot Robin for you answer, i think we are close &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;im using freeRTOS, and once the reset is performed the applications stops and does not restart even if i turn the main power OFF-ON.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lily_31_amz_0-1654591417093.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/182419i35A22FD073010B84/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Lily_31_amz_0-1654591417093.png" alt="Lily_31_amz_0-1654591417093.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;is it possible to implement a Reset_Handler ? if so please give me an example.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 08:44:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/watchdog-test/m-p/1469859#M15820</guid>
      <dc:creator>Lily_31_amz</dc:creator>
      <dc:date>2022-06-07T08:44:45Z</dc:date>
    </item>
  </channel>
</rss>

