MCUSW
Eth & EthTrcv User Guide

Introduction

This document details AUTOSAR BSW ETH & ETHTRCV module implementations

  • Supported AUTOSAR Release : 4.3.1
  • Supported Configuration Variants : Pre-Compile
  • Vendor ID : ETH_VENDOR_ID (44), ETHTRCV_VENDOR_ID (44)
  • Module ID : ETH_MODULE_ID (88), ETHTRCV_VENDOR_ID (73)

The ETH module initializes, configures and controls the Gigabit Ethernet Switch (CPSW) in the J7xx device families as detailed in the AUTOSAR BSW ETH Driver Specification.

The ETHTRCV module initializes and configures the Ethernet transceiver (PHY) as detailed in the AUTOSAR BSW ETHTRCV Driver Specification.

Following section highlights key aspects of this implementation, which would be of interest to an integrator.

SDK/PDK dependency

Currently, the MCAL Ethernet driver only depends on SciClient module in SDK


Eth Driver Architecture/Design

Please refer the ETH design page, which is included as part of release [3].


Functional Description

This ETH driver implementation supports the Gigabit Ethernet Switch (CPSW) peripheral present in the J7xx devices. The CPSW peripheral has an Ethernet port (port 1) which supports RGMII and RMII interfaces, and a host port (port 0) which supports the internal Communications Port Programming Interface (CPPI). The ETH driver uses the UDMA driver APIs to setup data transfers to/from the CPPI port.

The ETH driver implements single UDMA channel for data transmission and single channel (flow) for data reception. Only the CPSW default thread ID is enabled and configured according to the UDMA receive channel's default flow. Interrupts can be enabled for DMA transmit and receive completion events.

The DMA transfers are based on descriptors called Host Mode Packet Descriptors (HMPD). The descriptors are given to and retrieved from the UDMA via Ring Accelerators. There are three rings used per data direction in this implementation:

  • Transmit
    • Free Queue Ring - Descriptors with the address and length of the buffers to be transmitted are queued into this ring. In normal conditions, only CPSW will dequeue descriptors from this queue.
    • Completion Queue Ring - Descriptors that correspond to Ethernet frames which have already been consumed by the CPSW are placed in this queue. CPSW is the producer and host is the consumer of this ring.
    • Tear-down Completion Queue Ring - This ring is used only when the UDMA channel is torn down.
  • Receive
    • Free Queue Ring - Descriptors with the address and length of free buffers to be filled with incoming Ethernet frames are queued into this ring. In normal conditions, only the CPSW will dequeue descriptors from this queue.
    • Completion Queue Ring - Descriptors that correspond to buffers filled with new data from incoming Ethernet frames are placed in this queue. CPSW is the producer and host is the consumer of this ring.
    • Tear-down Completion Queue Ring - This ring is used only when the UDMA channel is torn down.

The depth of each ring as well as its associated memory is configurable. The ring memories can be any memory in the system, but it's recommended that they are placed in a fast memory (i.e. OCMRAM or MSMC3). The depth of these rings is determined by the number of TX and RX buffers set in the driver configuration (EthCtrlConfigEgress/EthCtrlConfigEgressFifo and EthCtrlConfigIngress/EthCtrlConfigIngressFifo).

Similarly, the HMPDs can be placed in any memory of the system, but it's recommended that they are placed in OCMRAM or MSMC3 as well.

The Management Data I/O interface (MDIO) of the CPSW peripheral is used by the ETH driver to implement the MII register read and write APIs which are ultimately used by the ETHTRCV driver to configure the Ethernet transceiver (PHY). The ETH driver handles the MDIO interrupt which indicates the completion event of the Ethernet transceiver register accesses.

The Address Lookup Engine (ALE) of the CPSW peripheral is used by the ETH driver to implement the receive filter API. The ALE provides 64 entries that can be used to set filter rules.

The Statistics submodule of the CPSW peripheral is used by the ETH driver to implement the statistics and drop count APIs.

Back To Top


Ethernet interrupt to ISR mapping

The following table lists the mapping between Ethernet interrupts and the corresponding interrupt service routines.

Interrupt Number Description Associated ISR
Configurable DMA RX Completion Eth_RxIrqHdlr_0
Configurable DMA TX Completion Eth_TxIrqHdlr_0
35 MDIO Access Completion Eth_MdioIrqHdlr_0

The DMA interrupt numbers can be set via the Ethernet driver configuration parameters EthDmaTxChIntrNum and EthDmaRxChIntrNum.

The table below summarizes the interrupt ranges allocated by default in TI SDK for the SoCs and the processing cores where the MCAL ETH driver is supported.

SOC Starting Resource (Value) Range
J7xx Devices MCU0_INTR_NAVSS0_R5_0_PEND_0 (74) 9
AM62x DMASS0_INTAGGR_0_INTAGGR_VINTR_PEND_44 (66) 36
AM62Ax DMASS0_INTAGGR_0_INTAGGR_VINTR_PEND_168 (64) 16

The interrupt numbers passed to the Ethernet driver configuration must be within the range stated above for each device, otherwise the interrupt allocation will fail while enabling the Ethernet controller.
Please refer to the UDMA Driver Resource Manager allocation for further details.

There are no interrupts in the ETHTRCV module.

Back To Top


Configuration

The Eth Driver implementation in this release supports the Pre-Compile/LinkTime/ PostBuild configuration variant.

The driver expects generated: Eth_Cfg.h, Eth_Cfg.c, Eth_Lcfg.c and Eth_PBcfg.c to be present at the locations specified in the Eth File Structure section.

The EthTrcv Driver implementation only supports the Pre-Compile variant. The driver expects generated EthTrcv_Cfg.h and EthTrcv_Cfg.c to be present at the locations specified in the EthTrcv File Structure section.

