WIZnet Developer Forum

WIZ550io sends lots of meaningless data from tcp

Hi,
I use wiz550io module in my board. My firmware waits a tcp connection as server and a PC terminal program connects my socket as a client. After connection done; from PC terminal program I send some datas ( 20-30 byte data) to my board and my boards firmware answers ( 20-30 byte) this command. If I send datas quickly(without waiting) from PC terminal program to my board after 3-5 package I see a lot of datas in my PC terminal program as answer. I recognize that this datas are old packages from my communication. Wiz550io sends theese datas until socket communication closed or wiz550iO is resetted. My initialize code is below. I get this code from application notes. I guess there is something about wiz550io buffer, maybe should I reset some buffers in side of wixnet module.

_**wizchip_Init();**_

** **
** /* Chip selection call back */**
#if WIZCHIP_IO_MODE == WIZCHIP_IO_MODE_SPI_VDM
** reg_wizchip_cs_cbfunc(wizchip_select, wizchip_deselect);**
#elif WIZCHIP_IO_MODE == WIZCHIP_IO_MODE_SPI_FDM
** reg_wizchip_cs_cbfunc(wizchip_select, wizchip_select); // CS must be tried with LOW.**
#else
** #if (WIZCHIP_IO_MODE & WIZCHIP_IO_MODE_SIP) != WIZCHIP_IO_MODE_SIP**
** #error “Unknown WIZCHIP_IO_MODE”**
** #else**
** reg_wizchip_cs_cbfunc(wizchip_select, wizchip_deselect);**
** #endif**
#endif
** /* SPI Read & Write callback function */**
** reg_wizchip_spi_cbfunc(wizchip_read, wizchip_write);**
** **
** **

** /* WIZCHIP SOCKET Buffer initialize */**
** if(ctlwizchip(CW_INIT_WIZCHIP,(void*)memsize) == -1)**
** {**
** printf(“WIZCHIP Initialized fail.\r\n”);**
** while(1);**
** }**

There should be something about improper programming of the W5500.

I propose you perform data dumping at the W5500 side to see if it receives data correctly.

Does it answer the same data?

But if “with waiting”? What is the difference?

That must be data sent by W5500, you must check your code at the W5500 side.

Guess - you use incorrect pointer to RX or TX buffers. I recommend you downloading W5100 datasheet and refer to chapter “Functional description” and check if your code complies with the algorithms described.

You should share code of the main loop (the best whole code related to W5500), and explain what exactly you expect this code doing.

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.