Once called the above procedure should perform a loopback to the client. Unfortunatelly after recieve ( received data is fine ) it sends a random garbage string to the client… I’ve checked almost everything including the bytes being sent via spi and it all looks fine ( spi is transmiting proper data bytes to w5500 ) but still w5500 sends random binary data to the client…
It sometimes looks like it sends some random portion of socket buffer because sometimes I can see my data as a substring of that garbage response.
We analyze the packet capture which is attacked pcapfiles.
No.16 packet is transmitted after receiving the No.12 packet.
But, No.16 packet is not same No.12 packet.
Please check below 2 points in your code.
buf overflow: Please check the size of buf.
start pointer of buf in send() : buf is transmitted from start pointer ‘0’ in send().
Well, I’ve tried everything I can think off with no luck… right buffer data leaves mcu spi but w5500 is still sending garbage to ethernet… it looks like data is being saved at wrong pointer in w5500 socket tx buffer or w5500 sends wrong portion of socket tx buffer to ethernet
I guess the wiz550io module I have is broken or your ioLibrary_BSD has a bug somewhere but it is ofcourse also possible I’m making some general mistake somewhere but I’ve ran out of ideas so please verify - my full code is attached.
What I use is:
wiz550io module
ATMega256RFR2 Xplained PRO board ( which is an oridinary atmega chip in means of spi communication )
That at least seems normal. In my experience, after being written to TX_WR is going to be returned as modified only after the SEND command is executed.
etc. which ( because data transmitted over SPI is allways starting with 0123456789******* ) means that something is wrong with Sn_TX_WR or Sn_TX_RD, the question is what for gods sake…
help wiznet guys, help!
BTW Sn_TX_WR seems to increment properly for example 0x239F after first connect and before send, 0x23BF after sending 32 bytes, then 0xD3DF after second connect and 0xD3FF after sending another 32 bytes and so on. The only strange thing is why Sn_TX_WR is not 0x0000 after first conntect following hw reset but this might be normal also…
Well, if your official driver is for a specific mcu you should propably state this literally in your manual… I lost a bunch of time thrusting the code I believed is well tested, bug free and platform independent ansi c code…
Also the bug I pointed out is not target mcu issu but an ansi c bug. According to language specification if you put an expression into cupbounds its being evaluated first using an allocation unit specific for cupbounded expression. So even so it may work for 32 bit arm its not proper syntax and c campiler can but does not have to evaluate this expression using 32bit lgics ( because your code ALLOWS compiler to optimise to 16 bit value ).
Thank you Think01!!! I had experienced the same problem using an Atmel XMEGA part (XMEGA-A1 Xplained evaluation board). After confirming my data was being sent to the W5500 correctly, I started searching this forum and ran across your post. Your fix quickly resolved my problem and saved me a significant amount of development time. Thanks again!
WIZnet, I’m using the latest version (v1.0.2) of the Ethernet libraries. It appears as though it’s a simple fix for you to 1.) update the library, or 2.) put a note on your wiki stating that there is a known problem with this function. Issues like this costs us a significant amount of development time. Bugs exists – that’s understandable; however, it’s difficult to understand why we have to rediscover known issues.