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.

AM3352: Ethernet Frame Padding Behavior in AM3352 + NDK

Guru 12115 points
Part Number: AM3352

Tool/software:

Hi,

We are currently evaluating the AM3352 using TI-RTOS and NDK (based on SDK 06.03.00.106), and we would like to confirm the expected behavior regarding Ethernet frame padding.

[Background]

We are using the CPSW Ethernet driver under TI-RTOS + NDK (NDK 3.x). In our TCP communication test, when sending a FIN packet with no payload, the Ethernet frame length becomes less than the minimum required 60 bytes. While the [FIN, ACK] packet appears on Wireshark, the PC-side application using recv() does not receive it, likely because the frame is discarded due to the insufficient frame length.

To investigate this, we examined the SDK 06.03.00.106 source code, particularly the eth_cpsw.c file in the following path:

pdk_am335x_1_0_xx/packages/ti/transport/ndk/nimu/src/v7/eth_cpsw.c

In the EMACSend() or similar Tx routines, we did not find any logic that ensures Ethernet frame padding (e.g., to pad frames <60 bytes with zeros before DMA submission).

[Questions]

  1. Under TI-RTOS + NDK (SDK 06.03.00.106), is there any automatic mechanism within the CPSW driver or NDK stack that adds Ethernet padding (0x00) for frames shorter than 60 bytes?

  2. Is it expected behavior that the CPSW MAC sends short frames as-is, without any padding, if not manually handled by the application or driver?

  3. Would it be acceptable to manually modify the CPSW driver to insert padding bytes when pktLen < 60, such as by inserting the following logic into EMACSend()?

if (pktLen < 60) { memset(pPkt + pktLen, 0x00, 60 - pktLen); pktLen = 60; }

We would appreciate clarification regarding the intended driver behavior and whether TI recommends or supports adding such padding logic manually in this environment.

Thank you in advance for your support.

Best regards,
Conor