W6100 DHCP Sample code for IPV4
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: W6100 DHCP Sample code for IPV4
by becky ·
I think that you can use the io6Libray.
And call this code in main().
Callback function is same as below.
RE: RE: W6100 DHCP Sample code for IPV4
by embeddedcoder ·
Hi Becky,
Thanks for a quick response. As you suggested I have integrated the above code in my STM32 code I not getting a response.
I am using W6100 Ethernet Shield with STM32discovery board. I am using SPI interface for communication between them. I have able to read CIDR and VER register of W6100 chip. But somehow not able to get IP using DHCP. Here I am attaching my project code W6100_Ping_Test.zip (3.5 MB) and logs which we are getting.
Debug Logs:
Starting W6100 Chip
Register value after W6100 initialize!
Starting DHCP check
Start DHCP
Also, one more observation that I have connected the ethernet cable to RJ45 port of the W6100 Ethernet Shield and another end of it connected to a modem. After connection, there is no LEDs blinking on either of those.
Thanks in advance for the help.
RE: W6100 DHCP Sample code for IPV4
by Eugeny ·
No LEDs blinking and turned on?
Did you turn both devices on?
Are both operational?
RE: W6100 DHCP Sample code for IPV4
by embeddedcoder ·
Yes, both devices are operational. I am able to read CIDR and VER register of the W6100 chip. Both device is able to communicate properly over SPI. But LEDs on the RJ-45 connector are off.
RE: W6100 DHCP Sample code for IPV4
by embeddedcoder ·
Hi Becky,
Please help us on this. We are still facing the same issue. The code got stuck after Send DHCP_DISCOVER. Please suggest that what will be the next steps to run this code as described.
Thank you.
RE: W6100 DHCP Sample code for IPV4
by becky ·
It is the case that DHCP cannot check DISCOVER message because DISCOVER message is sent before Phy link is established.
You can solve this by adding a delay before the DHCP process or adding code to check the PHY LInk.
The DHCP server cannot be found. You should check your network environment again.
In addition I hope you try to ping the w6100 from your PC after setting IP to static.
RE: W6100 DHCP Sample code for IPV4
by embeddedcoder ·
Hi becky,
So how much delay I should add before the DHCP process? Should I add that delay before DHCPv4_run() API?
I need to configure the PHY in PHY_MODE_AUTONEGO mode. Correct? And what will be max timeout for PHY Link up? Based on that I will add logic in code for timeout before called off DHCP process.
Sorry, but I didn’t get ur point here. Will you please give more details on this.
Thanks.
RE: W6100 DHCP Sample code for IPV4
by becky ·
Yes, 3 seconds seems to be enough.
What I mean that was to add the following code: