Getting Started with General Networking#

12 min read

This module gives an overview of standard ethernet networking.

This one page guide walks through all the available ethernet examples in the AM263x MCU+ SDK. The MCU+ SDK contains several examples showcasing the capabilites for the hardware switches as well the TCP/IP networking stack running over it.


Hardware components#

The AM263x and AM263Px enables ethernet functionality through the following hardware:

  • CPSW (Common Platform Switch): CPSW subsystem provides IEEE 802.3 standard Ethernet gigabit speed packet communication for the device and can also be configured as an Ethernet switch.

Note

CPSW supports RGMII and RMII Interfaces.

  • Programmable Real-Time Unit and Industrial Communication Subsystem (PRU-ICSS): PRU-ICSS is firmware programmable and can take on various personalities like Industrial Communication Protocol Switch (for protocols like EtherCAT, Profinet, EtherNet/IP), Ethernet Switch, Ethernet MAC, Industrial Drives, etc.

Note

PRU-ICSS supports MII mode only.


Drivers and HAL#

The hardware uses underlying drivers

Enet LLD: The Unified Ethernet Low-Level Driver (Enet LLD) is a driver that aims at providing an unified interface for the different Ethernet peripherals found in TI SoCs. You can read more about it here: Enet LLD

ICSS Emac: The ICSS-EMAC (Industrial Communications Subsystem Ethernet Media Access Controller) driver provide APIs to transmit and receive packets with a firmware based Ethernet switch that has been implemented on PRUICSS cores. You can read more about it here: ICSS Emac

Note

Industrial Ethernet only supports throughput of maximum 100M.


Protocol stacks and Middleware#

MCU+ SDK achieves TCP/IP Functionality through the open source LwIP Stack

The TLS layer-4 security is achieved through the MbedTLS stack


Networking block diagram#

Below is the software components overview highlighting mainly the components used in the Networking software development.

Network component diagram

Out-of Box ethernet examples#

Note

The test tools mentioned below do not contain a comprehensive list of tools, but a basic set of tools that a developer can test the applications with. The tools that are supported on Windows and Linux have been marked explicitly.

Layer 2 Examples on FreeRTOS#

Example

Description

Test tools

ENET CPSW LOOPBACK

This example exercises the MAC loopback and PHY loopback functionality of the hardware. The CPSW hardware is opened with default initialization parameters and either the MAC loopback or PHY loopback is enabled based on the user input.

No tool needed

Enet layer 2 CPSW

The layer 2 cpsw example is dedicated to demonstrate usage of Enet CPSW3G peripheral operation.

Colasoft packet builder (Windows), packETH (Linux), nLoad (Linux), Wireshark

Enet Layer 2 CPSW switch

The layer 2 cpsw switch example is dedicated to demonstrate usage of Enet CPSW3G peripheral operation as a basic switch

Colasoft packet builder (Windows), packETH (Linux), nLoad (Linux), Wireshark

Enet Layer 2 Multi Channel

The Multi-channel example illustrates the usage of multiple channels of CPDMA. The application creates two independent TX and RX channels each, one for L2 echo server and the second for TimeSync PTP stack. This example illustrates the usage of multiple CPDMA channels to carry two types of traffic: echo test and PTP.

Colasoft packet builder (Windows), packETH (Linux), nLoad (Linux), Wireshark

Enet Layer 2 Multi channel TimeSync PTP

This is extended documentation for ENET CPSW Layer2 Multichannel example that gives details on TimeSync (PTP) demo. The demo is setup with EVM as PTP listener The broadcaster capability added to the TimeSync driver is currently limitted to sending Sync and Announce frames.

ptp4l (Linux), nLoad (Linux), Wireshark

Enet CPSW EST

This example application illustrates the configuration and usage of 802.1Qbv Enhanced Scheduled Traffic (EST) with CPSW through Enet LLD. The example application enables MAC port 1 by default, but it supports up to two MAC ports available in CPSW3G on SoC.

Colasoft packet builder (Windows), packETH (Linux), nLoad (Linux), Wireshark

Layer 2 Examples on Baremetal (NoRTOS)#

Example

Description

Test tools

Enet layer 2 CPSW Fast startup

