WIZnet Developer Forum

PIC24/33 DHCP Can't get DHCP_ACK

I have a project that has been successfully working for several months using a static IP address. Over the last two weeks I have been trying to get connected using DHCP.

Using the code example for the STM32F on the WIZnet site I wrote C code for my dsPIC33 processor. Everything compiles without errors. When I run I can see I get to the DHCP_OFFER being correctly received with a valid router IP. But I can’t get to the DHCP_ACK. The code then times out after 10 secs.

Does anybody have DHCP successfully working on a PIC 16 bit processor?

Neal

Hi,

Plz upload your packet capture file using like wireshark.

I used PIC24 devices with Firewing Basic compiler converting the original source and runs both DHCP and DNS perfectly (http://www.firewing.info/pmwiki.php?n=FirewingUser.W5500).
I’ll point out one thing that can happen as I wrote previously in this forum… [url]Problems while compiling dhcp.c file] 16/32 bit compiler optimize the structures and in some cases mixing different types sent frame does not respect the original fields position and adds some compensation bytes.
I solved it by sending the different fields of the structure individually however there are some directive in compiler to prevent this.

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.