DMA configuration guideline

Use sysconfig tools to open your sysconfig file to get all DMA information

eth_ug_dma_resource_allocation_markdown.png
Ethernet DMA resource allocation detail


Native Eth Driver

Look at the column MCU_0_R5_0 to get DMA information for Rx channel, Tx channel, Rx Ring, Rx Flow, Virtual Intertupt,Global Event

  • EthDmaTxChStartNum - equal MCU NAVSS UDMA Normal capacity Tx channels
  • EthDmaRxChStartNum - equal MCU NAVSS UDMA Normal capacity Rx channels
  • EthDmaRingStartNum - equal MCU NAVSS Ring accelerator Free rings
  • EthDmaFlowStartNum - equal MCU NAVSS UDMA Rx free flows
  • EthDmaVirtualIntrStartNum - equal MCU NAVSS Interrupt aggregator Virtual interrupts
  • EthDmaGlobalStartNum - equal MCU NAVSS Interrupt aggregator Global events

Virtual Eth Driver

Look at the column MAIN_0_R5_2 to get DMA information for Tx channel, Rx Ring, Rx Flow, Virtual Intertupt, Global Event

  • EthDmaTxChStartNum - equal Main NAVSS UDMA Normal capacity Tx channels
  • EthDmaRingStartNum - equal Main NAVSS Ring accelerator Free rings
  • EthDmaVirtualIntrStartNum - equal MAIN NAVSS Interrupt aggregator Virtual interrupts
  • EthDmaGlobalStartNum - equal MAIN NAVSS UDMA Interrupt aggregator Global events

Back To Top


Variance / Deviation from the specification

QoS feature of Transmit/Receive APIs

The current implementation doesn't support QoS feature in transmission and reception:

  • Transmit frame priority is not supported in this release. The Priority pamareter should be set to 0 when requesting a buffer via Eth_ProvideTxBuffer().
  • Receive FIFO is not supported in this release. The FifoIdx parameter should be set to 0 when receiving a buffer via Eth_Receive().

Ethernet Switch Interface

The driver doesn't call Ethernet Switch Interface APIs.

Back To Top


Ethernet Transceiver Wake-Up

The wake-up related APIs are not implemented in this release:

  • EthTrcv_SetTransceiverWakeupMode()
  • EthTrcv_GetTransceiverWakeupMode()
  • EthTrcv_CheckWakeup()

The wake-up related functionality of other non wake-up specific APIs (i.e. EthTrcv_TransceiverInit(), EthTrcv_SetTransceiverMode(), etc) are not implemented in this release either.

Back To Top


Ethernet Transceiver Manual/Auto-Negotiation Mode

The current EthTrcv driver implementation only supports auto-negotiation mode. The following APIs are impacted and partial functionality of the API is implemented:

Back To Top


Ethernet Transceiver ECUC

The following EthTrcv ECUC APIs are not implemented in this release:

  • EthTrcvPhysLayerType
  • EthTrcvConnNeg
  • EthTrcvMainFunctionPeriod

Back To Top


Non Standard Service APIs

None.

Back To Top


Interrupt Configuration

The Ethernet driver doesn't register any interrupt handlers (ISR), it is expected that consumer of this driver registers the required interrupt handler.

The Ethernet interrupts are:

  • TX DMA Completion - Asserted when a packet has been consumed by CPSW for transmission. The interrupt number is configurable and is passed via Ethernet configuration parameters. Please refer to the resource partitioning information for further details about what interrupt numbers are allocated for the MCU
  • RX DMA Completion - Asserted when a packet has been received. The interrupt number is configurable and is passed via Ethernet configuration parameters. Please refer to the resource partitioning information for further details about what interrupt numbers are allocated for the MCU
  • MDIO Access Completion - Asserted when an Ethernet transceiver (PHY) register read or write operation is complete. The interrupt number is 35

Other CPSW interrupts (like the Statistics Pending interrupt) are not handled by the driver.

Please refer to the EthApp_InterruptConfig() function in Eth demo application for the implementation details of the interrupt registration.

Back To Top


Power-up

The driver doesn't configure the functional clock and power for the Ethernet module. It is expected that the Secondary Bootloader (SBL) powers up the required modules. Please refer SBL documentation.

Back To Top


Build and Running the Application

Please follow steps detailed in section (Build) to build library or example.

Building the host-side example application

The GCC compiler is required to build the host-side application.

The steps to build the host-side application in Linux are listed below:

$ cd mcal_drv/mcal/examples/Eth/eth_app/host/
$ make

Building the target-side example application in loopback mode

The Eth example application can run an internal loopback test when configured accordingly in the driver's configuration parameters.

The example application per se doesn't need any change for loopback, but the loopback parameter must be set to TRUE as shown below. The example application can then be rebuilt following the regular steps listed in Build.

diff --git a/mcal_drv/mcal/examples_config/Eth_Demo_Cfg/output/generated/src/Eth_Cfg.c b/mcal_drv/mcal/examples_config/Eth_Demo_Cfg/output/generated/src/Eth_Cfg.c
index 24c046a..21cf137 100755
--- a/mcal_drv/mcal/examples_config/Eth_Demo_Cfg/output/generated/src/Eth_Cfg.c
+++ b/mcal_drv/mcal/examples_config/Eth_Demo_Cfg/output/generated/src/Eth_Cfg.c
@@ -75,7 +75,7 @@ ETH_CONFIG_DATA_SECTION CONST(Eth_ConfigType, ETH_CONFIG_SECTION)
     /**< MDIO bus clock (MDCLK) frequency (in Hz) */
     .connType           =    ETH_MAC_CONN_TYPE_RGMII_FORCE_1000_FULL,
     /**< MII connection type */
