W5500 DHCP Problem

I am using a W5500 on a MicroElectronika EtherWiz board. I am using a Microchip EEPROM to obtain a unique MAC address for the W5500. The processor is a Nios II running on a Terasic DE0 Nano board with a clock frequency of 50MHz. I have ported the WizNet drivers and am using those for a TCP/IP communications. I currently have my device communicating via TCP/IP using a static IP address and that is working well. This tells me that the serial communications routines between the W5500 and the FPGA are working fine.

My problem is with the DHCP drivers. I am calling the DHCP_init() function and then calling DHCP_run(). I am not receiving anything back from my router. When I examine the UDP traffic using Wireshark, the W5500 is sending a “Who has 18.0.255.255” query and there is no response on my subnet. The DHCP driver is reporting a timeout error, so I assume an ARP timeout is occurring which matches the what Wireshark indicates.

I have used a logic analyzer to look at the SPI bus, and it the data stream shows that the correct socket and port are being used.

Do you have any suggestions?

Yes, you have set 18.0.255.255 as your gateway in GAR field, or it serves as destination IP address in DR field. The correct broadcast destination address in the local segment is 255.255.255.255. I would also suggest you perform dump of all common and related socket’s registers to see how W5500 is configured.

1 Like

Eugeny,

Thanks for the assistance. I found the problem and it was in my code. My SPI routines expected data on 32 bit boundaries which worked OK for most of the drivers, but not so well for the DHCP drivers. After modifying them to allow for data on 8 bit boundaries, all is working as required.

Thanks, again.

Jeff.

2 Likes