Broadcast Ethernet from F405 and DP83848

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: RoccoMarco, barthess

hybridA
Posts: 37
Joined: Wed Jan 12, 2022 7:15 am
Has thanked: 10 times
Been thanked: 5 times

Re: Broadcast Ethernet from F405 and DP83848

Postby hybridA » Sat Mar 04, 2023 4:35 am

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?

mikeprotts
Posts: 166
Joined: Wed Jan 09, 2019 12:37 pm
Has thanked: 19 times
Been thanked: 31 times

Re: Broadcast Ethernet from F405 and DP83848

Postby mikeprotts » Sat Mar 04, 2023 10:50 am

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

User avatar
Giovanni
Site Admin
Posts: 14462
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1078 times
Been thanked: 922 times
Contact:

Re: Broadcast Ethernet from F405 and DP83848

Postby Giovanni » Sat Mar 04, 2023 10:58 am

Hi,

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

Giovanni

hybridA
Posts: 37
Joined: Wed Jan 12, 2022 7:15 am
Has thanked: 10 times
Been thanked: 5 times

Re: Broadcast Ethernet from F405 and DP83848

Postby hybridA » Sat Mar 04, 2023 5:10 pm

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!


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 8 guests