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.

TMS320F28388D: LWIP issues in F28388D Connectivity Manager

Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE

Hello all,

I'm using f28388D for my product development.

I've successfully ported C2000Ware_4_00_00_00 LWIP example on to CM core. My usecase is to configure CM as TCP SERVER only, and I'm able to do so.

I'm able to transfer data to and from CM core to other clients.

Now problem i'm facing is after running testcases (that involves sending and receiving set of commands ) for 1day continuously, I'm unable to PING or connect to the server, Restarting is the only way to come out from this issue.

Further I tried reproducing issue in debug mode, I see that execution is stuck in "tcp_free_acked_segments" function while loop. Is this expected ?

And whenever I see this issue I see TCP_DUP_ACK packets and couple of TCP_Retransmission packets in wireshark then after we wont be able to PING controller anymore.

I can attach lwippots.h file for further reference. Please let us know if any changes would be required.

Thanks and regards,

pranay


.lwipopts.h

  • Pranay, 

    Can you try out the following 

    1. Increase the memory in lwipopts.h (#define MEM_SIZE  in lwipopts.h)

    2. Can you enable and check the lwip_stats value  (lwip_stats.mem.used)?  This can help to determine if the memory used value keeps on increasing or it gets reduced after successful transmission. 

    Best Regards

    Siddharth

  • Hi Siddharth,

    I already increased MEM_SIZE to 16k from 4k and started testing and the setup will run continuously till issue reproduces.

    Yes I added lwip_stats.mem.used to expressions window and checking if it is varying for every transaction and I see that this variable is not changing always for all commands, but I see that it is changing and falling back to the value 80 (observed in my testing of half n hour). There is no patterns in after how many commands that this variable is changing.

    --pranay

  • Pranay, 

    I was suspecting memory corruption to be the cause but looking at the lwip stats, it does not appear to be. There are no memory errors reported and also it not overrun.  I am not sure what could be causing this issue. I will let you know if I have any other suggestions to try out.

    Best Regards

    Siddharth 

  • Hi Siddharth,

    I see the same behavior as in this below query:

    https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/489944/tm4c129-launchpad-lwip-buffer-issue-with-high-tcp-ip-network-traffic

    Do you think, Disabling and enabling EMAC interrupts does solve our issue ?

    And I dont know if this below info. would help us but let me know if I'm performing activities as expected:

    1. whenever I receive data over TCP from a client ,execution hits tcp_server_recv callback function and in callback function

     - I will decode received data , - copy tcp_pcd information onto global pointer tcp_pcb , - Push received data to other cores(cpu1/cpu2) for further processing. Will performing IPC in callback function is expected ?

    2. If the client expects some data to be read from controller then our logic differentiates among data received in CM,

    ie., GET Commands -> if the received data command expects to push some information (say FRAM info) from other core then we call them GET commands and

    SET Commands -> It performs some operations on other cores (for eg: REST CPU1), for these sort of commands CM core just echoes back the received dat and passes data to other core,

    So now If the data is a GET command then From CPU1 I will push required data to CM and so IPC_ISR1 will be triggered, in IPC_ISR1 callback itself      I'm decoding data and pushing it to tcp client ( laptop ) using tcp_write() and tcp_output() functions.

    Is this okay ? or expected to cause any issues if we perform above activities directly in callback function itself ?

    Also for echo'ing back SET commands in tcp_server_recv callback function itself I'm calling tcp_echoserver_send() function. Is this okay ?

    If required I can also share you our source code personally.

    Let me know your thoughts and inputs

    --Pranay

  • Pranay, 

    You can try disabling and enabling the EMAC interrupts as suggested in the post. 

    Regarding IPC,  you can have it in the callback.  You can  put the data in message ram and its address can be transferred with IPC Command. 

    Will take a look at your post in detail and let you know if I have any other inputs.

    Best Regards

    Siddharth

  • Hi Siddharth,

    I'm waiting for your inputs. Do you have any updates here.

    --pranay

  • Hi Siddharth,

    Any updates regarding this issue ?

    --pranay

  • Pranay,

    The implementation looks fine, only concern to think about is whether the data is handled efficiently in the callback functions. 

    Are you seeing any packet loss ? Are you seeing this issue only when you observe duplicate ACKs or retransmission of packets? 

    Best Regards

    Siddharth