Multiple socket handling and Send/Receive issue
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: Multiple socket handling and Send/Receive issue
by Coccoliso ·
IR It reads to see which socket has generated the interrupt ( bits S0_INT/S3_INT datasheet page 21 )
IMR to mask the intervention of the interrupt for the 4 socket ( bits IM_IR0/IM_IR3 datasheet page 22 )
Sn_IR to know what condition generated the interrupt on a given socket ( datasheet page 27 )
… in your case you enable all bits IM_IR0/IM_IR3, when an interrupt is generated then read IR and for each socket in Sn_INT high read Sn_IR
A register return recv data size (Sn_RX_RSR) and another the starting position in rx buffer (Sn_RX_RD) . When a portion of buffer is readed then increase Sn_RX_RD and when you have finished set RECV bit in Sn_CR and this portion is free for incoming stream.
I used this spooling method opportunity to directly read a page content and find certain SOAP token without using a duplicate buffer in memory.
I found the use of interrupt a bottleneck, I direct reading Sn_RX_RSR register and start to compose the response meanwhile that data arrives since even the transmission buffer uses this system … fill it and then confirm the transmission when they are ready.
With this system you can read and write flows of any size.
RE: Multiple socket handling and Send/Receive issue
by ab9993 ·
Thanks for replying Coccoliso
Suppose i set all the bits IM_IR0/IM_IR3 so do I get the value of IR register as(0x04) [i.e. socket0 to socket 4 will get set in IR register], if all socket interrupt comes simultaneously.
what are the reasons you have found to not use interrupt ??? and what are the benefits of reading directly Sn_RX_RSR register ???
RE: Multiple socket handling and Send/Receive issue
by Coccoliso ·
In a case you must first read the register and understand what is the socket and then read if it is in reading and then read the amount of data… the other case directly read socket stat and then the amount of data.
RE: Multiple socket handling and Send/Receive issue
by davejo ·
There is a bug when using the sockets. Specifically when you try using multiple sockets the outcome that you are trying to get would not come out as you planned, there will be incorrect data exchange. The code use for calculating the pointers into the device does not match that of the sockets. There is a delay so the timing of the data transmitted are not in synchronized at the sockets.
RE: Multiple socket handling and Send/Receive issue
by Coccoliso ·
Are you talking about transmission or reception?
You can give a concrete example of what happens?
What is making the W5100 and how are you testing?
Are you using SPI?
You’re using TCP?
RE: Multiple socket handling and Send/Receive issue
by gualcosta ·
Hello there,
I’m using w5100 from Wiznet in a project where it interfaces a MC56f355 from Freescale. It worked very well until now when I tried to use another socket along with my primary one.
What happens is that apparently my Recv() function is not correctly reading message from sockets others than socket 0.
As I’m reading the packages (short ones) as soon as they arrive, the masked address should always be 0. But, the offaddr variable come with a different value for every massage, which do not occur when using socket 0.
See some of my code bellow:
Could you help me cast a light on it?
Thank you very much.
Gustavo Costa
gualcosta@gmail.com