This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EK-TM4C1294XL: UDP application crash

Part Number: EK-TM4C1294XL
Other Parts Discussed in Thread: ENERGIA

Good afternoon,

I currently use a EK-TM4C1294XL board for a simple puropose : one network device send a message to ths board through UDP, when the board receive the message it should send it back with some simple operation on data. The network device send one message per second.

My problem is when I have many network devices (around 150), the board end by crash on the function Udp.endPacket() after a few hours. A simple reboot is enough to go back to normal situation.

I already reach TI-support which provide me the following link : e2e.ti.com/.../1316428. Unfortunately the two solutions indicated didn't work for our application.

Would you have any other idea to fix this bug ?

Best regards,
Richard Lajouanique

  • Hi Richard,

      What is  Udp.endPacket()? Is this your own function? 

      Are you using the LwIP?

      If you are using the LwIP can you increase the memory and the internal memory pool sizes pertaining to the UDP. Below is just an example from the lwipopts.h file. If you are not using LwIP then what TCP/IP stack are you using? If you are using another 3rd-party stack then I will suggest you check with the stack provider for clues on the problem. 

    //*****************************************************************************
    //
    // ---------- Memory options ----------
    //
    //*****************************************************************************
    //#define MEM_LIBC_MALLOC 0
    #define MEM_ALIGNMENT 4
    #define MEM_SIZE (64 * 1024)
    //#define MEMP_OVERFLOW_CHECK 0
    //#define MEMP_SANITY_CHECK 0
    //#define MEM_USE_POOLS 0
    //#define MEMP_USE_CUSTOM_POOLS 0

    //*****************************************************************************
    //
    // ---------- Internal Memory Pool Sizes ----------
    //
    //*****************************************************************************
    #define MEMP_NUM_PBUF 48 // Default 16
    //#define MEMP_NUM_RAW_PCB 4
    //#define MEMP_NUM_UDP_PCB 4
    #define MEMP_NUM_TCP_PCB 16 // Default 5
    //#define MEMP_NUM_TCP_PCB_LISTEN 8
    //#define MEMP_NUM_TCP_SEG 16
    //#define MEMP_NUM_REASSDATA 5
    //#define MEMP_NUM_ARP_QUEUE 30
    //#define MEMP_NUM_IGMP_GROUP 8
    #define MEMP_NUM_SYS_TIMEOUT 8
    //#define MEMP_NUM_NETBUF 2
    //#define MEMP_NUM_NETCONN 4
    //#define MEMP_NUM_TCPIP_MSG_API 8
    //#define MEMP_NUM_TCPIP_MSG_INPKT 8
    #define PBUF_POOL_SIZE 48 // Default 16

  • Hello Charles,

    Thanks a lot for your answer.

    For our application we use LwIP through energia framework. The Udp.endPacket() is not my own function but a function from packages/energia/hardware/tivac/1.0.3/libraries/Ethernet/EthernetUdp.h

    I tried your modifications this morning (in addition to the one from this post mentioned in my first message). We observed an improvement of the situation : the application crashed after 15 minutes instead of 5 minutes initially. 

    Would you have any other suggestions to prevent this bug ?

    Best regards,
    Richard

  • Hi Richard,

      Thanks for clarifying the Udp.endPacket() is a Energia function. I have no experience with the Energia platform and please refer to the FAQ #5. In short, for Energia related questions, we normally do not support in this forum and suggest customers open their question to https://forum.43oh.com/forum/119-energia/.  I hope you will get better assistance from the Energia experts over there. 

      With that said, what was the before and after of the LwIP configuration you did to improve the crash time from 5min to 15min? Did you allocate enough memory and pbuf pool size? Opening 150 connections would have required a big amount of heap memory. That will be something to look at. 

     Please also note the post you referred to was a bug that was fixed back in 2014. I'm not aware of new bugs as of late. One more suggestion I have is for you to also reach out to the LwIP forum since the LwIP is a third party tool. Their experts may be able to provide guidance if they have seen your issue or it is a known issue in their stack (LwIP 1.4.1). BTW, I forgot to ask which LwIP version you are using. Our TivaWare has the port for LwIP 1.4.1. I don't know what version would be used by you since you are using Energia. 

  • Sorry for the inconvenience. I actually was advised to post my issue on this forum.

    To improve the crash time I did the modifications you advised me, substituting the same default value with the value you gave. Do you know by how much we can increase the buffer ?

    Thanks a lot for your time.

    Best regards,
    Richard

  • Hi Richard,

      I don't know why the Energia forum would push back here. 

      The lwipopts.h values that I posted was for one of the TivaWare Ethernet examples. That was probably enough for that application which may not be suitable for your case. I don't know exactly how large of them will address your specific issue. But I will increase the MEM_SIZE and PBUF_POOL_SIZE to a bigger value than what I was referring to earlier. For example, I had a PBUF_POOL_SIZE 48. Why don't you change to 96 and see how that will make a difference to your crash time. Do the same for MEM_SIZE.