-    .loopback           =    FALSE,
+    .loopback           =    TRUE,
     /**< Loopback enable */
     .enableCacheOps     =     (uint32)TRUE,
     /**< Packet memory is cacheable */

Back To Top


Steps to run example application

Running the loopback test

In order to run the loopback test, it's required to set the Ethernet driver's 'loopback' configuration parameter to TRUE as described in Building the target-side example application in loopback mode. In loopback mode, CPSW is configured with ALE in bypass mode and loopback is enabled in the MAC port (port 1).

This test doesn't require any additional external setup and the example can run standalone on the device. The example application will transmit and receive 1000 frames, and will verify the frame content.

Running the default (non-loopback) test

This test consists of two applications: host-side application that runs on a Linux machine, and a target-side application that is loaded to the device (DUT).

Please refer to the Building the host-side example application section for instructions to build the host-side application.

  1. Connect a CAT5e/CAT6 Ethernet cable to the MCU ETHERNET connector of the J721E/J7200 EVM and to the PC's Ethernet port
  2. Don't setup the Network Connection in Linux, disable automatic connection if needed. The intention is to avoid any frames going to the DUT, other than those sent by the test application
  3. Find the interface name on the host PC side by running the following command:
$ ifconfig -s
  1. Run the host-side application with root privileges (needed for raw sockets) and specify the interface name to be used, for instance:
    $ cd mcal_drv/mcal/examples/Eth/eth_app/host/
    $ sudo ./EthHostApp -i eth2
    
  2. At this point, the host-side application will be waiting for the DUT
  3. Load the target-side application to the device and run it. The host-side application should detect that the device is now ready and all tests will be run (including frame transmission with and without confirmation, frame reception, filtering MAC addresses, transmission and reception of VLAN tagged packets, transmit throughput, etc)
  4. Check the logs printed in the Linux terminal and verify that the host-side application didn't report any errors
  5. Check the logs printed in the serial console (or CCS console if UART is not enabled) and verify that the target-side application didn't report any errors

The example applications on either side (host or target) will report a fail status if any test Ethernet frames is lost. So even frames which are lost due to physical link will cause the example application to report as a failure.

Note: The test steps listed above have been tested in Ubuntu 16.04. Test errors have been found when running the test in Ubuntu 18.04.

Back To Top


Memory Mapping

Various objects of this implementation (e.g. variables, functions, constants) are defined under different sections. The linker command file at (Examples Linker File (Select memory location to hold example binary)) defines separate section for these objects. When the driver is integrated, it is expected that these sections are created and placed in appropriate memory locations. (Locations of these objects depend on the system design and performance needs)

Section ETH_CODE ETH_VAR ETH_VAR_NOINIT ETH_CONST ETH_CONFIG ETH_UDMA_RING ETH_UDMA_DESC ETH_TX_DATA ETH_RX_DATA
ETH_TEXT_SECTION USED
ETH_ISR_TEXT_SECTION USED
ETH_CONST_32_SECTION USED
ETH_CONFIG_SECTION USED
ETH_DATA_INIT_UNSPECIFIED_SECTION USED
ETH_DATA_NO_INIT_UNSPECIFIED_SECTION USED
ETH_UDMA_RING_SECTION USED
ETH_UDMA_DESC_SECTION USED
ETH_TX_DATA_SECTION USED
ETH_RX_DATA_SECTION USED


Section ETHTRCV_CODE ETHTRCV_VAR ETHTRCV_VAR_NOINIT ETHTRCV_CONST ETHTRCV_CONFIG
ETHTRCV_TEXT_SECTION USED
ETHTRCV_CONST_32_SECTION USED
ETHTRCV_CONFIG_SECTION USED
ETHTRCV_DATA_INIT_UNSPECIFIED_SECTION USED
ETHTRCV_DATA_INIT_32_SECTION USED
ETHTRCV_DATA_NO_INIT_UNSPECIFIED_SECTION USED
ETHTRCV_DATA_NO_INIT_16_SECTION USED

Back To Top


Cache

This driver implementation has been validated with cache enabled. For optimal performance it's recommended to place (Memory Mapping) sections in cache enabled memory area.

The Ethernet driver supports ring and descriptor memory placement in non-cached memory. It's configurable through the following parameters:

  • EthRingInCachedMem - Cache management operations will be performed in ring memory only if this parameter is set.
  • EthDescInCachedMem - Cache management operations will be performed in descriptor memory only if this parameter is set.

Cache management operations refer to invalidate, write-back and write-back invalidate calls.

Back To Top


Dependencies on SW Modules


DET

This implementation depends on the DET in order to report development errors and can be turned OFF. Refer to the Development Error Reporting section for detailed error codes.

Back To Top


SchM

This implementation requires 1 level of exclusive access to guard critical sections. Invokes SchM_Enter_Eth_ETH_EXCLUSIVE_AREA_0(), SchM_Exit_Eth_ETH_EXCLUSIVE_AREA_0() to enter critical section and exit.

In the example implementation (SchM_Eth.c), all the interrupts on CPU are disabled. However, disabling of the enabled Ethernet related interrupts should suffice.

Back To Top


File Structure

Eth File Structure

