Send UDP packet from w5500 to PC failed!
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: Send UDP packet from w5500 to PC failed!
by yaoliang0270 ·
Hi midnightcow,
Thanks your reply.
I checked my network config parameters, maybe my host ip and port info error.
Now my prototype can work normal.
Thanks & Best regards,
Ken
RE: Send UDP packet from w5500 to PC failed!
by Maksim ·
I decided not to create a new topic but unsubscribe here,
I have exactly the same problem. Only this happens on power up. order of action such:
socket (2, Sn_MR_UDP, 161, 0x00); // ----------- <brekpoint
if (WIZCHIP_READ (Sn_SR (2)) == 0x22) {
sendto (2, buff, 10, IP2, 161);
}
while (1) {}
If you install breckpins on the socket, the packet is sent, otherwise the wireshark is empty, missing UDP pack. How long need wait? after set ip ? If i not set brekpoint i, I get on the line
setSn_IR (sn, Sn_IR_TIMEOUT); in function sendto
RE: RE: Send UDP packet from w5500 to PC failed!
by Eugeny ·
Where’s the code waiting for socket open command completion? Where’s the code waiting for MR’s RST bit to reset after soft reset?
RE: Send UDP packet from w5500 to PC failed!
by Maksim ·
into function socket
…
setSn_CR(sn,Sn_CR_OPEN);
while(getSn_CR(sn));
Where’s the code waiting for MR’s RST bit to reset after soft reset?
hardware i wait 1 ms.
RE: RE: Send UDP packet from w5500 to PC failed!
by Maksim ·
How i know what socket open (UDP) command completion ? I look Sn_IR(CON) Interrupt only tcp
RE: Send UDP packet from w5500 to PC failed!
by Eugeny ·
This one
waits until command is accepted. Interrupt bits must indicate that command is completed. IMHO.
After software reset perform checking of the RST bit (7) of MR register for zero, and only then proceed to chip programming.
RE: Send UDP packet from w5500 to PC failed!
by Maksim ·
I add after while(getSn_CR(sn));
while(1)
{
tmp = getSn_IR(sn);
if(tmp & Sn_IR_CON)
{
setSn_IR(sn, Sn_IR_CON);
break;
}
//M:20131104
//else if(tmp & Sn_IR_TIMEOUT) return SOCKERR_TIMEOUT;
else if(tmp & Sn_IR_TIMEOUT)
{
setSn_IR(sn, Sn_IR_TIMEOUT);
return SOCKERR_TIMEOUT;
}
////////////
}
But tmp always zero
RE: RE: Send UDP packet from w5500 to PC failed!
by Eugeny ·
Did you operate Sn_IMR properly?
RE: Send UDP packet from w5500 to PC failed!
by Maksim ·
I set Sn_IMR in 0xFF
RE: Send UDP packet from w5500 to PC failed!
by lawrence WIZnet ·
Hello, Maksim
Did you get no packet from wireshark?
If you have no packet, could you check Sn_IR[SENDOK] after commending Sn_CR[SEND] ?
Before checking the Sn_IR, please set Sn_IMR.
Thank you
RE: Send UDP packet from w5500 to PC failed!
by Eugeny ·
SIR/SIMR?
RE: Send UDP packet from w5500 to PC failed!
by Maksim ·
Yes.
If I resend the packet after the timeout, I get a packet in wireshark.
But I want to figure out what I’m doing wrong.
I used the official library. Inside the send function there is a check for Sn_IR [SENDOK], but I get Sn_IR_TIMEOUT.
SIR/SIMR=0xFF
IR=0;
RE: RE: Send UDP packet from w5500 to PC failed!
by lawrence WIZnet ·
Hello, Maksim
It is hard to understand. Does it mean it works well after timeout?
Could you share the wireshark from first ARP to the last received UDP packet after timeout?
Maybe we can find something new.
Thank you