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.

TM4C129ENCPDT: Multiple TCP sockets (Telnet Client) Connection

Part Number: TM4C129ENCPDT

I have successfully created two telnet client sessions by following enet s2e example. I need to connect to 10 devices with my TM4C using telnet. When I tried to connect to more than 2 sockets, It is working for few minutes and the connection is closing unintentionally. Is there any parameters to be changed. The code is also looping at 

for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue  //list.c of RTOS


Do I need to change any params in lwipopts.h to fix this problem?

  • Hi,

      Where did you get the enet_s2e code?

      I'm not an expert in the s2e code especially the FreeRTOS. The FreeRTOS is a open-source OS and we are promoting TI-RTOS instead for our customers. But I find some notes prior to the line you show that talks about how the execution will end up in that line. Below are the notes. Does you enet_s2e project have this note? I'm wondering if you have an older version. As the note said, it is likely you have a stack overflow. If this is the case then increase your stack size during the build of your project. If the questions are related to FreeRTOS configuration, I strongly suggest you post your questions to the freertos.org for best support.  

     

    	else
    	{
    		/* *** NOTE ***********************************************************
    		If you find your application is crashing here then likely causes are
    		listed below.  In addition see www.freertos.org/FAQHelp.html for
    		more tips, and ensure configASSERT() is defined!
    		www.freertos.org/a00110.html
    
    			1) Stack overflow -
    			   see www.freertos.org/Stacks-and-stack-overflow-checking.html
    			2) Incorrect interrupt priority assignment, especially on Cortex-M
    			   parts where numerically high priority values denote low actual
    			   interrupt priorities, which can seem counter intuitive.  See
    			   www.freertos.org/RTOS-Cortex-M3-M4.html and the definition
    			   of configMAX_SYSCALL_INTERRUPT_PRIORITY on
    			   www.freertos.org/a00110.html
    			3) Calling an API function from within a critical section or when
    			   the scheduler is suspended, or calling an API function that does
    			   not end in "FromISR" from an interrupt.
    			4) Using a queue or semaphore before it has been initialised or
    			   before the scheduler has been started (are interrupts firing
    			   before vTaskStartScheduler() has been called?).
    		**********************************************************************/
    
    		for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) /*lint !e826 !e740 The mini list structure is used as the list end to save RAM.  This is checked and valid. */
    		{
    			/* There is nothing to do here, just iterating to the wanted
    			insertion position. */
    		}

    Here is the enet_s2e I have. Perhaps it is the same as yours. Please compare with what you have. 

    0602.enet_s2e.zip

  • Thank you Charles.

    I  have also read the reasons for crashing and tried by changing the stack size. But nothing worked. Additionally, If I send data to each socket with a interval of about 3 seconds, it is working well. When I try to send data to sockets with interval of 1/5 of a second, then the data is sending about 5 - 10 cycles (i.e.) working for about 10 - 20 seconds and then the code is crashing into the above said loop

  • Hi,

      Not sure how you change the stack size. Since I'm not familiar with FreeRTOS, you will need to consult with their support site on how to change the stack size for the tasks you created. How many sockets after two sockets are you trying to create beyond which the crash happens? The crashing could be due to memory leak on either the FreeRTOS or the LwIP. As these are are all 3rd party software we don't really don't have the expertise to debug these software. I will suggest you find out at what number of sockets can you reliably have the system working. Have you also tried to change the heap size too?