Malformed DHCP/BOOTP packet
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: Malformed DHCP/BOOTP packet
by Coccoliso ·
Hi,
I do not know the hardware you are using, but I imagine it is for a 16-bit MPU right ?
If so, the problem that occurred to me is the alignment of different type values within the structure as a request sent to the server.
I had already spoken here [url]Problems while compiling dhcp.c file] (for W5500 but DHCP and DNS examples is very similar and I can also extend to W5100 device) and I pointed out how the structure that contains values of different length (bytes with ushorts and uintegers) is somehow bad optimized by the compiler.
Perhaps there is a compiler directive that prevents it but I have solved using the structure until the sending and instead of passing the structure to the function for fits the transmission buffer, read it and put every single byte that contains in order to maintain the expected sequence.
This change is viable on the sources for different compilers without imposing compilation options or other and this stratagem worked for both PIC24 and PIC32.
Let me know if it’s your case.
RE: Malformed DHCP/BOOTP packet
by Vulcan ·
I appreciate the interest and comments. The code I am running, cited in the original post, was developed and published by Wiznet for Microchip. It’s still sold and supported:
[url]http://www.microchip.com/Developmenttools/ProductDetails.aspx?PartNO=TWIZ5200[/url]
They started with the Microchip TCPIP software stack (which operates correctly with Microchips Ethernet controller). This stack was modified by Wiznet to take advantage of, and use, the W5200’s internal hardware stack. It is this build that fails on my PIC32.
The published package is well documented, with step by step instructions. I originally tried to port it to a different platform than the one used in the example, and when I couldn’t get that to work, I bought the Explorer 16, which was used in the video example (DHCP address assigned at time 1:50).
[url]- YouTube
You bring up a good point with the compiler. The example used C30, which is no longer available on Microchips web site (even in the archive section). I am using C32.
I’ll take a look at the packing of the structures.
RE: Malformed DHCP/BOOTP packet
by Coccoliso ·
Take a look at the -O2 optimization option that is enabled by default in the new IDE