W5500 executing your Ethernet code for DHCP - Why delay required
Ethernet Chips
- W5500
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 executing your Ethernet code for DHCP - Why delay required
by WIZnet AI AI generated ·
RE: W5500 executing your Ethernet code for DHCP - Why delay required
by Grace_Koo WIZnet ·
Hi jhinkle .
Thank you for pointing this out.
Regarding your original question about
Sn_SR,Sn_SR == SOCK_UDP (0x22)only indicates that the socket has entered UDP mode. It is not a busy/ready indicator for the first transmit, and it does not by itself guarantee that the first DHCP DISCOVER will be transmitted immediately after socket open. So seeing the same0x22value before and after the delay is not unexpected.For checking whether a transmit operation actually completed,
Sn_IRis generally more relevant thanSn_SR, becauseSn_IRreflects the SEND result path such asSEND_OKorTIMEOUT. However, after reviewing the ioLibrary code,sendto()already appears to perform its normal SEND completion handling internally. So this does not look like a simple case of missingSn_IRchecking insidesendto().At this point, what looks more important is the sequence around the first DHCP transmit after socket open. In the current flow, the socket may be opened and the first DHCP DISCOVER may follow very soon afterward, so we will review whether this path needs any improvement.
If you prefer not to modify the ioLibrary files directly, a practical workaround for now would be to delay or defer the first DHCP processing in the user application code. For example:
DHCP_run()on a later main-loop cycle or timer tick,