This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I might find a big bug of rl-tcpNet

Hi,

I write a Modbus_tcp Slave project using the tcpNet, i think it is very simply. Just receive a request command of modbus_tcp, and then send a reply command. But the project running 1 or 2 days continuously, the communication is broken, and can't connect the tcp again.

Follow are main parts of my project

...
modbus_callback(...)
{
     ...
     case TCP_EVT_DATA:
         // read the received command data
         recFlag = 1;
         break;
     ...
}
...
main(){
    ...
    sock = tcp_get_socket(TCP_TYPE_CLIENT,0,60,modbus_callback);
    tcp_listen(sock,502);              //get a client tcp socket
    while(1){
        main_TcpNet();
        if(recFlag==1){               //if received a request command of modbus,
            buf = tcp_get_buf(...)    //then reply a data command
            ...
            tcp_send(...)
            recFlag = 0;
        }
    }
}

Then i used the debug library of the rl_tcpNet (TCPD_ARM_L.lib),and want to find the problem.
Follow are the output of the debug library when the TCP communication break.

MEM: Releasing 72 bytes
MEM: Used 80 bytes in 2 blocks
MEM: Releasing 80 bytes
MEM: Used 0 bytes in 1 blocks

ETH: *** Processing Ethernet frame ***
ETH: Dest.MAC: FF:FF:FF:FF:FF:FF
ETH: Src. MAC: 00:19:B9:88:7F:41
ETH: Frame len: 253 bytes
ETH: Protocol : 0800
MEM: Releasing 268 bytes
MEM: Allocated 1 blocks from IRQ
MEM: Used 4294967120 bytes in 0 blocks

what is the problem? Is there some incorrect using in my project?
Is it a bug of the rl-tcpNet? And it can't running long period of time continuously?

if you want to see the more code or the whole project i can send a e-mail to you.

Parents
  • Thanks for all your replys.

    I take your advice,and i test the tcpNet in a very tiny project,then turns out everything is OK.

    I have not enough evidences to say that there is a big bug. i'm jumping to the conclusions rather quickly. Just because the problem almost put me mad.I'm sorry. I take back my words.

    Now, i think there must be something wrong in other parts of my project,such as BSP part. I think i will resolve it finally, although the problem still unresolved.

    Thanks
    Happy new year!

Reply
  • Thanks for all your replys.

    I take your advice,and i test the tcpNet in a very tiny project,then turns out everything is OK.

    I have not enough evidences to say that there is a big bug. i'm jumping to the conclusions rather quickly. Just because the problem almost put me mad.I'm sorry. I take back my words.

    Now, i think there must be something wrong in other parts of my project,such as BSP part. I think i will resolve it finally, although the problem still unresolved.

    Thanks
    Happy new year!

Children