Dear all
I summarize the following:
Scenario:
1) 1 TMS570LS3137 on custom board connected to a PC (shell client + Wireshark) via an ethernet hub
2) 1 PHY DP83848YB connected via RMII with MDIO (1MHz)
3) FreeRTOS 8.2.1
4) LWIP 1.4.1 (all the pbuf buffers are in internal SRAM 256K)
5) Only 1 TCP/IP active connection (socket based) that implements a shell command server
6.1) EMAC Flow Control disabled
6.2) Only 1 EMAC active channel (ch0).
6.3) Whole CPPI RAM 8K dedicated to channel (ch0) for rx/tx (4K/4K).
Transmission Problem:
1) With Ethernet speed 100MBit/s, "EMAC TXUNDERRUN" occurred always for bigger size packets (800 byte <= size <=1460 ) while smaller size packets are successfully sent.
- Then this bigger packets were never transmitted outside the PHY when CPU “GCLK”= 180MHz and EMAC “VCLK3” = 45MHz
- Besides, whit debugger, we noticed that also the bigger packets could be successfully sent, only if we break (via break-point) the CPU immediately after the update of header descriptor “EMAC_TXHDP”. That means that the EMAC - DMA was still working while the CPU was in pause. Then we suppose that "EMAC-DMA" bigger packets transfer from internal "SRAM" to "EMAC FIFO" is disturbed/interrupted by CPU (removing break-point), and the EMAC acts a timeout, that increase the TXUNDERRUN statistic.
- Then, we had workaround the problem increasing the "VCLK3" from 45MHz to 90MHz in order to speed-up the "EMAC-DMA" transfer from "SRAM" to "EMAC FIFO". After this change, it become possible that some big packets transmissions from "LWIP" to "EMAC" succeeded, but not always (see Problem 2).
- Note that to increase the “VCLK3” was the only possibility for us, because the CPU was already running at the maximum speed (“GCLK”= 180MHz)
2) With Ethernet speed 100MBit/s, “EMAC TXUNDERRUN” occurred sometimes (and, then, one or more TCP retransmission are performed by LWIP) for bigger size packets (800 byte <= size <=1460 ) while smaller size packets are successfully sent.
- Note that we have set the “FIFOCONTROL” register to “3” in order to maximize the FIFO cell threshold "3 x 64byte" = "192 bytes" (it seems too small !!) and to increase the delay before EMAC starts transmission (we hope DMA could complete the initiated transfer!! :-( ).
- Note that with Ethernet at 10Mbit/s we don’t have any problem (all is working).
- The problem is workaround when we reduce the maximum TCP packet size, via MSS parameter of LWIP (i.e. from 1460 to 512)
- Note that this is not a satisfying solution !!
Questions:
1) How to set “EMAC-DMA” vs “CPU” priority to access internal RAM?
1.1) Where is the "master priority register" referred at RM-29.2.14?
29.2.14 Transfer Node Priority
The device contains a chip-level master priority register that is used to set the priority of the transfer node
used in issuing memory transfer requests to system memory.
2) Is it proven the behavior of tms570ls3137 on Ethenet 100Mbit/s?
3) Is there an example of TMS570LS3137 working with 100Mbit/s?
Can anyone help me?