w5500-evb-pico using lwip ‘C’ library hangs on wizchip_initialise() when Ethernet cable is unplugged from board.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: w5500-evb-pico using lwip ‘C’ library hangs on wizchip_initialise() when Ethernet cable is unplugged from board.
by Eugeny ·
I asked for link to the sources in previous thread you commented in. Please provide link to the sources.
Looking to the ioLibrary_Driver I see
case CW_GET_PHYLINKhere thenwizphy_getphylink()here and thengetPHYCFGR()here and I see no while loops. Your code is literally waits for link up, and this is actually what you have found. Where did you find this code you used?RE: w5500-evb-pico using lwip ‘C’ library hangs on wizchip_initialise() when Ethernet cable is unplugged from board.
by Colin Bate ·
Hi Eugeny, All the code shown is in the WIZnet lwIP library, in the example loop.c code it calls wiznet_initialize() at line 95 (here: RP2040-HAT-LWIP-C/w5x00_loopback.c at main · Wiznet/RP2040-HAT-LWIP-C · GitHub) (sorry don’t know how to make a link out of this URL)
In wiznet_initialize() there is a ( do{ … } while (temp == PHY_LINK_OFF)) loop at line 211, it the loop there is a call to ctlwizchip(CW_GET_PHYLINK, (void *)&temp) == -1) at line 213, at line 219 (temp == PHY_LINK_OFF) is not True, so it loops here as the Ethernet cable is unplugged (or the switch is powered off) which continues until the cable is plugged in. see: RP2040-HAT-LWIP-C/w5x00_spi.c at main · Wiznet/RP2040-HAT-LWIP-C · GitHub
My question is simply, is there a simple way round to stop this blocking, if not I’ll implement a timer to check the link status before calling wiznet_initialize()
Thanks
RE: RE: w5500-evb-pico using lwip ‘C’ library hangs on wizchip_initialise() when Ethernet cable is unplugged from board.
by Eugeny ·
The header file says:
Repository does not explain why this takes place. It says this is collection of the examples. So the code/driver in this repository by default may not be universal and is provided for example. Log issue to the code on the github and ask for clarification why this code takes place.
RE: w5500-evb-pico using lwip ‘C’ library hangs on wizchip_initialise() when Ethernet cable is unplugged from board.
by Colin Bate ·
Thanks, I have not been able to find where to report/ask this question on github, do you have a URL for it.
Many thanks
RE: w5500-evb-pico using lwip ‘C’ library hangs on wizchip_initialise() when Ethernet cable is unplugged from board.
by Eugeny ·
Issues link of the project.
Meanwhile I believe you can just remove the code in this loop unless there’s other code assuming link to be up.
RE: w5500-evb-pico using lwip ‘C’ library hangs on wizchip_initialise() when Ethernet cable is unplugged from board.
by Colin Bate ·
Thanks again, I’ve removed the loop and returned a value to determine the LINK state, does not seem to cause any problems.