lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Trying to work out DHCP issue


From: Chris Seto
Subject: Re: [lwip-users] Trying to work out DHCP issue
Date: Tue, 27 Feb 2018 14:32:55 -0600

Hi Simon,

Yes, the link is established. I monitor the TLK110 constantly and use the following snippit to set LwIP up or down. Just out of curiosity, do you recall where you've seen TI be sad about the TLK110? It's been OK for me so far. I am having a new issue with it where the link comes up and then immediately goes down repetitively with a 25' long Ethernet cable That may be related. Have you ever seen anything like that? It works fine with a shorter cable, though I have not isolated the cable explicitly yet. 

void ethernetif_check_link_state(struct netif *netif)
{
uint32_t tmp;
static uint8_t lastLinkStatus = 0;
uint8_t linkUp;

// Read status register
if(HAL_ETH_ReadPHYRegister(&EthHandle, PHY_BMSR, &tmp) != HAL_OK)
{
printf("Read fail!\r\n");
return;
}
linkUp = (tmp & PHY_LINKED_STATUS) ? 1 : 0;
// Check status of the link
if(linkUp != lastLinkStatus)
{
if (linkUp)
{
printf("Link up!!!!\r\n");
netif_set_link_up(netif);
}
else
{
printf("Link down...\r\n");
netif_set_link_down(netif);
}
lastLinkStatus = linkUp;
}
}

On Tue, Feb 27, 2018 at 12:34 PM, address@hidden <address@hidden> wrote:
On 27.02.2018 18:41, Chris Seto wrote:
Oh, one thing to note:

I an using no OS. There are no threads at all other than main

In that case, are you sure the link got established? If I remember correctly, TI support itself is not too fond of the TLK110?

If the link *got* established (i.e. no PHY or hardware issue), try wireshark to see what's wrong.


Simon

On Tue, Feb 27, 2018 at 11:39 AM, goldsimon <address@hidden> wrote:


Chris Seto wrote:
>I have a custom board with an STM32F4, and a TLK110 running LwIP 2.0.3.
>The
>board works great when it gets, an address, and I can freely exchange
>data
>with a socket server.
>
>On board bootup, I set the IP to 0 and then use dhcp_start() to start
>DHCP.
>When the code sees that the IP is no longer just 0, it tries to connect
>to
>the socket server.
>
>Most of the time this works well.

This looks like a threading issue. The examples from STM are horribly wrong in that respect. Read the docs at http://www.nongnu.org/lwip/ to learn about threading. Also, try upgrading to fit master and use the new LWIP_ASSERT_CORE_LOCKED() check (has to be implemented for your arch, look at our Freertos port for an example).

Simon

_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users



_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users



_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users


reply via email to

[Prev in Thread] Current Thread [Next in Thread]