AM64x MCU+ SDK  08.03.00
Enet Layer 2 Multi-Channel Example

Introduction

The Multi-channel example illustrates the usage of multiple channels of UDMA. The application creates two independent RX channels and one common TX channel for handling L2 echo server and PTP timestamping.

On AM64X, we can do ethernet based communication using CPSW HW mechanism

  • CPSW is a standard ethernet switch + port HW
  • It uses ethernet driver underneath with LwIP TCP/IP networking stack

Supported Combinations

Parameter Value
CPU + OS r5fss0-0_freertos
Toolchain ti-arm-clang
Board am64x-evm
Example folder examples/networking/enet_layer2_multi_channel/V0

Steps to Run the Example

Build the example

  • When using CCS projects to build, import the CCS project for the required combination and build it using the CCS project menu (see Using SDK with CCS Projects).
  • When using makefiles to build, note the required combination and build using make command (see Using SDK with Makefiles)

HW Setup

Note
Make sure you have setup the EVM with cable connections as shown here, EVM Setup. In addition do below steps.

AM64X-EVM

For CPSW based example

  • Connect a ethernet cable to the EVM from host PC as shown below

Ethernet cable for CPSW based ethernet

Run the example

Attention
If you need to reload and run again, a CPU power-cycle is MUST
  • Launch a CCS debug session and run the example executable, see CCS Launch, Load and Run
  • You will see logs in the UART terminal as shown in the next section.
  • We can start sending packets with Multicast addresses (01:80:C2:00:00:0E) PTP frames (Ethertype 0x88F7U) from Colasoft Pkt Builder or packETH tool and capture the packets in Wireshark. Packets must send packets with 802.1Q VLAN tag enabled to the application.
  • By selecting 't' option from the menu we can toggle the timestamp printing on the Terminal.

Sample output for Multi-Channel example

==========================
Multi-Channel Test
==========================
Init Enet's OSAL and utils to use defaults
Init memory utils
Create clock and task for periodic tick
Create periodic tick task
Create periodic tick clock
Open Main UDMA driver
Init all peripheral clocks
----------------------------------------------
Enabling clocks!
Init all configs
----------------------------------------------
cpsw-3g: init config
Create RX tasks
----------------------------------------------
cpsw-3g: Create RX task
Open all peripherals
----------------------------------------------
cpsw-3g: Open enet
Attach core id 1 on all peripherals
----------------------------------------------
cpsw-3g: Attach core
cpsw-3g: Open port 1
cpsw-3g: Open port 1 link
cpsw-3g: Open DMA
initQs() txFreePktInfoQ initialized with 16 pkts
cpsw-3g: Waiting for link up...
MAC Port 1: link up
cpsw-3g: Port 1 link is up
cpsw-3g: MAC port addr: f4:84:4c:f9:88:c4
Enet Multi-Channel Menu:
'c' - GetCurrentTime
't' - Toggle Printing timestamps
's' - Print statistics
'r' - Reset statistics
'm' - Show allocated MAC addresses
'x' - Stop the test
t
Enable Timestamp Printing
RX PTP time is : 13219154567
TX PTP time is : 13219204642
RX PTP time is : 14222561337
TX PTP time is : 14222608577
RX PTP time is : 15237477912
TX PTP time is : 15237519097
RX PTP time is : 16238653702
TX PTP time is : 16238698897

See Also

Networking