RTA Knowledge Base

Table of Contents

Introduction

This Application Note is going to explain how the System Description can be used to describe an Ethernet Network. This will allow us to take advantage of the new Ethernet Importers added to RTA-CAR 9. The new Ethernet Importers allow confgen to use the System Description to generate the BSW configuration required for the Ethernet Network and its messages, significantly shortening the effort required to add a new Ethernet Signal to a project. The First chapter will describe all of the relevant parts of the System Description and the Second will explain the steps required to generate the BSW configuration for a new Ethernet Network on the standard RTA-CAR Starter Kit (An example project with no preexisting Ethernet Configuration).

If you have followed the Changing Ethernet Ports, IP Addresses and Signals Application Note before, then this series of steps should replace step 2 of the Creating a New Ethernet Signal section.

Toolchain

This Application Note will use the RTA-CAR 9.2.0 toolchain.

RTA-CAR 9.2.0 toolchain
ISOLAR-AB9.2.0
RTA-RTE7.5.0
RTA-BSW6.1.2
RTA-OS6.2.0

Abbreviations and Definitions

IP - Internet Protocol: The most common network layer protocol used with Ethernet. Addresses are assigned to endpoints and packets will be routed towards their endpoint.

UDP - User Datagram Protocol (The simplest of the two most common Transport Layer Protocols: TCP and UDP)

Eth - Ethernet MCAL Module

EthIf - Ethernet Interface BSW Module (Interface between MCAL and TcpIp stack)

TcpIp - The BSW module that implements the TCP/IP autosar stack. Also handles UDP frames.

SoAd - Socket Adapter BSW Module. This module is responsible for adapting between the Autosar communication method of Pdus and their fixed routes and the Ethernet method of socket based communication. Pdu Routes will be mapped to Sockets.

1. About the System Description

The system description is a group of arxml files contained in a project which describes the communication of ECUs within the system. The user can define new Frames, Signals, Ports and other com bus dependent properties. In this section the Application Note will aim to describe the meaning of most of the components which help describe an Ethernet System and explain how these map to the BSW configuration that is generated.

1.1 EthCommunicationController

This configuration item is used to define the properties of the Ethernet Controller Hardware. Its properties will be used when generating the Eth and EthIf BSW module configurations.

1.2 EthCommunicationConnector

A communication connector links a Communication Controller, an ECU instance, and a Physical channel. The relationship is as such: A Physical Channel references a Communication Connector (which is a child of the ECU Instance), and the Communication Connector references a Communication Controller.

An EthCommunicationConnector contains Ports (See IPduPorts/ISignalPorts/FramePorts).

Certain properties can be configured for the connector:

The NetworkEndpoint references determine which IP Addresses will be assigned to the Ecu Instance.

1.2.1 Ports

A port represents a port of the connector. It can be a port for a Pdu (IPduPort), a Signal (ISignalPort), or Frame (FramePort). A port will be referenced by its respective type of triggering (IPduTriggering/ISignalTriggering/FrameTriggering).


1.3 EthPhysicalChannel

An Ethernet physical channel represents a VLAN (Virtual Local Area Network). A VLAN can be tagged or untagged, by default an EthPhysicalChannel represents an untagged VLAN (This means it acts naive to any actual VLAN, and just passes on the packets without adding any VLAN metadata). To configure a VLAN the VlanConfig and VlanIdentifier should be defined. 

An EthPhysicalChannel references an EthCommunicationConnector (As described in section above). It also contains the Network Endpoints, any triggerings, and the SoAdConfig.

1.3.1 Network Endpoint

A network endpoint is used to describe a Network IP Address or Multicast MAC Address. The configuration of these will map to the TcpIp module, where the ECU's IP Addresses are set, and the SoAd module, where the IP Addresses that the ECU may transmit to are set.

1.3.2 Triggerings

Similarly to a Port (See section 1.2.1), a Triggering can be used for a Pdu (IPduTriggering), a Signal (ISignalTriggering), or a Frame (FrameTriggering). A triggering describes on what channel the object (Pdu/Signal/Frame) is transmitted. A Triggering contains a reference to a port, and may also contain a reference for a smaller object type triggering (e.g. An IPduTriggering referencing an ISignalTriggering, or a FrameTriggering referencing an IPduTriggering). Generally a frame is not required to be defined for Ethernet signals in the System Description, and PDUs will be used more often.

1.3.3 SoAdConfig

The SoAdConfig is the Socket Adapter (BSW Module) configuration for a Physical Channel. It consists of a set of routes for PDUs to take to/from sockets. A socket is an endpoint of a link between to communicators on a network. The point of the Socket Adapter module is to adapt between the Autosar method of communication (PDU based) and the type Ethernet method of communication (Sockets).

Generally the configuration items that are part of the SoAdConfig in the System Description can be mapped to its corresponding configuration in the SoAd BSW module. 

