<?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>i.MX ProcessorsのトピックRe: NETIF driver doesn't rise up the NETIF_FLAG_LINK_UP flag</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/NETIF-driver-doesn-t-rise-up-the-NETIF-FLAG-LINK-UP-flag/m-p/1848337#M222611</link>
    <description>&lt;P&gt;Hello, sorry for the late response, I reviewed your information, and I did try the example that you mentioned, but the example works as expected, so I have a question, are you using the RT1170 in a dual-core mode? or could you elaborate further about your application? please.&lt;/P&gt;&lt;P&gt;Best regards,&lt;BR /&gt;Pavel&lt;/P&gt;</description>
    <pubDate>Tue, 16 Apr 2024 17:08:49 GMT</pubDate>
    <dc:creator>Pavel_Hernandez</dc:creator>
    <dc:date>2024-04-16T17:08:49Z</dc:date>
    <item>
      <title>NETIF driver doesn't rise up the NETIF_FLAG_LINK_UP flag</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/NETIF-driver-doesn-t-rise-up-the-NETIF-FLAG-LINK-UP-flag/m-p/1828641#M221278</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm getting a weird behaviour while trying to run UDP communication on&amp;nbsp;MIMXRT1170-EVK board.&lt;/P&gt;&lt;P&gt;The communication is supposed to run on CM4 core whose code is moved into the SDRAM (starting address: 0x80000000). Now I'm debugging only CM4 core so the CM7 shouldn't have any effect on the behaviour or atleast that's what I would expect.&lt;/P&gt;&lt;P&gt;Now get to the strange behaviour. I'm using the 100M ethernet connector which is supposed to work as UDP communication (and modbus later). I initialize the communication basically through this sequence (it's basically the&amp;nbsp;&lt;EM&gt;lwip_ping_cm4&amp;nbsp;&lt;/EM&gt;example) :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;IP4_ADDR(&amp;amp;netif_ipaddr, configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3);
IP4_ADDR(&amp;amp;netif_netmask, configNET_MASK0, configNET_MASK1, configNET_MASK2, configNET_MASK3);
IP4_ADDR(&amp;amp;netif_gw, configGW_ADDR0, configGW_ADDR1, configGW_ADDR2, configGW_ADDR3);

