W5500 undefined states and behaviour
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: W5500 undefined states and behaviour
by Eugeny ·
It may happen that there’s some mistake in the code design, and it branches the way it is not innteded to. Perform the following: into each condition of case put some printf which will be logging the branch currently being executed; when communication will fail get the log and analyze how execution flow is being performed to see if there’re some situations causing misbehave.
RE: W5500 undefined states and behaviour
by jim ·
Dear flonas
I checked TCP Server function in WIZ550SR module.
But I couldn’t find any problem.
I think there is another cause.
Please make sure SPI interface between DSP and W5500.
(SPI CLK speed, SPI driver source of DSP etc…)
I used WIZ550SR module for testing.
http://wizwiki.net/wiki/doku.php?id=products:wiz550sr:start
As you know, printf() has nothing to do with the problem.
I changed source code to the following.
Thanks.
RE: RE: W5500 undefined states and behaviour
by flonas ·
I found some problems with the SPI mode. Until now, I used SPI in mode 3 (Clock phase = 1 and Clock polarity = 1). But when I change into mode 0 (datasheet mentions that modes 0 and 3 are supported), the ctlnetwork function, that configures the ip and mac, assigns wrong mac and ip addresses (1.1.1.1.1.1, respectively 1.1.1.1).
Can this be determined by something that causes the rest of problems ?
RE: W5500 undefined states and behaviour
by flonas ·
It seems that every printf() I put changes the behaviour of the program, so this method doesn’t help me too much.
One thing I noticed is that removing some printfs that are displayed frequently, from the tcp handler function, determines the server to go from LISTEN STATE to CLOSED STATE, then back into LISTEN STATE then into CLOSED STATE and so on. During this time, the server appears to accept connections, but I get disconnected after a very short period. Also, ping has losses (25% usually).
I will check the SPI connection to make sure it is well configured. What I don’t understand is why the server doesn’t accept connections while it is into LISTEN MODE and why it sometimes responds, sometimes doesn’t respond, to ping requests when this problem happens.
RE: RE: W5500 undefined states and behaviour
by Eugeny ·
Please share code of the following functions:
RE: W5500 undefined states and behaviour
by flonas ·
Here they are:
functions.zip (1.8 KB)
RE: W5500 undefined states and behaviour
by jim ·
I think SPI inteface is abnormal.
First of all, you have to check SPI inteface and then use W5500.
Actually, I don’t know ADSP 21489. I guess you must change SPI option or SPICLK until operation is normal.
If you want to verify your HW schematic file, please send an email to support@wiznet.io with your file.
Thanks.
RE: W5500 undefined states and behaviour
by flonas ·
I configured the SPI to run in Mode 3 at 10 MHz clock and it works fine. I checked the frequency with an oscilloscope.
On the other hand, Mode 0 is still not functioning, even at 500 KHz. It seems that in this mode, the MISO signal is identical to the CS (chip select) signal, regardless of what data I try to transfer. I guess it’s some chip fault.
After setting and verifying the IP and MAC addresses, I found that W5500 is not always responding to ping. For example, it may respond to 3 ping requensts, but the 4th and 5th time it stops responding. After that, it may start again responding to ping. I checked the PB bit from the Mode register and it is set to zero.
UPDATE: It seems that reading the Sn_SR register in an infinite loop causes the ping problem.
Thanks !
RE: W5500 undefined states and behaviour
by flonas ·
OK, finally I think I found the problem.
After connecting an oscilloscope to the breakout pins, I found out that the connection behaves normally and timing errors dissappeared. After disconnecting the oscilloscope, the problems appear again. Most likely, there’s a problem with the breakout board (some pin floating, I don’t know).
Thank you all for the help given !