The Enet CPSW fast startup example is dedicated to demonstrate the fast link up functionality of CPSW3G showing Strapped and forced mode configuration of PHY. The example enables both the ports of CPSW in MAC mode, creates a packet and sent it from port 1 to port 2. when the packet is received on port 2, the application prints out the profiling nodes and halts in a infinite loop.

No tools needed

TCP/IP Examples using LwIP Stack on FreeRTOS#

Example

Description

Test tools

Enet layer 2 CPSW Fast startup

The Enet CPSW fast startup example is dedicated to demonstrate the fast link up functionality of CPSW3G showing Strapped and forced mode configuration of PHY. The example enables both the ports of CPSW in MAC mode, creates a packet and sent it from port 1 to port 2. when the packet is received on port 2, the application prints out the profiling nodes and halts in a infinite loop.

Colasoft packet builder (Windows), packETH (Linux), nLoad (Linux), Wireshark

Enet Lwip CPSW

This example is a TCP/UDP IP application using the LwIP networking stack, coupled with ethernet driver

iPerf, Scapy, nLoad (Linux), Wireshark, Netcat (Linux), TCPDUMP, Hercules (Windows)

Enet LwIP CPSW Operating modes

This example demonstrates the operation of CPSW in MAC mode and switch mode

Scapy, nLoad (Linux), packETH (Linux), Wireshark, Colasoft packet builder (Windows)

LwIP CPSW socket

This example shows about how to implement simple TCP Client on LwIP networking stack using BSD-Socket API coupled with ethernet driver (ENET). TCP Socket Client connects to server, sends data and expects the data from server.

Scapy, nLoad (Linux), Wireshark, Netcat (Linux)

Enet LwIP TCP Client

This example shows about how to implement simple TCP Client on LwIP networking stack using netconn interface coupled with ethernet driver (ENET). TCP client connects to server, sends data and expects the data from server.

Scapy, nLoad (Linux), Wireshark, Netcat (Linux), TCPDUMP, Hercules (Windows)

Enet LwIP UDP IGMP Server

This example shows about how to implement a simple UDP IGMP-Server on LwIP networking stack using BSD-Socket API coupled with ethernet driver (ENET). UDP Server task waits for a msg to the multicast IP address from client on port 2638 and echoes back the same message.

Scapy, nLoad (Linux), Wireshark, Netcat (Linux), TCPDUMP, Hercules (Windows)

Enet LwIP UDP Client

This example shows about how to implement a simple UDP Client on LwIP networking stack using BSD-Socket API coupled with ethernet driver (ENET). UDP Socket Client gets server IP using UART terminal menu from USER, sends data to the UDP Server and expects the data from server.

Scapy, nLoad (Linux), Wireshark, Netcat (Linux), TCPDUMP, Hercules (Windows)

Enet LwIP TCP Server example

This example shows about how to implement a simple TCP Server on LwIP networking stack using netconn API coupled with ethernet driver (ENET). TCP Server task sends back ‘Greetings from Texas Instruments!’ message back to client and closes the connection.

Scapy, nLoad (Linux), Wireshark, Netcat (Linux), TCPDUMP, Hercules (Windows)

TLS Examples using LwIP Stack and MbedTLS on FreeRTOS#

Example

Description

Test Tools

CPSW Lwip HTTPS Server Example

This example demonstates how to run a HTTPS server on LwIP networking stack using raw API coupled with ethernet driver (ENET), with MbedTLS providing TLS functionality in the L4 layer.

Wireshark, Web browser, TCPDUMP

CPSW Lwip MQTT Client Example

This example demonstates how to run a MQTT client with TLS enabled on LwIP networking stack using raw API coupled with ethernet driver (ENET), with MbedTLS providing TLS functionality in the L4 layer.

Wireshark, Mosquitto (Linux), nLoad (Linux), TCPDUMP

TCP/IP Examples using LwIP Stack on Baremetal (NoRTOS)#

Example

Description

Test tools

Enet LwIP HTTP Server NoRTOS

This example shows about how to implement a simple HTTP web Server on LwIP networking stack using LwIP raw APIs on bare metal (No-RTOS) using no-rtos LwIP stack, no-rtos lwip-if and enet driver.

Wireshark, Scapy, Web browser

Ethernet performance#

Refer the following to study the performance of Ethernet drivers using CPSW peripheral in the MCU+ SDK for AM263x. Ethernet Performance Data