This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EK_TM4C1294开发套件 enet_lwip例程问题?



enet_lwip例程问题:如果设置 lwip 使用  lwIPInit(g_ui32SysClock, pui8MACArray, 0xc0a80008, 0xffffff00, 0xc0a80001, IPADDR_USE_STATIC); 固定IP时,IP地址无法保存?

  • 修改了 lwipopts.h文件里的 LWIP_DHCP 为 0 ,可以使用固定IP了,然而有不能够使用DHCP了

  • 问题已经解决 修改了 lwiplib.c文件

  • 楼主,我也弄了,但是一直不成功,痛苦中

  • #if LWIP_AUTOIP || LWIP_DHCP
    static void
    lwIPLinkDetect(void)
    {
    bool bHaveLink;
    struct ip_addr ip_addr;
    struct ip_addr net_mask;
    struct ip_addr gw_addr;

    //
    // See if there is an active link.
    //
    bHaveLink = MAP_EMACPHYRead(EMAC0_BASE, 0, EPHY_BMSR) & EPHY_BMSR_LINKSTAT;

    //
    // Return without doing anything else if the link state hasn't changed.
    //
    if(bHaveLink == g_bLinkActive)
    {
    return;
    }

    //
    // Save the new link state.
    //
    g_bLinkActive = bHaveLink;

    //
    //如果设置 DHCP AUTOIP 清空IP地址
    //
    if((g_ui32IPMode == IPADDR_USE_DHCP)||(g_ui32IPMode == IPADDR_USE_AUTOIP))
    {
    //
    // Clear any address information from the network interface.
    //
    ip_addr.addr = 0;
    net_mask.addr = 0;
    gw_addr.addr = 0;
    netif_set_addr(&g_sNetIF, &ip_addr, &net_mask, &gw_addr);
    }

    //
    // See if there is a link now.
    //
    if(bHaveLink)
    {
    //
    // Start DHCP, if enabled.
    //
    #if LWIP_DHCP
    if(g_ui32IPMode == IPADDR_USE_DHCP)
    {
    dhcp_start(&g_sNetIF);
    }
    #endif

    //
    // Start AutoIP, if enabled and DHCP is not.
    //
    #if LWIP_AUTOIP
    if(g_ui32IPMode == IPADDR_USE_AUTOIP)
    {
    autoip_start(&g_sNetIF);
    }
    #endif
    }
    else
    {
    //
    // Stop DHCP, if enabled.
    //
    #if LWIP_DHCP
    if(g_ui32IPMode == IPADDR_USE_DHCP)
    {
    dhcp_stop(&g_sNetIF);
    }
    #endif

    //
    // Stop AutoIP, if enabled and DHCP is not.
    //
    #if LWIP_AUTOIP
    if(g_ui32IPMode == IPADDR_USE_AUTOIP)
    {
    autoip_stop(&g_sNetIF);
    }
    #endif
    }
    }
    #endif

  • 麻烦发个TM4C129的官方例程enet_lwip  给我,1922039135@qq.com感谢。

    我下载了驱动库为啥里面没看到?

  • 麻烦发个TM4C129的官方例程enet_lwip 给我,1922039135@qq.com感谢。

    我下载了驱动库为啥里面没看到?