lwip_init();
netif_add(netif, &amp;amp;netif_ipaddr, &amp;amp;netif_netmask, &amp;amp;netif_gw, &amp;amp;enet_config, NETIF_INIT_FN, ethernet_input);
netif_set_default(netif);
netif_set_up(netif);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works fine,&amp;nbsp;&lt;STRONG&gt;I'm able to PING the device, send message from PC to MCU which receive it just fine, I even pass the "cable testing" right there&lt;/STRONG&gt;&amp;nbsp;(which is right under the &lt;EM&gt;netif_set_up(netif)&amp;nbsp;&lt;/EM&gt;from previous code example):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;while(ethernetif_wait_linkup(&amp;amp;netif, 500) != ERR_OK) {}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when it comes to sending message back it goes through all the function ending up inside the&amp;nbsp;&lt;EM&gt;ip4_route()&lt;/EM&gt;&amp;nbsp;function when it comes to testing&amp;nbsp;cable connection by the&amp;nbsp;&lt;EM&gt;netif_is_link_up(netif_default))&lt;/EM&gt;&amp;nbsp;function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only documentation about the&amp;nbsp;&lt;EM&gt;NETIF_FLAG_LINK_UP&lt;/EM&gt;&amp;nbsp;is:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;If set, the interface has an active link (set by the network interface driver). Either set by the netif driver in its init function (if the link is up at that time) or at a later point once the link comes up (if link detection is supported by the hardware).&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So I guess there's something going on with the &lt;EM&gt;Netif driver&lt;/EM&gt; but I can't figure out what it is since I can normally ping and receive any message. Well not entirely, I mean for some reason there's a slight chance that after sending message from PC to MCU the program will crash looking like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MichalKv_0-1710430836261.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/268458i8EC953F0658B37CC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MichalKv_0-1710430836261.png" alt="MichalKv_0-1710430836261.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But this behaviour is as random as my attempts to fix it since sometimes it happens after first message, sometimes it's after 500th message...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;IDE:&amp;nbsp;&lt;EM&gt;MCUXpresso&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;SDK:&amp;nbsp;&lt;EM&gt;2.15.00&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;Board: &lt;EM&gt;MIMXRT1170-EVK&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;MCU:&amp;nbsp;&lt;EM&gt;MIMXRT1176&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appriciate any tips what might cause this behaviour.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Michal.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 08:59:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/NETIF-driver-doesn-t-rise-up-the-NETIF-FLAG-LINK-UP-flag/m-p/1828641#M221278</guid>
      <dc:creator>MichalKv</dc:creator>
      <dc:date>2024-03-19T08:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: ENET driver doesn't rise up the NETIF_FLAG_LINK_UP flag</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/NETIF-driver-doesn-t-rise-up-the-NETIF-FLAG-LINK-UP-flag/m-p/1830877#M221442</link>
      <description>&lt;P&gt;&lt;STRONG&gt;UPDATE #1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;So after a while I found out I'm able to rise the flag manually through the&amp;nbsp;&lt;EM&gt;netif_set_linkup()&amp;nbsp;&lt;/EM&gt;function&amp;nbsp;which means I loose the option to automatically notice connected cable but until I somehow find out what's wrong, it's good enough for atleast testing. After rising up the flag manually I'm able to debug and the program seems to be working however the ethernet crashes after some messages (the crash looks like the "Bus Fault" from the original post) but it's often after receiving around 280 messages so it seems like it might be some problem with buffer overflow on my side but I didn't have that much time to find out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would still appriciate any tips or info what might cause the&amp;nbsp;&lt;EM&gt;NETIF_FLAG_LINK_UP&amp;nbsp;&lt;/EM&gt;flag not rising up automatically.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Michal.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;UPDATE #1.1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I just randomly found that macro&amp;nbsp;&lt;EM&gt;LWIP_DHCP_DOES_ACD_CHECK&amp;nbsp;&lt;/EM&gt;was defined twice - first time in&amp;nbsp;&lt;EM&gt;opt.h,&amp;nbsp;&lt;/EM&gt;second time in&amp;nbsp;&lt;EM&gt;lwipopts.h&lt;/EM&gt; with different values. After fixing that the ethernet seems to be running fine (2000 messages and still going).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The main problem (aka&amp;nbsp;&lt;EM&gt;NETIF_FLAG_LINK_UP&lt;/EM&gt;) still persists.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Michal.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 07:26:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/NETIF-driver-doesn-t-rise-up-the-NETIF-FLAG-LINK-UP-flag/m-p/1830877#M221442</guid>
      <dc:creator>MichalKv</dc:creator>
      <dc:date>2024-03-19T07:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: ENET driver doesn't rise up the NETIF_FLAG_LINK_UP flag</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/NETIF-driver-doesn-t-rise-up-the-NETIF-FLAG-LINK-UP-flag/m-p/1843339#M222311</link>
      <description>&lt;P&gt;Hello, sorry for the late response, my name is Pavel, and I will be supporting your case, could you tell me the status of your last message?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regard,&lt;BR /&gt;Pavel&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2024 18:41:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/NETIF-driver-doesn-t-rise-up-the-NETIF-FLAG-LINK-UP-flag/m-p/1843339#M222311</guid>
      <dc:creator>Pavel_Hernandez</dc:creator>
      <dc:date>2024-04-09T18:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: ENET driver doesn't rise up the NETIF_FLAG_LINK_UP flag</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/NETIF-driver-doesn-t-rise-up-the-NETIF-FLAG-LINK-UP-flag/m-p/1846773#M222493</link>
      <description>&lt;P&gt;Hello Pavel,&lt;/P&gt;&lt;P&gt;I'm not sure if you're asking about what hapened since last update but if yes I have to say nothing much. I moved to work on other parts of the project since the program is working fine if I rise the flag by myself.&lt;/P&gt;&lt;P&gt;However I'm still curious and I would like to know what causes the behaviour because I haven't noticed anything different from an examples where the "cable connected flag" is being rised automatically just fine. But as I said I haven't notice any more differences and I don't have any other idea where the problem might be.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought it might be connected with working on custom board but it's not working even on the MIMXRT1170-EVK kit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Michal.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2024 06:23:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/NETIF-driver-doesn-t-rise-up-the-NETIF-FLAG-LINK-UP-flag/m-p/1846773#M222493</guid>
      <dc:creator>MichalKv</dc:creator>
      <dc:date>2024-04-15T06:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: ENET driver doesn't rise up the NETIF_FLAG_LINK_UP flag</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/NETIF-driver-doesn-t-rise-up-the-NETIF-FLAG-LINK-UP-flag/m-p/1847347#M222536</link>
      <description>&lt;P&gt;Hello, thanks for your comments, I was asking because your last feedback has been some weeks, let me research more information about this, I will contact you when I have more information.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Pavel&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2024 17:32:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/NETIF-driver-doesn-t-rise-up-the-NETIF-FLAG-LINK-UP-flag/m-p/1847347#M222536</guid>
      <dc:creator>Pavel_Hernandez</dc:creator>
      <dc:date>2024-04-15T17:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: NETIF driver doesn't rise up the NETIF_FLAG_LINK_UP flag</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/NETIF-driver-doesn-t-rise-up-the-NETIF-FLAG-LINK-UP-flag/m-p/1848337#M222611</link>
      <description>&lt;P&gt;Hello, sorry for the late response, I reviewed your information, and I did try the example that you mentioned, but the example works as expected, so I have a question, are you using the RT1170 in a dual-core mode? or could you elaborate further about your application? please.&lt;/P&gt;&lt;P&gt;Best regards,&lt;BR /&gt;Pavel&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 17:08:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/NETIF-driver-doesn-t-rise-up-the-NETIF-FLAG-LINK-UP-flag/m-p/1848337#M222611</guid>
      <dc:creator>Pavel_Hernandez</dc:creator>
      <dc:date>2024-04-16T17:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: ENET driver doesn't rise up the NETIF_FLAG_LINK_UP flag</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/NETIF-driver-doesn-t-rise-up-the-NETIF-FLAG-LINK-UP-flag/m-p/1857120#M223134</link>
      <description>&lt;P&gt;Hello sorry for the late response I was asking for more information on the internal department, and this is the comments.&lt;/P&gt;