1.3.3.1 SocketAddress

A socket address defines a port and an IP address that can be used to send/receive data to/from. The SocketAddress itself doesn't actually contain the port, instead it contains an ApplicationEndpoint which defines the port protocol (UDP or TCP) and the port number.

The SocketAddresses are referenced by SocketConnections, this will allow the sockets (which PDUs will be routed towards) to have an address and port assigned to them. The port will be set in the SoAd configuration and a reference to the TcpIp endpoint for the IP address will also be created.

1.3.3.2 SocketConnection and SocketConnectionBundle

A SocketConnectionBundle is a group of SocketConnections. Some parts of the configuration may be common between SocketConnections and this allows them to only be configured once. SocketConnections define a connection between two endpoints (Local and Remote) and also the Pdu which is routed between the two. There is then some extra configuration items available which may be required for certain types of message (e.g. Service Discovery). The configuration for SocketConnections and Bundles maps almost directly to the SoAd BSW module (SocketConnectionBundles become SocketConnectionGroups).

1.3.3.3 SoAdRoutingGroups

SoAdRoutingGroups are groups of SocketConnections that can be turned on and off. This could be useful for disabling Tx communication for example. A common usecase is to enable and disable communication depending on whether the ECU has subscribed to a service provided by another ECU (or vice versa).

2. Adding an Ethernet Network to The RTA-CAR Standard SK

This section will discuss the steps required to add an Ethernet Network to the Standard RTA-CAR Starter Kit. It will go through the changes required in the System Description and BSW configuration to implement an Ethernet Message that is transmitted by the ECU periodically. It will already assume the ASW and RTE/OS is implemented (SWCs, Timing Events, Task Scheduling, etc.).

2.1 Editing the System Description

 1. Create a new Ethernet Cluster by dragging the New Cluster button onto the Ethernet section of the Networks table in the system editor. This may already exist so only create a new cluster if it is not present.

2. Rename the protocol to ETHERNET so that the Cluster Properties name is clearer.

3. Create a new Physical Channel by dragging the New Physical Channel onto the Ethernet Networks table. After this drag the ApplicationECU onto the physical channel. Adding the ECU will also automatically create a CommunicationController and CommunicationConnector.

4. Add a new controller conditional as a child of the EthernetCommunicationController. Set the properties required for the target Ethernet Controller.

5. Add a new Coupling Port. In this case the Physical Layer Type is set to BROAD-R-REACH and the Speed (Baudrate) is set to 100Mbps.

6. Add a VlanMembership to the CouplingPort and set the Vlan to the PhysicalChannel that was created earlier. This will ensure that the Ethernet Controller configuration will be generated in the Eth and EthIf modules.

7.  Go back to the System Editor and drag the Ethernet Pdu onto the transmit section of the table. This will result in the automatic generation of the Triggerings and Ports (Pdu/Signal Port/Triggering).

8. Create the UDP SocketAddresses for the transmitter and receiver. This can be done by selecting the SocketAddress container (a child of the PhysicalChannel in the EthernetCluster) and then dragging the New UDP Address onto the Ipv4 section of the table. Creating a new SocketAddress this way will automatically generate a NetworkEndpoint for the IP Address and an ApplicationEndpoint for the UDP Port. Note that the NetworkEndpoints have been renamed so that which Endpoint is which is clearer in future steps.

9. Now that the NetworkEndpoints have been created we can map the local NetworkEndpoint to the EthernetCommunicationConnector generated during step 3. Note that the MaximumTransmissionUnit and NeighborCacheSize has also been configured, these values may depend on your target controller but these values are sufficient for the VRTA.

10. Create a new SocketConnectionBundle

11. Make sure that the ServerPort points to the SocketAddress created to represent the local ecu.

12. Create a new SocketConnection within the bundle

13. Configure the SocketConnection and make sure the client port points to the SocketAddress that represents the Remote ECU.

14. Add a PDU as a child to the Socket Connection that was created previously. The Pdu should point to the PDU that was created as a prerequisite for this guide and the PduTriggering should point to the PduTriggering created automatically during step 7.

15. Run Confgen by pressing the e button (Generate ECU Configuration wizard) highlighted in the screenshot below.

16. This should generate all of the BSW configuration that is required. There is a known issue with confgen where the reference to the EthTrcv is not generated correctly. If this is the case the reference will be marked as invalid

17. To fix this select show all references and then choose the correct transceiver.

18. After this the BSW configuration should be ok to generate. For transmitting an Ethernet frame the following modules should be selected for generation:

  • EthIf
  • EthSM
  • Rba_EthIPv4
  • Rba_EthUdp
  • TcpIp
  • EthTrcv (Depending on target)

19. After BSW generation is successful the rest of the integration can be started. This will include mapping BSW MainFunctions to a task, mapping SystemSignals to ComSignals in the System Mapping Editor, and adding Init functions to the BswM ActionLists.