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.

MCU-PLUS-SDK-AM243X: MCU-PLUS-SDK-AM243X: EVM AM243x : sending fragmented udp packets

Part Number: MCU-PLUS-SDK-AM243X
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hello TI-Support,

we have a problem sending fragmented udp/tcp packets. When we increase the data size to be sent in to more than the maximum mtu size (1500 bytes) in our software, we get the following error message (assert) on the uart output :

Assertion @ Line: 241 in xxx/mcu_plus_sdk_am243x_09_02_00_50/source/networking/enet/core/lwipif/src/lwip2lwipif.c : failed !!!

I have reproduced this problem with an TI example (relase and debug build) and these versions

TI example : enet_lwip_cpsw_am243x-evm_r5fss0-0_freertos_ti-arm-clang
TI CCS        : 12.7.0
SysConfig   : 1.20.0
MCU+ SDK for AM243x : 9.2.0.50

For this purpose I have inserted two simple udp send functions in test.c (see attached source file)

7840.test.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
* Copyright (c) 2001,2002 Florian Schulze.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the authors nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


 iRet = sendto(iSocket, aBuf, 1000, 0, (sockaddr*)&dstAddr, sizeof(sockaddr_in));
 iRet = sendto(iSocket, aBuf, 4000, 0, (sockaddr*)&dstAddr, sizeof(sockaddr_in));

1000 bytes can be sent without any problems. If more than 1500 bytes are sent, the above assertion is displayed.
If I comment out the corresponding line in lwip2lwipif.c:241,

// Lwip2Enet_assert(p->len >= (sizeof(struct ip_hdr) + sizeof(struct eth_hdr) + sizeof(struct udp_hdr)));

then packet sizes of more than 1500 bytes are also supported (see wireshark screenshot).

My question is, am I doing something wrong in using the lwip library, or is there a problem in the driver?


Best regards,

Thomas

  • Hi Thomas,

    Thank you for the detailed post, I will be able to recreate the issue easily with this on my end. 

    Let me check this and get back you.

    Regards,

    Nitika

  • Hi Thomas, 

    I have a question: Does your use case only involve sending out fragmented packets or will you be looking at the receive and processing of packets larger than 1500 MTU as well?

    Regards,

    Nitika

  • Hi Nikita,

    we are only interested in sending packets larger than 1500 MTU. In our current implementation we send and receive UDP/TCP packets over some ports on both LAN interfaces with less than 1500 bytes per packet. This works perfectly so far. In the next step we want to use a UDP send port to send packets larger than 1500 MTU.

    Best regards,

    Thomas

  • Hi Nikita,

    I hope you're doing well. I was wondering if there have been any updates regarding the udp problem. Thank you in advance for any information you can provide.

    Best regards,

    Thomas

  • Hi Thomas,

    Apologies for the delayed response, I was not available last week.

    Fragmentation is not currently supported in the software.

    If I comment out the corresponding line in lwip2lwipif.c:241

    With this change you are seeing the fragmented packets on wireshark but do realise that checksum calculation for the packets section present below the commented line will not work properly in the fragmented condition.

    Regards,

    Nitika

  • Hi Nitika,

    first of all, sorry for misspelling your name in the last emails. I can still see very well, but lately my arms are not long enough.

    Does this mean that it is not possible to send correctly fragmented udp packets with the current driver? Is there a lwip driver update for this problem in the near future? I realise that the commented-out line is not a solution, but I'm a little surprised that there is no way to send fragmented udp packets - especially because the sources provide this function? ... or did I misunderstand something?


    Best regards,

    Thomas

  • Hi Thomas,

    I talked to the dev team, fragmented UDP packet handling is not supported with the current driver and is currently not in plan for the near future.

    Regards,

    Nitika