Page 2 of 2

Re: Broadcast Ethernet from F405 and DP83848

Posted: Sat Mar 04, 2023 4:35 am
by hybridA
that's exactly what I did - just changed the makefile to use the REV_D config, and the sample app worked great!
Also got udp broadcast messages working.
I noticed it takes a few seconds after calling lwipinit() until the driver is truly ready. If my app does not wait, the sendto() never succeeds.

Since open-loop sleeps are risky, I wrote a little wrapper around netif_is_link_up(), in lwipthread.c:

Code: Select all

bool lwipReady() {
  return netif_is_link_up(&thisif);
}


in my app I then call:

Code: Select all

lwipInit(nullptr);
while (!lwipReady()) {
   chThdSleepMilliseconds(50);
}


Is there already a way of checking if the driver is ready?

Re: Broadcast Ethernet from F405 and DP83848

Posted: Sat Mar 04, 2023 10:50 am
by mikeprotts
Glad this is now working for you.

I wouldn't expect much delay from lwipinit() to being ready - is it connected to an Ethernet switch or directly to another host? If another host, it may be that it's the other end of the cable that's slow.

Mike

Re: Broadcast Ethernet from F405 and DP83848

Posted: Sat Mar 04, 2023 10:58 am
by Giovanni
Hi,

It should be macPollLinkStatus(), it is done at MAC driver level.

Giovanni

Re: Broadcast Ethernet from F405 and DP83848

Posted: Sat Mar 04, 2023 5:10 pm
by hybridA
The delay is the same (or at least very similar) if connected directly to PC or through router. it's around 2sec. Not an issue in my application.
macPollLinkStatus() worked great!