---
title: "Sockets of WIZ812MJ is getting hanged"
url: "https://maker.wiznet.io/forum/9911"
markdown_url: "https://maker.wiznet.io/forum/9911/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "prashantkumar"
created: "2014-02-09T19:22:28+09:00"
last_activity: "2017-05-04T08:31:24+09:00"
language: "en"
views: 444
replies: 5
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# Sockets of WIZ812MJ is getting hanged

## Question

Asked by prashantkumar on 2014-02-09 in Ethernet Chips.

Hello Sir ,

I am trying to place my embedded board which has WIZ812MJ as a ethernet module and acts as a server in a LAN .
For this i have configured all its 4 sockets in listen mode with PORT no 502 for modbus communication , so that it can accept the request from any PC in the LAN and serve it .

Here i am able to connect all the 4 users , accept there request and communicate with them smoothly but, suddenly while communicating with them initially one of the socket stops replying and gets hanged due to this other 3 sockets also gets hanged . During this i am not getting any DISCONNECT/TIMEOUT interrupt so i am unable to find the problem .

From my side i have checked all the flags in IR and Sn_IR are also getting cleared and at this time interrupt line of module is also at HIGH logic level which means no interrupt is pending . So i just wonder what i am missing to take care of , or is there some problem with the module itself . So , please help me out to sort this problem .

Module configuration :

ip_addr = 192.168.1.252
gtw_addr = 192.168.1.1
mac_addr = 10.11.12.13.14.15
subnet = 255.255.255.0

Retry time = 200ms(default)
retry count = 1

port no of all sockets are set to 502 .
all the mask has been enabled .

waiting for reply ,
thank you.

## Replies

### Reply 1 by prashantkumar, 2014-02-10

I have followed the sending sequence given in the Datasheet in which it
1 .first increases the Sn_Tx_Wr pointer to the copied size
2.then gives the SEND command .

But,
your suggestion is to reverse this operation , does that makes the difference .

### Reply 2 by prashantkumar, 2014-02-10

Hi ,

YES i am getting the ping reply from my module when it hangs , also i am getting DISCONNECT request interrupt when i disconnect in this situation but module dosent take any RECV request further .
I have followed the above sequence for writting .
what other tests that i can perform !!

### Reply 3 by hjjeon0608, 2014-02-10

Hi, rashantkumar.

I think there is point hanged in your code somewhere.

> i am getting DISCONNECT request interrupt when i disconnect in this situation but module dosent take any RECV request further .

Did you mean that 812MJ occurred DISCON(0x08) interrupt but WIZ812MJ doesn’t get any packet??
Or disconnect procedure is not performed??

And post your code and then we will check.

Best regards.

### Reply 4 by prashantkumar, 2014-02-12

Hi ,

I am really thankfull for your help ,
I am trying to debug the problem from last few days and i got a doubt as what happens when two sockets gets the data/ interrupt in a very less time i. e before i clear the corresponding flag in IR REGISTER , bcoz that might be happening in my case
since user on another PC can hit the button before the earlier request interrupt flag generated due to previous user got clear .

Also can my module get the interrupt for 2 sockets at the same time .

Thank you ,

### Reply 5 by hjjeon0608, 2014-02-12

Hi, prashantkumar.

Already you said, interrupt can be occurred in piles but not support pending.
So, received packet could be lost by MCU speed of performance.

I recommend to check only flag in ISR routine when interrupt occurred, handle receive process not at ISR routine.

Best regards.

---

Source: https://maker.wiznet.io/forum/9911
