2024-01-03 03:16 AM - edited 2024-01-03 03:23 AM
Configuration:
Stm32F767zi board is connected to laptop via LAN connection and no other network is connected.
Step1: The IP address , netmask and gateway are same from the ipconfig
Step2: Then I have configured the Cubemx based on it
Issue:
I have configured the LwIP stack and is calling MX_LWIP_Process(); in the while loop, which is sufficient for me to get a ping back.
Source code:
Debugger output:(It verifies that the essential function is being executed)
Cmd output for Ping:
(The response to ping is from a different IP address, and why is that?)
Is everything correct in this scenario? Or is there something essential,that I am missing here.
I am following the feedback from this question post from myself.
And I am attaching a file that I have referred along below.
2024-01-03 03:30 AM - edited 2024-01-03 03:33 AM
If the mask on your PC is 255.255.255.0, 192.168.2.2 masked by that mask (i.e. 192.168.2.xxx) does not match the network on which the PC is on (i.e. its IP masked, i.e. 192.168.1.xxx), which means, that the network stack tries to use the gateway to route the ping (assuming it to be directed to some external network). It then boils down to the details of your whole network why the reply is from a surprising IP address.
In other words, STM32 needs to have a 192.168.1.xxx address to be accessible directly by the ping.
Do some reading on addressing in the Internet Protocol.
JW
2024-01-03 05:13 AM
Thank you very much for time and for the response.I really appreciate it.
I have indeed tried that way too, but the symptoms/errors remain the same here.
@waclawek.jan wrote:.
In other words, STM32 needs to have a 192.168.1.xxx address to be accessible directly by the ping.
Here I gave the 192.168.1.xxx as the static IP, but I got the same response as before.
Output:
I am wondering, if I missed something on the settings essential to network stack.
2024-01-03 06:06 AM
Maybe the link layer does not work as expected. Debug as usually, start perhaps by observing your gnetif struct.
If you enable DHCP, the address is not static and depends on how the DHCP server assigns it.
JW
2024-08-08 03:00 AM
I face the same problem.
I wonder ST engineer marketing did compile a new working example for users and customers.
It is 2024 now... many official drivers still not very foolproof and bug-free, many things still need manual tweaks here and there to get it work.