&lt;P&gt;You do not need to set&amp;nbsp;NETIF_FLAG_LINK_UP manually.&lt;/P&gt;
&lt;P&gt;NETIF_FLAG_LINK_UP reflects if the cable is connected, and this information is from PHY.&lt;/P&gt;
&lt;P&gt;When a cable is connected between RT1170 EVK and a PC(Or router), the ENET PHY would detect it.&lt;/P&gt;
&lt;P&gt;And then, in the code below, you can see how it works.&lt;/P&gt;
&lt;P&gt;So, when cable is plugged out, it would be detected by ENET PHY, and then NETIF_FLAG_LINK_UP would be cleared.&lt;/P&gt;
&lt;P&gt;You can verify this idea on EVK.&lt;/P&gt;
&lt;P&gt;So, on customer side, if he see this bit is cleared, it is quite possible ENET PHY detected the cabled is plugged out, or is not working well even when it is connected. Customer need to check the PHY status from PHY_GetLinkStatus(), if it is 0, need to check HW connection.&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;void ethernetif_probe_link(struct netif *netif_)
{
    phy_handle_t *phy = ethernetif_get_phy(netif_);
    bool status; // true = Link is up

    status_t st = PHY_GetLinkStatus(phy, &amp;amp;status);

    if (st == kStatus_Success)
    {
        LWIP_ASSERT_CORE_LOCKED();
        if (status)
        {
            phy_speed_t speed;
            phy_duplex_t duplex;

            st = PHY_GetLinkSpeedDuplex(phy, &amp;amp;speed, &amp;amp;duplex);
            if (st == kStatus_Success)
            {
                ethernetif_on_link_up(netif_, speed, duplex);
            }
            netif_set_link_up(netif_);
        }
        else
        {
            netif_set_link_down(netif_);
            ethernetif_on_link_down(netif_);
        }
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Pavel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 02:07:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/NETIF-driver-doesn-t-rise-up-the-NETIF-FLAG-LINK-UP-flag/m-p/1857120#M223134</guid>
      <dc:creator>Pavel_Hernandez</dc:creator>
      <dc:date>2024-04-30T02:07:05Z</dc:date>
    </item>
  </channel>
</rss>

