<?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: Problem in ethernet starts while LAN cable disconnected in MCUXpresso SDK</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/Problem-in-ethernet-starts-while-LAN-cable-disconnected/m-p/1754492#M4533</link>
    <description>&lt;P&gt;Hello, sorry but I´m afraid there is no nothing like this, I suggest creating a task supervisor to avoid using the counter.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Pavel&lt;/P&gt;</description>
    <pubDate>Wed, 08 Nov 2023 23:51:36 GMT</pubDate>
    <dc:creator>Pavel_Hernandez</dc:creator>
    <dc:date>2023-11-08T23:51:36Z</dc:date>
    <item>
      <title>Problem in ethernet starts while LAN cable disconnected</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Problem-in-ethernet-starts-while-LAN-cable-disconnected/m-p/1741272#M4507</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using a custom board based on RT1064, with MCUXpresso 11.8.0 and SDK 2.12.0.&lt;/P&gt;&lt;P&gt;The board uses a LAN8720A ethernet tranceiver that is working fine.&lt;/P&gt;&lt;P&gt;I have a trouble when the system starts with then LAN cable disconnected: if I connect the cable after the init is completed, a ping packet from another device is not answered.&lt;/P&gt;&lt;P&gt;Here is a summary of my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;tcpip_init( NULL, NULL );
