Wiznet / ioLibrary_Driver

ioLibrary_Driver can be used for the application design of WIZnet TCP/IP chips as W5500, W5300, W5200, W5100 W5100S.
MIT License
601 stars 328 forks source link

W5500 Network info Getting Reset to zeros #128

Open Ashvin22 opened 1 year ago

Ashvin22 commented 1 year ago

Hi,

I am working on W5500 as TCP clinet with STM32.

At power cycle reset I am configuring W5500 with bbelow details and i have read back the configuration details to verify it. I am debugging TCP client application with debug logs over serial communication to monitor the status of application.

                `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

                >>> :: SnCrntState - SnPrevtState : 0x00 -  0x13 :: <<<
                TCP client start
                socket 0 open success
                >>> :: SnCrntState - SnPrevtState : 0x13 -  0x00 :: <<<
                try to connect 192.168.0.156:5000...`

After configuration is done i am able to connect with server, able to sent and receive data. `>>> :: 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`

It is working fines for few minutes and then rendomly disconnect from server and when I have place debug logs for network info in socket closing state, i am getting all configuration as zero. `>>> :: 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` 

I am not getting any idea , how the network configuration has been reset.

Can anyone help me here to trace the issue?

Thanks & Regard, Ashvin Makwana

ulri-me commented 1 year ago

That's quite hard without knowing the whole code.

Without a register write or power cycle the registers wouldn't reset, so I would start with the hardware. Please verify that the power supply of your W5500 is stable, e.g. by tracking with a multimeter) and track executions of reset functions.