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

TCPNet = a poorly designed IP stack

One of the most basic rules for reliable embedded software is to AVOID dynamic memory allocation. See MISRA and others... For the less experienced programmer, when using malloc extensively, it is likely that at some point in time it will fail to allocate the large chunk of memory you need, because the memory pool is fragmented. When it fails, your code does not have much choice other than reset the system, otherwise it will continue to be impaired forever...
In the light of the above, I cannot fathom why Keil, an ARM company, is making this basic mistake.
I have tested this TCPNet rubbish a while ago with a simple tcp Connection exchanging data back and forth, and it locked up after less than one hour! The web server did not work much better either.
If you look around at other proper implementations done by Segger, Express Logic, etc... you will see how it should be done.
I have seen some people here complaining about alloc_mem() returning NULL.
If you want a reliable IP stack look elsewhere. Keil does not have one.

Parents
  • TCPNet using dynamic memory allocation is not necessarily a problem. Yes, it is bad practice to use dynamic memory allocation in embedded systems but...
    If TCPNet is the only module using dynamic memory and the memory management is well implemented and there are no "memory leaks" then it should not be a problem. Sooner or later all memory will be freed and returned to the pool and the fragmentation will be gone.

    It all depends on how long/many TCPNet sockets etc are open before they are ALL closed, and how large the memory pool is. We use TCPNet in our products which are powered for 24/7 for several years and have never had a problem in this area ... yet.

Reply
  • TCPNet using dynamic memory allocation is not necessarily a problem. Yes, it is bad practice to use dynamic memory allocation in embedded systems but...
    If TCPNet is the only module using dynamic memory and the memory management is well implemented and there are no "memory leaks" then it should not be a problem. Sooner or later all memory will be freed and returned to the pool and the fragmentation will be gone.

    It all depends on how long/many TCPNet sockets etc are open before they are ALL closed, and how large the memory pool is. We use TCPNet in our products which are powered for 24/7 for several years and have never had a problem in this area ... yet.

Children