Our device is made up of STM32 + W5500. While I was testing them, I had a weird DHCP issue.
I connect 1st device to a router, everything works fine. Then, I connect 2nd device to the same router with the 1st device already connected. 2nd device could not get the ip from the router’s dhcp server.
I remove both devices from the router. connect only 2nd device to the router. 2nd device still cannot get the ip. I connect 2nd device to a different router, 2nd device can get the ip from the router’s dhcp server. after that, I connect 2nd device back to original router, 2nd device still cannot get the ip.
here is the wireshark log for 2nd device (original router)
1871 242.090412 0.0.0.0 255.255.255.255 DHCP 590 DHCP Discover - Transaction ID 0x12345678
1872 242.105096 192.168.0.1 255.255.255.255 DHCP 590 DHCP Offer - Transaction ID 0x12345678
2026 252.091534 0.0.0.0 255.255.255.255 DHCP 590 DHCP Discover - Transaction ID 0x12345678
2027 252.106616 192.168.0.1 255.255.255.255 DHCP 590 DHCP Offer - Transaction ID 0x12345678
I added some debug info to the code, and from the debug output, it looks like W5500 does not received the DHCP Offer. As a result, it doesn’t send the DHCP Request. From the wireshark, DHCP offer was broadcasted from the router’s dhcp server.
here is the wireshark log for 2nd device (another router)
112 15.967901 0.0.0.0 255.255.255.255 DHCP 590 DHCP Discover - Transaction ID 0x12345678
114 16.966301 192.168.85.1 255.255.255.255 DHCP 347 DHCP Offer - Transaction ID 0x12345678
115 16.967888 0.0.0.0 255.255.255.255 DHCP 590 DHCP Request - Transaction ID 0x12345678
116 16.971901 192.168.85.1 255.255.255.255 DHCP 347 DHCP ACK - Transaction ID 0x12345678
Any ideas? Please help!
Cody