...
netif_add( &amp;amp;NetIfLAN, &amp;amp;IPAddress, &amp;amp;NetMask, &amp;amp;DGAddress, &amp;amp;EthConfig, ethernetif0_init, tcpip_input );
netif_set_default( &amp;amp;NetIfLAN );
StartNetworkSupervisor();&lt;/LI-CODE&gt;&lt;LI-CODE lang="c"&gt;void NetWorkSupervisor( void )
{
	bool link, oldlink = false;

	while( 1 )
	{
		if( PHY_GetLinkStatus( EthConfig.phyHandle, &amp;amp;link ) != kStatus_Success )
			link = false;
		if( link != oldlink )
		{
			if( link != false )
			{
				PRINTF( "LINK UP\n" );
				sys_lock_tcpip_core();
				//netif_set_link_up( &amp;amp;NetIfLAN );
				netif_set_up( &amp;amp;NetIfLAN );
				sys_unlock_tcpip_core();
			}
			else
			{
				PRINTF( "LINK DOWN\n" );
				sys_lock_tcpip_core();
				//netif_set_down( &amp;amp;NetIfLAN );
				netif_set_link_down( &amp;amp;NetIfLAN );
				sys_unlock_tcpip_core();
			}
			oldlink = link;
		}
		...
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the terminal I can see the "LINK UP" and "LINK DOWN" strings, so the connection and disconnection events are handled. I tried both with and without the&amp;nbsp;netif_set_link_up() and&amp;nbsp;netif_set_link_down() calls, but the behaviour is the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have some suggestion?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Biafra&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 11:21:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Problem-in-ethernet-starts-while-LAN-cable-disconnected/m-p/1741272#M4507</guid>
      <dc:creator>biafra</dc:creator>
      <dc:date>2023-10-17T11:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in ethernet starts while LAN cable disconnected</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Problem-in-ethernet-starts-while-LAN-cable-disconnected/m-p/1741607#M4509</link>
      <description>&lt;P&gt;Hello, my name is Pavel, and I will be supporting your case, I reviewed your comments, and I suggest reviewing the example on the SDK because there are some states in the protocol that need to wait. Maybe you could do a porting.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pavel_Hernandez_0-1697584609430.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/245590iE082C4E429A201D7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Pavel_Hernandez_0-1697584609430.png" alt="Pavel_Hernandez_0-1697584609430.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Pavel_Hernandez_0-1697584609430.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Pavel&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 23:17:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Problem-in-ethernet-starts-while-LAN-cable-disconnected/m-p/1741607#M4509</guid>
      <dc:creator>Pavel_Hernandez</dc:creator>
      <dc:date>2023-10-17T23:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in ethernet starts while LAN cable disconnected</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Problem-in-ethernet-starts-while-LAN-cable-disconnected/m-p/1742170#M4510</link>
      <description>&lt;P&gt;Hi Pavel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your answer.&lt;/P&gt;&lt;P&gt;I reviewed some example in SDK about LwIP, and I noticed that in freertos examples&amp;nbsp;netifapi_netif_xxx functions are used.&lt;/P&gt;&lt;P&gt;So in my code I replaced the&amp;nbsp;netif_xxx functions with the corresponding&amp;nbsp;netifapi_netif_xxx functions, but the behaviour is the same.&lt;/P&gt;&lt;P&gt;In such examples I couldn't find the states to wait you mentioned: can you give me some details about them?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Biafra&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2023 14:24:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Problem-in-ethernet-starts-while-LAN-cable-disconnected/m-p/1742170#M4510</guid>
      <dc:creator>biafra</dc:creator>
      <dc:date>2023-10-18T14:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in ethernet starts while LAN cable disconnected</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Problem-in-ethernet-starts-while-LAN-cable-disconnected/m-p/1749791#M4525</link>
      <description>&lt;P&gt;Hello, sorry for the late response I apologize for the last response I was not clear; I recommend reviewing how the examples work they have a blocking mode of wait state until connecting the LAN cable.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pavel_Hernandez_0-1698785290261.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/247794i9BAE3C0576DAD116/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Pavel_Hernandez_0-1698785290261.png" alt="Pavel_Hernandez_0-1698785290261.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Pavel_Hernandez_0-1698785290261.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Pavel&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 20:49:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Problem-in-ethernet-starts-while-LAN-cable-disconnected/m-p/1749791#M4525</guid>
      <dc:creator>Pavel_Hernandez</dc:creator>
      <dc:date>2023-10-31T20:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in ethernet starts while LAN cable disconnected</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Problem-in-ethernet-starts-while-LAN-cable-disconnected/m-p/1750969#M4528</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/196430"&gt;@Pavel_Hernandez&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your answer.&lt;/P&gt;&lt;P&gt;Sorry for my&amp;nbsp;my lack of clarity, I'll try to explain myself better.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The blocking mode have a configurable max numer of attempts (ENET_ATONEGOTIATION_TIMEOUT) to wait&amp;nbsp;until connecting the LAN cable. If I connect the LAN cable &lt;U&gt;&lt;STRONG&gt;before&lt;/STRONG&gt;&lt;/U&gt; the number of attempts reaches&amp;nbsp;ENET_ATONEGOTIATION_TIMEOUT the system works fine.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The system doesn't work if I connect the LAN cable &lt;STRONG&gt;&lt;U&gt;after&lt;/U&gt;&lt;/STRONG&gt; the max numer of attempts is reached.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The&amp;nbsp;NetWorkSupervisor task is intended to recognize the cable connection/disconnection and to do the needed operartions to make the system work in all situations.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Biafra&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 08:54:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Problem-in-ethernet-starts-while-LAN-cable-disconnected/m-p/1750969#M4528</guid>
      <dc:creator>biafra</dc:creator>
      <dc:date>2023-11-02T08:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in ethernet starts while LAN cable disconnected</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Problem-in-ethernet-starts-while-LAN-cable-disconnected/m-p/1753748#M4531</link>
      <description>&lt;P&gt;Hello, sorry for the late response what is the example where you find that functions&amp;nbsp;NetWorkSupervisor, I reviewed&amp;nbsp;the httpsrv_freertos but I can't find&amp;nbsp;this.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;BR /&gt;Pavel&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 22:43:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Problem-in-ethernet-starts-while-LAN-cable-disconnected/m-p/1753748#M4531</guid>
      <dc:creator>Pavel_Hernandez</dc:creator>
      <dc:date>2023-11-07T22:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in ethernet starts while LAN cable disconnected</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Problem-in-ethernet-starts-while-LAN-cable-disconnected/m-p/1754052#M4532</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/196430"&gt;@Pavel_Hernandez&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your answer.&lt;/P&gt;&lt;P&gt;There isn't the NetWorkSupervisor() function in the examples, it's a function I've written thinking that it's needed to make the network work if it starts with the cable disconnected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Biafra&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 08:28:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Problem-in-ethernet-starts-while-LAN-cable-disconnected/m-p/1754052#M4532</guid>
      <dc:creator>biafra</dc:creator>
      <dc:date>2023-11-08T08:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in ethernet starts while LAN cable disconnected</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Problem-in-ethernet-starts-while-LAN-cable-disconnected/m-p/1754492#M4533</link>
      <description>&lt;P&gt;Hello, sorry but I´m afraid there is no nothing like this, I suggest creating a task supervisor to avoid using the counter.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Pavel&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 23:51:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Problem-in-ethernet-starts-while-LAN-cable-disconnected/m-p/1754492#M4533</guid>
      <dc:creator>Pavel_Hernandez</dc:creator>
      <dc:date>2023-11-08T23:51:36Z</dc:date>
    </item>
  </channel>
</rss>

