Netinfo gets reset after few minutes in W5500

Hii,

I am working on W5500 to communicate with a server by connecting with it as a TCP client. It exchanges data as desired for few minutes but then gets disconnected randomly, after this instance I am not able to establish any connection. In order to connect again I have to provide a full power cycle.
Below I have attached the driver files and source code.

  1. First I configured the wizchip W5500 (refer the logs attcached below )
**Logs of the configured parameters**

FW    ::> TCP_CLIENT_FV1_0_0 <::
MCU   ::>    STM32H750VBT6   <::
W5500 ::>      Ethernet      <::

PHY Status > conf.raw->={0xBA} , conf.by = {0}, conf.mode={7}, conf.speed={1}, conf.duplex={0}

=======================================
 WIZnet W5500 EVB Demos v4.00
=======================================
IP: 192.168.000.115
GW: 192.168.000.001
Net: 255.255.255.000```

2) Then W5500 tries to connect as TCP client with server (refer the logs attcached below)

Logs of W5500 connecting to the server

:: SnCrntState - SnPrevtState : 0x00 - 0x13 :: <<<
TCP client start
socket 0 open success
:: SnCrntState - SnPrevtState : 0x13 - 0x00 :: <<<
try to connect 192.168.0.156:5000…
ERROR: 0xFFFFFFF3
:: SnCrntState - SnPrevtState : 0x00 - 0x13 :: <<<
TCP client start
socket 0 open success
:: SnCrntState - SnPrevtState : 0x13 - 0x00 :: <<<
try to connect 192.168.0.156:5000…
ERROR: 0xFFFFFFF3


3) After few attempts connection is estableshed successfully and exchanges data properly with the server (refer the logs attcached below)

Logs confirming the established communication

:: SnCrntState - SnPrevtState : 0x17 - 0x13 :: <<<
0:Connected to - 192.168.0.156 : 5000
0:recv size:1
0:recv data:[1]
0:send size:16384
0:recv size:1
0:recv data:[1]
0:send size:16384
0:recv size:1
0:recv data:[1]
0:send size:16384
0:recv size:1
0:recv data:[1]
0:send size:16384
0:recv size:1

4) After few minutes the client connectivity is lost due to some unknown reason. Also the parameters of network config are lost from W5500.

Logs of the lost connectivity

:: SnCrntState - SnPrevtState : 0x00 - 0x17 :: <<<
TCP client start
0 socket -3 open fail
IP: 000.000.000.000
GW: 000.000.000.000
Net: 000.000.000.000
TCP client start
0 socket -3 open fail
IP: 000.000.000.000
GW: 000.000.000.000
Net: 000.000.000.000
TCP client start

**I have taken all these logs over UART.

5) After this state it does not connect with the server.

Below I have attached the driver files of W5500, source code of STM32H750VBT6 and python test server source code.

[STM32H750VBT6 _W5500.zip|attachment](upload://9Rd57BsluAXWWJnjmwIMcyYvCHX.zip) (6.1 MB)

Insufficient information.

  • sources are not accessible.
  • look into the library you use what connect() error code -13 means (FFFFFFF3). The dump does not state what socket you are trying to open, you have socket 0 already open.
  • where “IP/GW/Net” (all zeros) information is coming from?

Look into 5.2.1.2 of the W5100 datasheet. Your software must perform exactly the steps explained in the block diagram.

Thanks for reply.

  • sources are not accessible.
    Sorry for that i am uploading code block here. some how it is not accessible.

  • look into the library you use what connect() error code -13 means (FFFFFFF3). The dump does not state what socket you are trying to open, you have socket 0 already open.

error code -13 means (FFFFFFF3), after few try TCP client is able to connect with server. I am trying conect with socket 0

  • where “IP/GW/Net” (all zeros) information is coming from?
    i have place debug code block to get the information

I am placing the code block below to get idea about it.

tcp_client.pdf (44.8 KB)
STM32H750VBT6 _W5500.zip (6.1 MB)

Quick look: you display

using information provided by wizchip_getnetinfo() which gets data directly from the chip. At the time you see all zeros the chip is having all the main operating registers zeroed, and of course it will not work. Find out when you zero these registers (or perform software or hardware reset to the chip). Software reset is performed using MR register., hardware reset is performed using /RESET pin of the chip.

Hi,

Thank you @Eugeny for support.

Find out when you zero these registers (or perform software or hardware reset to the chip)
Network info is getting zero due to reset of W5500? or may be any other points for lookout?

I am performing hardware reset of W5500 only during the power cycle reset of my hardware.
and for software reset, i am not sure about it because i am using the ioDriverLibrary which i have clone from github. After configuration of network info i am not performing any configuration steps.

As i am not performing any reset operation, once the socket connection is established i am only sending and receiving the packet, this process is continuous.

Observation
Socket state is changing from SOCK_ESTABLISHED to SOCK_CLOSED state and inside the SOCK_CLOSED state i am reading the network info, so may be it is getting reset inside the SOCK_ESTABLISHED state. but I am still not sure about this, it’s just an assumption based on the logs.

can you help me to debug this? where should I possibly look?

Thanks & Regards

The most direct way is the best - after each meaningful command perform WIZ_GetNetworkInfo() to see the values configured in the chip (including just after configuration). As soon as you localize the issue, you (we) can have a closer look into respective code.