eth_ug_dir_detailed.png
Ethernet Detailed Directory Structure
  • Ethernet driver
    • Driver:
      • include: Eth.h, Eth_Irq.h, Eth_LL.h, Eth_LL_Types.h, Eth_Packet.h, Eth_Types.h, Eth_VirtMac.h
      • src: Eth.c, Eth_Irq.c, Eth_Packet.c, Eth_Priv.c, Eth_Priv.h, Eth_Rpc.c, Eth_Rpc.h, Eth_RpcPriv.h, Eth_VirtMac.c, udma/*, and cpsw/*
    • Example Configuration:
      • include: Eth_Cfg.h
      • src: Eth_Cfg.c, Eth_Lcfg.c, Eth_PBcfg.c
    • Example Application by: EthApp.c, EthUtils.c, EthUtils.h and EthUtils_Patterns.h

EthTrcv File Structure

ethtrcv_ug_dir_detailed.png
Ethernet Transceiver Detailed Directory Structure
  • Ethernet Transceiver driver
    • Driver implemented by: EthTrcv.c, EthTrcv_Priv.c, EthTrcv.h and EthTrcv_Priv.h
    • Example Configuration by: EthTrcv_Cfg.c and EthTrcv_Cfg.h
    • Example Application is common for Eth and EthTrcv

Back To Top


Error Handling


Development Error Reporting

Development errors are reported to the DET using the service Det_ReportError(), when enabled. The driver interface files (Eth.h and EthTrcv.h shown in the driver directory structure of the File Structure section) lists the service IDs.

Back To Top


Error codes

Production error are reported to DET via Det_ReportError(). Only the error codes in the Ethernet and Ethernet Transceiver driver specifications are reported which are listed below. There are no implementation specific error codes being reported.

Ethernet driver error codes

Type of Error Related Error code Value (Hex)
Invalid controller index ETH_E_INV_CTRL_IDX 0x01
Eth module was not initialized ETH_E_UNINIT 0x02
Invalid pointer in parameter list ETH_E_PARAM_POINTER 0x03
Invalid parameter ETH_E_INV_PARAM 0x04
Initialization failure ETH_E_INIT_FAILED 0x05
Invalid mode ETH_E_INV_MODE 0x06

Ethernet Transceiver driver error codes

Type of Error Related Error code Value (Hex)
Invalid transceiver index ETHTRCV_E_INV_TRCV_IDX 0x01
EthTrcv module was not initialized ETHTRCV_E_NOT_INITIALIZED 0x02
Invalid pointer in parameter list ETHTRCV_E_PARAM_POINTER 0x03
Initialization failure ETHTRCV_E_INIT_FAILED 0x04

Back To Top


Production Code Error Reporting

Production error are reported to DEM via the service DEM_ReportErrorStatus(). There are no implementation specific error codes being reported. Only the error codes in the Ethernet and Ethernet Transceiver driver specifications are reported which are listed below.

Type of Error Related Error code
Ethernet Controller Access Failure ETH_E_ACCESS
Ethernet Frames Lost ETH_E_RX_FRAMES_LOST
CRC Failure ETH_E_CRC
Frame Size Underflow ETH_E_UNDERSIZEFRAME
Frame Size Overflow ETH_E_OVERSIZEFRAME
Frame Alignment Error ETH_E_ALIGNMENT
Single Frame Collision ETH_E_SINGLECOLLISION
Multiple Frame Collision ETH_E_MULTIPLECOLLISION
Late Frame Collision ETH_E_LATECOLLISION


Type of Error Related Error code
Ethernet Transceiver Access Failure ETHTRCV_E_ACCESS

Back To Top


API Description

The AUTOSAR BSW Eth Driver specification details the APIs [1].

The AUTOSAR BSW EthTrcv Driver specification details the APIs [2].

The wake-up related APIs are not implemented in this release. Refer to the Ethernet Transceiver Wake-Up section for more details on impacted APIs.

The wake-up related functionality of other non wake-up specific APIs (i.e. EthTrcv_TransceiverInit(), EthTrcv_SetTransceiverMode(), etc) are not implemented in this release either.

The current EthTrcv driver implementation only supports auto-negotiation mode. Refer to the Ethernet Transceiver Manual/Auto-Negotiation Mode section for more details on the impacted APIs.

The following EthTrcv ECUC APIs are not implemented in this release. Refer to Ethernet Transceiver ECUC section for more details.

Back To Top


Example Application

The example application demonstrate use of Eth module. The example consists of an application that runs on the J7200/J721E device (DUT) and an application that runs on a Linux PC (host). The host and target (DUT) applications communicate with each other to start the different stages of the example tests.

The Eth example relies on shared utils which provide helper functions (i.e. filling an Ethernet frame with test data, verifying frame contents, etc) which are useful on the DUT and host sides.

The following table summarizes the different tests implemented by the example application.

Test ID Summary Description
test_0001 Basic DUT frame reception Host will send 1000 Ethernet frames, the DUT will receive and verify that the frame content matches the expected patterns
test_0002 Basic DUT frame transmission The DUT will send 1000 non-VLAN tagged frames without TX confirmation. The host PC will check that all frames are received and that the frame content matches the expected patterns
test_0003 External loopback The DUT will send frames to the host, the host will receive the frames and will send them back to the DUT
test_0004 Default filter operation Host will send 500 frames with DUT's MAC address and 500 frames with other MAC address. The DUT will reject the 500 frames that don't matches DUT's address
test_0005 Different filter configurations This test is split in different stages that will exercise different filter operations like adding/removing unicast address, entering/exiting promiscuous mode, etc.
test_0006 DUT frame transmission with confirmation The DUT will send 1000 non-VLAN tagged frames and will request TX confirmation. The host PC will check that all frames are received and that the frame content matches the expected patterns
test_0007 Transmission of VLAN tagged frames The DUT will send 1000 VLAN tagged frames and will request TX confirmation. The host PC will check that all frames are received and that the frame content matches the expected patterns
test_0008 Transmission of different frame lengths The DUT will send non-VLAN tagged frames of different lengths, including short frames. The host PC will check that all frames are received and that the frame content matches the expected patterns
test_0009 VLAN tagged frame reception Host will send 1000 VLAN tagged Ethernet frames, the DUT will receive and verify that the frame content matches the expected patterns
test_0010 Controller mode changes The application will set the controller to DOWN mode and then back to ACTIVE mode. Ethernet frame transmission and reception tests will be run afterwards. 10 iterations of these steps will be executed.
test_0100 Transmit throughput DUT transmit throughput is measured over 150,000 Ethernet frames sent from the host PC.
test_0200 Internal loopback (MAC) The DUT will send and receive 1000 Ethernet frames and will check the frame correctness against expected patterns. Note: This test runs only when Ethernet driver configuration's loopback mode is enabled
test_0101 Receive thoughput The host PC will send 150000 Ethernet frames. The DUT will receive the frames and compute the throughput.
test_0300 Egress timestamp test The DUT will transmit 10 Ethernet frames with the Egress timestamping enabled. It will then check that the Tx timestamp is returned.
test_0301 Ingress timestamp test The DUT will receive 10 Ethernet frames from the host PC. It will then check that the Rx timestamp is returned.
test_0302 Get current time test The DUT will transmit 10 Ethernet frames with a specific interval, then check the accurate timestamp in between transmit attempts.

The following list identifies key steps performed by the DUT side application:

  • EthApp_Startup ()
    • Pin mux configuration
    • Set Ethernet connection type in MMR
    • Interrupt controller initialization and ISR registration for the following interrupts:
      • TX DMA completion
      • RX DMA completion
      • MDIO completion (register access completion)
    • Initialize counters required for timed operations
  • EthApp_init()
  • Loop through all tests
    • EthApp_test_0001: Basic DUT frame reception test:
      • Send test START command
      • Receive frames until the STOP is detected
    • EthApp_test_0002: Basic DUT frame transmission test:
      • Send test START command
      • Transmit 1000 non-VLAN tagged frames without confirmation
    • EthApp_test_0003: External loopback test. The DUT sends frames to the host, the host receives the frames and sends them back to the DUT. The following operations are performed on the DUT side:
      • Send START command
      • Send and receive 1000 frames, for each of them:
        • A different payload is set
        • EtherType and payload are verified on the received frame
    • EthApp_test_0004: Default filter operation. Test the operation of the default DUT's filter configuration (only frames with DUT's MAC address are accepted, all others are rejected). The DUT performs these operations:
      • Send START command
      • Receive frames until the STOP is detected
      • The number of frames expected to be received is 500 as only one half of the total frames sent by the host (1000) have the DUT's MAC address
    • EthApp_test_0005: Different filter configurations test. Test the different modes of the DUT's filter configuration. The DUT performs these operations:
      • Send START command
      • Part 1
        • Filter is reset to accept only frames with DUT's MAC address
        • Host side transmits 1000 frames and then transmits the STOP command
        • Receive frames until STOP is detected
          • Frame 1: Source MAC address is DUT's. It should be accepted
          • Frame 2: Source MAC address is not DUT's. It should be rejected
          • Expected to receive 500 frames
      • Part 2
        • A second unicast MAC address is added to the DUT's filter
        • Host side transmits 1000 frames and then transmits the STOP command
        • Receive frames until STOP is detected
          • Frame 1: Source MAC address is DUT's. It should be accepted
          • Frame 2: Source MAC address is second valid MAC address. It should be accepted
          • Expected to receive 1000 frames
      • Part 3
        • A multicast address is added to the DUT's filter
        • Host side transmits 1000 frames and then transmits the STOP command
        • Receive frames until STOP is detected
          • Frame 1: Source MAC address is DUT's. It should be accepted
          • Frame 2: Source MAC address is multicast address. It should be accepted
          • Expected to receive 1000 frames
      • Part 4
        • The multicast address is removed from the DUT's filter
        • Host side transmits 1000 frames and then transmits the STOP command
        • Receive frames until STOP is detected
          • Frame 1: Source MAC address is DUT's. It should be accepted
          • Frame 2: Source MAC address is multicast address. It should be rejected
          • Expected to receive 500 frames
      • Part 5
        • The filter is opened up (promiscuous mode)
        • Host side transmits 1000 frames and then transmits the STOP command
        • Receive frames until STOP is detected
          • Frame 1: Source MAC address is DUT's. It should be accepted
          • Frame 2: Source MAC address is not DUT's. It should be accepted
          • Expected to receive 1000 frames
      • Part 6
        • The filter is reset back to accept only DUT's unicast address
        • Host side transmits 1000 frames and then transmits the STOP command
        • Receive frames until STOP is detected
          • Frame 1: Source MAC address is DUT's. It should be accepted
          • Frame 2: Source MAC address is not DUT's. It should be rejected
          • Expected to receive 500 frames
    • EthApp_test_0006: Transmission with confirmation test. DUT frame transmission test with TX confirmation. The DUT performs these operations:
      • Send START command
      • Transmit 1000 non-VLAN tagged frames with confirmation
    • EthApp_test_0007: Transmission of VLAN tagged frames test. DUT frame transmission test of VLAN tagged frames. The DUT performs these operations:
      • Send START command
      • Transmit 1000 VLAN tagged frames with confirmation
    • EthApp_test_0008: Transmission of different frame lengths. DUT frame transmission test of different frame lengths, including short frames (less than 64 octets). The DUT performs these operations:
      • Send START command
      • Transmit 10 frames for lengths starting at 10 octets in increments of 10 octets until 1500 octets
    • EthApp_test_0009: VLAN tagged frame reception test
      • Host side transmits 1000 frames and then transmits the STOP command
      • The DUT performs these operations:
        • Send START command
        • Receive frames until the STOP is detected
      • The number of frames expected to be received is 1000
    • EthApp_test_0010: Controller mode change test. The DUT performs the following operations:
      • Send START command
      • Run 10 iterations of:
        • Set controller mode to DOWN state
        • Set controller mode to ACTIVE state
        • Transmit frames (run test 0002)
        • Receive frames (run test 0001)
    • EthApp_test_0100: DUT transmit throughput test. Measure DUT transmit throughput over 150000 frames
      • Host side transmits 150000 frames and then transmits the STOP command
      • The DUT performs the following operations:
        • Get the initial timestamp corresponding to the first frame received
        • Receive frames until the STOP is detected and get the final timestamp
        • Compute the transmit throughput from the number of received frames and the time difference between the two captured timestamps
    • EthApp_test_0200: Internal loopback test (MAC). The DUT performs the following operations:
      • Send and receive 1000 frames, for each of them:
        • A different payload is set
        • EtherType and payload are verified on the received frame
    • EthApp_test_0101: DUT receive throughput test.
      • Send START command
      • The Host transmits 150000 frames and then transmits the STOP command
      • The DUT performs the following operations:
        • Get the initial timestamp corresponding to the first frame received
        • Receive frames until the STOP is detected and get the final timestamp
        • Compute the transmit throughput from the number of received frames and the time difference between the two captured timestamps
    • EthApp_test_0300: Egress timestamp test
      • Send START command
      • The DUT performs the following operations:
        • Transmit 10 frames with confirmation, at 1 second intervals, then send STOP command
        • When Tx Confirmation API is called, EthIf_TxConfirmation(), get Egress timestamp save timestamp
    • EthApp_test_0301: Ingress timestamp test
      • Send START command
      • The DUT performs the following operations:
        • Receive frames until STOP is detected
        • When Rx Indication API is called, validate the frame and update the counter stats
        • For each frame received, get the Ingress timestamp
    • EthApp_test_0302: Get current timestamp test
      • Send START command
      • The DUT performs the following operations:
        • Transmit 10 frames with confirmation, sleep at 1 second intervals, then send STOP command
        • Get current timestamp after each 1 second delay
  • EthApp_showStats()
    • Get and print the Ethernet controller statistics (Eth_GetEtherStats())
  • EthApp_showDropCount()
    • Get and print the Ethernet controller drop counts (Eth_GetDropCount())
  • EthApp_deinit()
  • Check for error status and print the result

EthApp_test_0200 will run only when loopback is enabled via Ethernet driver configuration. All other tests will not run. Conversely, when loopback is disabled EthApp_test_0200 will not run.

The host application steps are not presented in this guide, but can be found documented in the host side code. Please refer to the File Structure section for the directory where the HostApp.c file can be found.

The configuration files are present can be found at the directories shown in the File Structure section.

Back To Top


Example Log

J721E/J7200

Default (non-loopback) example application log

Target-side application log
Eth Application Starts
MAC Port 1 Address: 50:51:a9:fb:f4:2e
EthTrcv mode: ACTIVE
EthTrcv link state: Up
EthTrcv baud rate: 1000Mbps
EthTrcv duplexity: Full
EthIf_TrcvModeIndication: Active


-----------------------------------------------------------
test_0001: START
test_0001: received 1000 of 1000 frames
test_0001: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0002: START
test_0002: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0003: START
test_0003: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0004: START
test_0004: received 500 of 500 frames
test_0004: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0005: START
test_0005:  Null: Exp1: exp 500, got 500
test_0005:  Null: Exp2: exp   0, got   0
test_0005: Ucast: Exp1: exp 500, got 500
test_0005: Ucast: Exp2: exp 500, got 500
test_0005: Mcast: Exp1: exp 500, got 500
test_0005: Mcast: Exp2: exp 500, got 500
test_0005: Mcast: Exp1: exp 500, got 500
test_0005: Mcast: Exp2: exp   0, got   0
test_0005: Bcast: Exp1: exp 500, got 500
test_0005: Bcast: Exp2: exp 500, got 500
test_0005:  Null: Exp1: exp 500, got 500
test_0005:  Null: Exp2: exp   0, got   0
test_0005: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0006: START
test_0006: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0007: START
test_0007: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0008: START
test_0008: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0009: START
test_0009: received 1000 of 1000 frames
test_0009: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0010: START
EthIf_CtrlModeIndication: DOWN
EthIf_CtrlModeIndication: ACTIVE
test_0002: START
test_0002: END
test_0001: START
test_0001: received 1000 of 1000 frames
test_0001: END
EthIf_CtrlModeIndication: DOWN
EthIf_CtrlModeIndication: ACTIVE
test_0002: START
test_0002: END
test_0001: START
test_0001: received 1000 of 1000 frames
test_0001: END
EthIf_CtrlModeIndication: DOWN
EthIf_CtrlModeIndication: ACTIVE
test_0002: START
test_0002: END
test_0001: START
test_0001: received 1000 of 1000 frames
test_0001: END
EthIf_CtrlModeIndication: DOWN
EthIf_CtrlModeIndication: ACTIVE
test_0002: START
test_0002: END
test_0001: START
test_0001: received 1000 of 1000 frames
test_0001: END
EthIf_CtrlModeIndication: DOWN
EthIf_CtrlModeIndication: ACTIVE
test_0002: START
test_0002: END
test_0001: START
test_0001: received 1000 of 1000 frames
test_0001: END
EthIf_CtrlModeIndication: DOWN
EthIf_CtrlModeIndication: ACTIVE
test_0002: START
test_0002: END
test_0001: START
test_0001: received 1000 of 1000 frames
test_0001: END
EthIf_CtrlModeIndication: DOWN
EthIf_CtrlModeIndication: ACTIVE
test_0002: START
test_0002: END
test_0001: START
test_0001: received 1000 of 1000 frames
test_0001: END
EthIf_CtrlModeIndication: DOWN
EthIf_CtrlModeIndication: ACTIVE
test_0002: START
test_0002: END
test_0001: START
test_0001: received 1000 of 1000 frames
test_0001: END
EthIf_CtrlModeIndication: DOWN
EthIf_CtrlModeIndication: ACTIVE
test_0002: START
test_0002: END
test_0001: START
test_0001: received 1000 of 1000 frames
test_0001: END
EthIf_CtrlModeIndication: DOWN
EthIf_CtrlModeIndication: ACTIVE
test_0002: START
test_0002: END
test_0001: START
test_0001: received 1000 of 1000 frames
test_0001: END
test_0010: completed 10 of 10 iterations
test_0010: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0100: START
test_0100: 150000 frames sent, 0 buffer underflows
test_0100: END
Test Result: Pass
-----------------------------------------------------------

-----------------------------------------------------------
test_0300: START
Egress timestamp 0 Ts: 650476870 246  0
Egress timestamp 1 Ts: 682270334 246  0 [Exp: 0.030999999 Actual: 0.031793464]
Egress timestamp 2 Ts: 745274750 246  0 [Exp: 0.061999999 Actual: 0.063004419]
Egress timestamp 3 Ts: 871283942 246  0 [Exp: 0.125000000 Actual: 0.126009196]
Egress timestamp 4 Ts: 122303734 247  0 [Exp: 0.250000000 Actual: 0.251019806]
Egress timestamp 5 Ts: 623344054 247  0 [Exp: 0.500000000 Actual: 0.501040339]
Egress timestamp 6 Ts: 374404334 248  0 [Exp: 0.750000000 Actual: 0.751060307]
Egress timestamp 7 Ts: 375484382 249  0 [Exp: 1.000000000 Actual: 1.001080036]
Egress timestamp 8 Ts: 376644462 251  0 [Exp: 2.000000000 Actual: 2.001160145]
Egress timestamp 9 Ts: 378044174 256  0 [Exp: 5.000000000 Actual: 5.001399994]
test_0300: END
Test Result: Pass 0
-----------------------------------------------------------


-----------------------------------------------------------
test_0301: START
test_0301: received 10 of 10 frames
Ingress timestamp 0 Ts: 369429244 260  0
Egress timestamp 1 Ts: 401815650 260  0 [Exp: 0.030999999 Actual: 0.032386407]
Egress timestamp 2 Ts: 465870244 260  0 [Exp: 0.061999999 Actual: 0.064054593]
Egress timestamp 3 Ts: 591993570 260  0 [Exp: 0.125000000 Actual: 0.126123324]
Egress timestamp 4 Ts: 843143780 260  0 [Exp: 0.250000000 Actual: 0.251150221]
Egress timestamp 5 Ts: 344322690 261  0 [Exp: 0.500000000 Actual: 0.501178920]
Egress timestamp 6 Ts:  95464250 262  0 [Exp: 0.750000000 Actual: 0.751141548]
Egress timestamp 7 Ts:  97782578 263  0 [Exp: 1.000000000 Actual: 1.002318382]
Egress timestamp 8 Ts:  98943850 265  0 [Exp: 2.000000000 Actual: 2.001161098]
Egress timestamp 9 Ts: 100049914 270  0 [Exp: 5.000000000 Actual: 5.001105785]
test_0301: END
Test Result: Pass 0
-----------------------------------------------------------


-----------------------------------------------------------
test_0302: START
Current timestamp 0 Ts:  87536016 275  0
Current timestamp 0 Ts: 221622876 276  0
Current timestamp 0 Ts: 351712940 277  0
Current timestamp 0 Ts: 482803620 278  0
Current timestamp 0 Ts: 611894208 279  0
Current timestamp 0 Ts: 745984668 280  0
Current timestamp 0 Ts: 876074988 281  0
Current timestamp 0 Ts:  10165668 283  0
Current timestamp 0 Ts: 146256568 284  0
Current timestamp 0 Ts: 277347156 285  0
test_0302: END
Test Result: Pass 0
-----------------------------------------------------------


-----------------------------------------------------------
test_0110: START
test_0100 frames 150000 size 1500: START
test_0100: 150000 frames size 1500
test_0100: END
test_0100 frames 150000 size 512: START
test_0100: 150000 frames size 512
test_0100: END
test_0100 frames 150000 size 256: START
test_0100: 150000 frames size 256
test_0100: END
test_0100 frames 150000 size 128: START
test_0100: 150000 frames size 128
test_0100: END
test_0100 frames 150000 size 64: START
test_0100: 150000 frames size 64
test_0100: END
test_0110: DONE
Test Result: Pass 0
-----------------------------------------------------------


-----------------------------------------------------------
test_0101: START
receiveTput-1500: received 149994 frames in 1.97 secs (76177.76 frames/s, 941.13 Mbps) Lost 0
receiveTput-512: received 88416 frames in 0.72 secs (122121.55 frames/s, 617.21 Mbps) Lost 50
receiveTput-256: received 61645 frames in 0.52 secs (119235.97 frames/s, 410.20 Mbps) Lost 88
receiveTput-128: received 128446 frames in 1.01 secs (127300.30 frames/s, 220.36 Mbps) Lost 7
receiveTput-64: received 157689 frames in 1.25 secs (126657.83 frames/s, 130.85 Mbps) Lost 16
test_0101: END
Test Result: Pass 0
-----------------------------------------------------------


----------------------------
Controller 0 Statistics
----------------------------
Drop Events       : 0
Octets            : 229322384
Packets           : 1002
Bcast Packets     : 1
Mcast Packets     : 0
CRC/Align Errors  : 0
Undersized Packets: 0
Oversized Packets : 0
Fragments         : 0
Jabbers           : 0
Collisions        : 0
----------------------------
Controller 0 Drop Counters
----------------------------
Buffer overruns   : -1
CRC errors        : 0
Undersize packets : 0
Oversized packets : 0
Alignment errors  : 0
SQE errors        : 0
Discarded inbound : 0
Erroneous inbound : 0
Discarded outbound: 0
Erroneous outbound: 0
Single collision  : 0
Multiple collision: 0
Deferred transm   : 0
Late collisions   : 0
Excessive colls   : 0
Buffer underrun   : 0
Carrier-sense     : 0
ETH Stack Usage: 1936 bytes
Eth Application Completed
Host-side application log
$ sudo ./EthHostApp -i enp3s0f1
Interface    : enp3s0f1
MAC address  : 00:15:17:2e:94:57


Waiting for DUT..
DUT detected: 50:51:a9:fb:f4:2e


-----------------------------------------------------------
test_0001: START
test_0001: transmitted 1000 of 1000 frames
test_0001: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0002: START
test_0002: received 1000 of 1000 frames
test_0002: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0003: START
test_0003: looped back 1000 frames
test_0003: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0004: START
test_0004: completed 500 of 500 iterations
test_0004: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0005: START
test_0005: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0006: START
test_0006: received 1000 of 1000 frames
test_0006: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0007: START
test_0007: received 1000 of 1000 frames
test_0007: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0008: START
test_0008: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0009: START
test_0009: transmitted 1000 of 1000 frames
test_0009: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0010: START
test_0002: START
test_0002: received 1000 of 1000 frames
test_0002: END
test_0001: START
test_0001: transmitted 1000 of 1000 frames
test_0001: END
test_0002: START
test_0002: received 1000 of 1000 frames
test_0002: END
test_0001: START
test_0001: transmitted 1000 of 1000 frames
test_0001: END
test_0002: START
test_0002: received 1000 of 1000 frames
test_0002: END
test_0001: START
test_0001: transmitted 1000 of 1000 frames
test_0001: END
test_0002: START
test_0002: received 1000 of 1000 frames
test_0002: END
test_0001: START
test_0001: transmitted 1000 of 1000 frames
test_0001: END
test_0002: START
test_0002: received 1000 of 1000 frames
test_0002: END
test_0001: START
test_0001: transmitted 1000 of 1000 frames
test_0001: END
test_0002: START
test_0002: received 1000 of 1000 frames
test_0002: END
test_0001: START
test_0001: transmitted 1000 of 1000 frames
test_0001: END
test_0002: START
test_0002: received 1000 of 1000 frames
test_0002: END
test_0001: START
test_0001: transmitted 1000 of 1000 frames
test_0001: END
test_0002: START
test_0002: received 1000 of 1000 frames
test_0002: END
test_0001: START
test_0001: transmitted 1000 of 1000 frames
test_0001: END
test_0002: START
test_0002: received 1000 of 1000 frames
test_0002: END
test_0001: START
test_0001: transmitted 1000 of 1000 frames
test_0001: END
test_0002: START
test_0002: received 1000 of 1000 frames
test_0002: END
test_0001: START
test_0001: transmitted 1000 of 1000 frames
test_0001: END
test_0010: completed 10 of 10 iterations
test_0010: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0300: START
test_0300: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0301: START
test_0301: transmitted 10 of 10 frames
test_0301: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0302: START
test_0302: END
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0110: START
receiveTput-1500: received 143595 frames in 1.85 secs (77804.69 frames/s, 984.37 Mbps) Lost 0
receiveTput-512: received 149900 frames in 1.38 secs (108709.37 frames/s, 690.45 Mbps) Lost 0
receiveTput-256: received 138874 frames in 1.34 secs (103410.81 frames/s, 380.37 Mbps) Lost 0
receiveTput-128: received 149294 frames in 1.32 secs (113408.23 frames/s, 202.83 Mbps) Lost 0
receiveTput-64: received 138764 frames in 1.31 secs (105695.96 frames/s, 123.95 Mbps) Lost 0
test_0110: DONE
Test Result: Pass
-----------------------------------------------------------


-----------------------------------------------------------
test_0101: START
transmitTput: TX side transmitted 150000 frames in 1.97 secs (76197.48 frames/s, 984.37 Mbps)
transmitTput: TX side transmitted 150000 frames in 0.72 secs (207325.50 frames/s, 955.21 Mbps)
transmitTput: TX side transmitted 150000 frames in 0.52 secs (290776.56 frames/s, 904.51 Mbps)
transmitTput: TX side transmitted 300000 frames in 1.01 secs (297653.28 frames/s, 543.80 Mbps)
transmitTput: TX side transmitted 300000 frames in 1.24 secs (241059.31 frames/s, 215.42 Mbps)
test_0101: END
Test Result: Pass
-----------------------------------------------------------

Back To Top


Known Limitations

None

Back To Top


References

Sl No Specification Comment / Link
1 AUTOSAR 4.3.1 AUTOSAR Specification for Eth Driver Internet Link
2 AUTOSAR 4.3.1 AUTOSAR Specification for EthTrcv Driver Internet Link
3 - Design Page (Eth Design Document)

Back To Top


Document Revision History

Revision Date Author Description Status
0.1 08 Oct 2018 Misael Lopez First version Pending Review
0.2 22 Oct 2018 Misael Lopez Addressed review comments Approved
0.3 30 Nov 2018 Misael Lopez Updated UDMA interrupt information Pending Review
0.4 06 Dec 2018 Misael Lopez Updating Status Approved
0.5 16 Oct 2019 Sujith S Updates profile numbers for release 01.00.00 Approved
0.6 29 May 2020 Misael Lopez Updated for AUTOSAR 4.3.1 Approved
0.7 02 Dec 2022 Quan Tran Updated DMA configuration and lastest driver update Approved