I am using W6100 ethernet chip with STM32 controller through SPI inorder to connect to cloud. I want to use W6100 to establish connectivity using IPV4. W6100EVB-AddressAutoConfiguration repo has only DHCP code for IPV6. So for that can some provide me sample code for DHCP IPV4 and sample code to ping one of the IP over the internet using IPV4. Using STM32CubeIDE for development.
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
Send DHCP_DISCOVER
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.
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.
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.
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.
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.