Hi
I have a issue with Ethernet in my custom board based on S7G2-DK .
Ping for one of the Ethernet gets stopped after some time.So i need to reinitialize the interface so that it again starts pinging.
My code below is:
void reinit_ethernet(UINT interface_index){
UINT status; ULONG ip_address, ip_mask; UINT request_option=0; UCHAR *destination_ptr="ab"; ULONG ip_status[2] = { 0 }; status = nx_icmp_ping (&g_ip, IP_ADDRESS(192, 168, 3, 187), "Hello World", sizeof("Hello World"), &packet, 1000); if (NX_SUCCESS != status) { __BKPT(0); } status = nx_dhcp_interface_stop (&g_dhcp_client, interface_index); if (NX_SUCCESS != status) { __BKPT(0); } status = nx_dhcp_interface_reinitialize (&g_dhcp_client, interface_index); if (NX_SUCCESS != status) { __BKPT(0); } status = nx_dhcp_interface_start (&g_dhcp_client, interface_index); if (NX_SUCCESS != status) { __BKPT(0); } status = nx_ip_interface_status_check (&g_ip, interface_index, NX_IP_ADDRESS_RESOLVED, &ip_status[interface_index], 1000);
if (NX_SUCCESS != status) { __BKPT(0); }
status=nx_dhcp_user_option_retrieve(&g_dhcp_client, request_option, destination_ptr, sizeof(destination_ptr)); if (NX_SUCCESS != status) { __BKPT(0); } status = nx_icmp_ping (&g_ip, IP_ADDRESS(192, 168, 3, 187), "Hello World", sizeof("Hello World"), &packet, 1000); if (NX_SUCCESS != status) { __BKPT(0); }}
Is there any issue with the code.
My code gets a status =0x43 for status = nx_ip_interface_status_check (&g_ip, interface_index, NX_IP_ADDRESS_RESOLVED, &ip_status[interface_index], 1000);
Please suggest how to solve it.
Thanks and Regards
Rizwan Syed
Hi Janet,
IP address is assigned using the DHCP and different ip addresses for both are assigned.
Am using a single ip instance and attaching the other Ethernet to it using nx_ip_interface_attach.
Period of ping fails is variable always.sometimes after 5 pings , sometimes 50 pings etc.its not constant.
modified the code for just one 1 Ethernet and still facing the same issue.
I will check with NX_IP_LINK_ENABLED in nx_ip_interface_status_check.
I have a attached old wireshark snapshots which were captured using the local dhcp when i got issue.
wire5 - Copy.txt
Hi Janet
My Assigned IP addresses are as follows:
PC IP address: 192.168.3.187
Port 0 IP address : 192.168.1.24
Port 1 IP address : 192.168.1.88 ( Ping stops for port 1 )
Please find the attached screenshot of wire shark which contains "reply" and "no response" for port 1 at lines 575 and at 594 respectively.
Also attached the wire5 - Copy.txt file which should be replaced with .PCAPNG format after downloading to open in wire shark.(There is an error in upload of .PCAPNG file , so uploaded as .txt file).
Is there anything else required other than the above mentioned items.
Please let me know for further queries.
I have tested in DK board with the same code and it works fine , When i port the same code to my custom board i face the ping issue as i mentioned.
Please share the code which you have tested let me check once.
I am attaching a second interface to the first interface.I have attached the image of the configuration for the same.
Can you please suggest how should i proceed to solve this Ethernet ping issue as it has become a bottle neck for this project?
Please let me know for further queries
NetXDuo_DualEthernetPort_DK_S7G2.zip NetXDuo_DualEtherPort_DK_S7G2.zip
The command 0x18 should not by itself indicate something is wrong. It is the NX_LINK_DEFERRED_PROCESSING command for the driver to execute the command in the context of the IP thread task (as opposed to in ISR context). This is usually used for received packets. The 0x0 command is the NX_LINK_PACKET_SEND command.
You should have access to all the driver source code since I don't believe that is ever encrypted. And it seems that the driver is where the problem is occurring. I may not be the best person to debug the Renesas Ethernet driver. Let me check with Renesas and see what they can suggest here as the best way to track this problem.
I attached the file, not sure if I did it right since I don't send projects out much in RenesasRulz. Let me know if you can download it.
I am not sure but I had a similar problem. I gave up and find another way for communication. I think my prıblem was because of the vias and unequal trace lengths between s7 and phy chip. The communication started normal, but some undefinete time, lost. I suggest to try the port with problems standalone, without using the one working normal.
Hi Janet I dont have access to framework\el folder. I have access to framework\sf_el_nx folder only.
I am trying to get free production licence for debugging purpose.As of now all pins have high strength for Ethernet.