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.

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.

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.