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

ERR_MEM_ALLOC after several sending TCP frame

Hi,

I use a LPC1778 with RTX and RL-TCP library. I am getting ERR_MEM_ALLOC error (sys_error()) after some tcp activity.

The pc send a request of 16 bytes and the card responds with a data frame of 112 bytes and this 10000 times in a row.

After several hundred sending the program crashes. Never in one place.

so I change the memory pool size :

#define MEM_SIZE       2045

by

#define MEM_SIZE       4096

My send function is :

void send_data_param (U8 *mesg, U16 nb)
{
  U8 *sendbuf;

  if (tcp_get_state(socket_tcp_param) == TCP_STATE_CONNECT)
    if (tcp_check_send (socket_tcp_param) == __TRUE)
    {
      sendbuf = tcp_get_buf(nb);
      memcpy(sendbuf,mesg,nb);
      tcp_send(socket_tcp_param, sendbuf, nb);
    }
}

how can I know the memory pool required?

Why the error persists then I doubled his memory pool?

The memory pool is automatically managed by RTX and TCPnet?

how can you know if the memory pool is full?

Anyone a suggestion how to solve this problem?

Thanks.
JB

Parents
  • I'm currently experiencing the same problem.
    The system runs well for a couple of hours before it crashes.
    I am using only UDP Transfer, but I am sending data from two different tasks. Any call to alloc and free is secured by calling tsk_lock/tsk_unlock.
    Is there a list of functions from the TcpLib which are not thread safe? Is there any more documentation on this error than what is written in the source code?

    I am now using MDK-ARM Professional 4.53.

Reply
  • I'm currently experiencing the same problem.
    The system runs well for a couple of hours before it crashes.
    I am using only UDP Transfer, but I am sending data from two different tasks. Any call to alloc and free is secured by calling tsk_lock/tsk_unlock.
    Is there a list of functions from the TcpLib which are not thread safe? Is there any more documentation on this error than what is written in the source code?

    I am now using MDK-ARM Professional 4.53.

Children