<?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のトピックwhy the mainLoopTask gone while run the lwip_FreeRTOS_s32k396 project for half an hour</title>
    <link>https://community.nxp.com/t5/S32K/why-the-mainLoopTask-gone-while-run-the-lwip-FreeRTOS-s32k396/m-p/2145654#M51558</link>
    <description>&lt;P&gt;why the mainLoopTask gone while run the lwip_FreeRTOS_s32k396 project for half an hour ，i import the profinet master control code and run the program ，got the below：the #1 task which is&amp;nbsp;mainLoopTask&amp;nbsp; is missing.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zhangzhixing_0-1754126647621.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/350689i73B7C85307341CD5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="zhangzhixing_0-1754126647621.png" alt="zhangzhixing_0-1754126647621.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;static void mainLoopTask(void* pvParameters)&lt;BR /&gt;{&lt;BR /&gt;(void)pvParameters;&lt;/P&gt;&lt;P&gt;/* initialize lwIP stack, network interfaces and applications */&lt;BR /&gt;#if !NO_SYS&lt;BR /&gt;err_t err;&lt;BR /&gt;sys_sem_t init_sem;&lt;/P&gt;&lt;P&gt;#if defined (CPU_MPC5777C)|| defined (CPU_MPC5746R)&lt;BR /&gt;#ifdef PIT_0&lt;BR /&gt;#define PIT PIT_0&lt;BR /&gt;#endif&lt;BR /&gt;PIT-&amp;gt;MCR &amp;amp;= (uint32_t)(~PIT_MCR_FRZ_MASK);/* stop the timer in debug workaround for compability on MPC5777C PIT timer*/&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;err = sys_sem_new(&amp;amp;init_sem, 0);&lt;BR /&gt;LWIP_ASSERT("failed to create init_sem", err == (err_t)ERR_OK);&lt;BR /&gt;LWIP_UNUSED_ARG(err);&lt;BR /&gt;tcpip_init(test_init, (void*)&amp;amp;init_sem);&lt;BR /&gt;/* we have to wait for initialization to finish before&lt;BR /&gt;* calling update_adapter()! */&lt;BR /&gt;(void)sys_sem_wait(&amp;amp;init_sem);&lt;BR /&gt;sys_sem_free(&amp;amp;init_sem);&lt;BR /&gt;#if (LWIP_SOCKET || LWIP_NETCONN) &amp;amp;&amp;amp; LWIP_NETCONN_SEM_PER_THREAD&lt;BR /&gt;netconn_thread_init();&lt;BR /&gt;#endif&lt;BR /&gt;#else /* !NO_SYS */&lt;BR /&gt;sys_init();&lt;BR /&gt;lwip_init();&lt;BR /&gt;test_init(NULL);&lt;BR /&gt;#endif /* !NO_SYS */&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#if LWIP_INIT_COMPLETE_CALLBACK&lt;BR /&gt;tcpip_init_complete_callback();&lt;BR /&gt;#endif /* LWIP_INIT_COMPLETE_CALLBACK */&lt;BR /&gt;// vJYBus_SetCyclicDataSize(4,4);&lt;BR /&gt;/* MAIN LOOP for driver update (and timers if NO_SYS) */&lt;BR /&gt;while (1) {&lt;BR /&gt;#if NO_SYS&lt;BR /&gt;/* handle timers (already done in tcpip.c when NO_SYS=0) */&lt;BR /&gt;sys_check_timeouts();&lt;BR /&gt;#else /* NO_SYS */&lt;BR /&gt;// sys_msleep(500);&lt;BR /&gt;// ucTestOut[0]++;&lt;BR /&gt;// ucTestOut[1]++;&lt;BR /&gt;// ucTestOut[2]++;&lt;BR /&gt;// ucTestOut[3]++;&lt;BR /&gt;// JYBus_WriteCylicData(ucTestOut, 4);&lt;/P&gt;&lt;P&gt;#endif /* NO_SYS */&lt;/P&gt;&lt;P&gt;#if defined(USING_RTD)&lt;BR /&gt;uint32 time_now = OsIf_GetMilliseconds();&lt;BR /&gt;#else /* USING_RTD */&lt;BR /&gt;uint32_t time_now = OSIF_GetMilliseconds();&lt;BR /&gt;#endif /* USING_RTD */&lt;BR /&gt;time_now = time_now / (double)1000;&lt;/P&gt;&lt;P&gt;/* If more than expected time passed during tests execution, shut down the stack */&lt;BR /&gt;if (time_now - start_time &amp;gt;= tests_timeout)&lt;BR /&gt;{&lt;BR /&gt;for(int i = 0 ; i &amp;lt; ETHIF_NUMBER ; i++)&lt;BR /&gt;{&lt;BR /&gt;ETHIF_SHUTDOWN(&amp;amp;network_interfaces[i]);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;end_tcpip_execution(NULL);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;#if (LWIP_SOCKET || LWIP_NETCONN) &amp;amp;&amp;amp; LWIP_NETCONN_SEM_PER_THREAD&lt;BR /&gt;netconn_thread_cleanup();&lt;BR /&gt;#endif&lt;BR /&gt;/* release the network interfaces... */&lt;BR /&gt;for(int i = 0 ; i &amp;lt; ETHIF_NUMBER ; i++)&lt;BR /&gt;{&lt;BR /&gt;ETHIF_SHUTDOWN(&amp;amp;network_interfaces[i]);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Sat, 02 Aug 2025 09:25:43 GMT</pubDate>
    <dc:creator>zhangzhixing</dc:creator>
    <dc:date>2025-08-02T09:25:43Z</dc:date>
    <item>
      <title>why the mainLoopTask gone while run the lwip_FreeRTOS_s32k396 project for half an hour</title>
      <link>https://community.nxp.com/t5/S32K/why-the-mainLoopTask-gone-while-run-the-lwip-FreeRTOS-s32k396/m-p/2145654#M51558</link>
      <description>&lt;P&gt;why the mainLoopTask gone while run the lwip_FreeRTOS_s32k396 project for half an hour ，i import the profinet master control code and run the program ，got the below：the #1 task which is&amp;nbsp;mainLoopTask&amp;nbsp; is missing.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zhangzhixing_0-1754126647621.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/350689i73B7C85307341CD5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="zhangzhixing_0-1754126647621.png" alt="zhangzhixing_0-1754126647621.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;static void mainLoopTask(void* pvParameters)&lt;BR /&gt;{&lt;BR /&gt;(void)pvParameters;&lt;/P&gt;&lt;P&gt;/* initialize lwIP stack, network interfaces and applications */&lt;BR /&gt;#if !NO_SYS&lt;BR /&gt;err_t err;&lt;BR /&gt;sys_sem_t init_sem;&lt;/P&gt;&lt;P&gt;#if defined (CPU_MPC5777C)|| defined (CPU_MPC5746R)&lt;BR /&gt;#ifdef PIT_0&lt;BR /&gt;#define PIT PIT_0&lt;BR /&gt;#endif&lt;BR /&gt;PIT-&amp;gt;MCR &amp;amp;= (uint32_t)(~PIT_MCR_FRZ_MASK);/* stop the timer in debug workaround for compability on MPC5777C PIT timer*/&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;err = sys_sem_new(&amp;amp;init_sem, 0);&lt;BR /&gt;LWIP_ASSERT("failed to create init_sem", err == (err_t)ERR_OK);&lt;BR /&gt;LWIP_UNUSED_ARG(err);&lt;BR /&gt;tcpip_init(test_init, (void*)&amp;amp;init_sem);&lt;BR /&gt;/* we have to wait for initialization to finish before&lt;BR /&gt;* calling update_adapter()! */&lt;BR /&gt;(void)sys_sem_wait(&amp;amp;init_sem);&lt;BR /&gt;sys_sem_free(&amp;amp;init_sem);&lt;BR /&gt;#if (LWIP_SOCKET || LWIP_NETCONN) &amp;amp;&amp;amp; LWIP_NETCONN_SEM_PER_THREAD&lt;BR /&gt;netconn_thread_init();&lt;BR /&gt;#endif&lt;BR /&gt;#else /* !NO_SYS */&lt;BR /&gt;sys_init();&lt;BR /&gt;lwip_init();&lt;BR /&gt;test_init(NULL);&lt;BR /&gt;#endif /* !NO_SYS */&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#if LWIP_INIT_COMPLETE_CALLBACK&lt;BR /&gt;tcpip_init_complete_callback();&lt;BR /&gt;#endif /* LWIP_INIT_COMPLETE_CALLBACK */&lt;BR /&gt;// vJYBus_SetCyclicDataSize(4,4);&lt;BR /&gt;/* MAIN LOOP for driver update (and timers if NO_SYS) */&lt;BR /&gt;while (1) {&lt;BR /&gt;#if NO_SYS&lt;BR /&gt;/* handle timers (already done in tcpip.c when NO_SYS=0) */&lt;BR /&gt;sys_check_timeouts();&lt;BR /&gt;#else /* NO_SYS */&lt;BR /&gt;// sys_msleep(500);&lt;BR /&gt;// ucTestOut[0]++;&lt;BR /&gt;// ucTestOut[1]++;&lt;BR /&gt;// ucTestOut[2]++;&lt;BR /&gt;// ucTestOut[3]++;&lt;BR /&gt;// JYBus_WriteCylicData(ucTestOut, 4);&lt;/P&gt;&lt;P&gt;#endif /* NO_SYS */&lt;/P&gt;&lt;P&gt;#if defined(USING_RTD)&lt;BR /&gt;uint32 time_now = OsIf_GetMilliseconds();&lt;BR /&gt;#else /* USING_RTD */&lt;BR /&gt;uint32_t time_now = OSIF_GetMilliseconds();&lt;BR /&gt;#endif /* USING_RTD */&lt;BR /&gt;time_now = time_now / (double)1000;&lt;/P&gt;&lt;P&gt;/* If more than expected time passed during tests execution, shut down the stack */&lt;BR /&gt;if (time_now - start_time &amp;gt;= tests_timeout)&lt;BR /&gt;{&lt;BR /&gt;for(int i = 0 ; i &amp;lt; ETHIF_NUMBER ; i++)&lt;BR /&gt;{&lt;BR /&gt;ETHIF_SHUTDOWN(&amp;amp;network_interfaces[i]);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;end_tcpip_execution(NULL);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;#if (LWIP_SOCKET || LWIP_NETCONN) &amp;amp;&amp;amp; LWIP_NETCONN_SEM_PER_THREAD&lt;BR /&gt;netconn_thread_cleanup();&lt;BR /&gt;#endif&lt;BR /&gt;/* release the network interfaces... */&lt;BR /&gt;for(int i = 0 ; i &amp;lt; ETHIF_NUMBER ; i++)&lt;BR /&gt;{&lt;BR /&gt;ETHIF_SHUTDOWN(&amp;amp;network_interfaces[i]);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Sat, 02 Aug 2025 09:25:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/why-the-mainLoopTask-gone-while-run-the-lwip-FreeRTOS-s32k396/m-p/2145654#M51558</guid>
      <dc:creator>zhangzhixing</dc:creator>
      <dc:date>2025-08-02T09:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: why the mainLoopTask gone while run the lwip_FreeRTOS_s32k396 project for half an hour</title>
      <link>https://community.nxp.com/t5/S32K/why-the-mainLoopTask-gone-while-run-the-lwip-FreeRTOS-s32k396/m-p/2146043#M51574</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/245816"&gt;@zhangzhixing&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please comment out the entire timeout section in the code, as I typically do when bringing up lwIP examples on various boards:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;!--ScriptorStartFragment--&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="scriptor-paragraph"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PavelL_0-1754295798109.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/350779iFBF5D73F42D3C624/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PavelL_0-1754295798109.png" alt="PavelL_0-1754295798109.png" /&gt;&lt;/span&gt;
&lt;P&gt;&lt;SPAN&gt;T&lt;/SPAN&gt;&lt;SPAN&gt;he variable &lt;/SPAN&gt;&lt;SPAN&gt;tests_timeout&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;is set to&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;1200&lt;/SPAN&gt;&lt;SPAN&gt;, which corresponds to&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;20 minutes&lt;/SPAN&gt;&lt;SPAN&gt;. After this period, the code explicitly shuts down the Ethernet interfaces and calls&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;end_tcpip_execution(NULL)&lt;/SPAN&gt;&lt;SPAN&gt;, which may internally terminate the&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;mainLoopTask&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Pavel&lt;/P&gt;</description>
      <pubDate>Mon, 04 Aug 2025 08:25:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/why-the-mainLoopTask-gone-while-run-the-lwip-FreeRTOS-s32k396/m-p/2146043#M51574</guid>
      <dc:creator>PavelL</dc:creator>
      <dc:date>2025-08-04T08:25:28Z</dc:date>
    </item>
  </channel>
</rss>

