Skip to content

Latest commit

 

History

History
472 lines (393 loc) · 19.9 KB

4_4_2_lin.adoc

File metadata and controls

472 lines (393 loc) · 19.9 KB

LIN

This chapter describes the Layered Standard Bus Protocol for LIN. The LIN chapter is currently only a preview and will be further adapted during the development of this standard.

Overview

To simulate LIN buses, LIN-specific operations are specified based on the Layered Standard Bus Protocol. Overall, the following groups of operations exists:

  • Transmit: This group of operations is used to simulate a frame transmission. There are three specific operations that represent the different communication options between a LIN Master and one or more LIN Slaves.

  • Error: This group of operations is used for protocol format errors and to simulate bus failures. For example, the failure of a transmission can be indicated.

  • Configuration: This operation enables the configuration of bus-specific parameters and options that are required to simulate the bus behavior properly. For example, it allows the specification of the baud rate.

  • Status: This operation is used by Networked FMUs to inform Bus Simulations about the internal state (Power Off/Initialization/Operation/Sleep) which concerns the reaction on bus errors.

  • Wake up: LIN supports wake up and sleep scenarios. Normally there are two ways to wake up from sleep mode: a local wake up on a specified wake-up pin, or a wake-up on the LIN bus via a LIN specific wake-up pulse. This operation is used to simulate triggering a wake-up from bus side.

The following table gives a detailed overview of the available operations. It shows all operations and the arguments they contain.

Table 1. Overview of the available operations for LIN.

Operation Name

Operation Content

OP Code

Length

Specific Content

Format Error

0x00

:= 5 + n
(4 bytes)

Data
(n bytes)

Header

0x10

:= 7
(4 bytes)

PID
(1 byte)

Response Data Length
(1 byte)

Response

0x11

:= 8 + DL
(4 bytes)

PID
(1 byte)

Response Error
(1 byte)

DL
(1 byte)

Data
(n bytes)

Header Response

0x12

:= 7 + DL
(4 bytes)

PID
(1 byte)

DL
(1 byte)

Data
(n bytes)

Bus Error

0x20

:= 12
(4 bytes)

ID
(4 bytes)

Error Code
(1 byte)

Configuration

0x30

<Length>
(4 bytes)

Kind
(1 byte)

Dynamic Part

Status

0x40

:= 6
(4 bytes)

Status
(1 byte)

Wakeup

0x41

:= 5
(4 bytes)

---

Operations

This section defines the allowed operations for LIN. The following tables provide an overview of all operations and specifies the position and length of the corresponding arguments, as well as the respective flow direction.

Transmit

There are three types of Transmit operations, each representing the transmission of a LIN header, a response and a combination of a header and response.

Table 2. Detailed description of the LIN Header operation.

Name

Header

Description

Represents an operation for the transmission of a LIN header from a LIN Master to LIN slaves.

OP Code [hex]

0x10

Content

Argument

Length

Description

OP Code

1 byte

Contains the OP Code of the specified operation. For this operation the OP Code always has the value 0x10.

Length

4 bytes

Defines the cumulative length of all arguments in bytes. For this operation always applies: Length = 7.

PID

1 byte

The specified protected ID (PID) of the LIN message. The maximum length of a PID is 8-bit.

Response Data Length

1 byte

The size of the response in bytes.

Behavior

The Header operation shall be provided by Network FMUs to initiate the transmission of a LIN header. In case of direct connected Network FMUs (see [common-concepts-direct-communication]), the FMU importer forwards the operation directly to the receiving Network FMUs. If a Bus Simulation is involved (see [common-concepts-composition-with-dedicated-bus-simulation-fmu] and [common-concepts-importer-with-integrated-bus-simulation]), the FMU importer forwards the operation initially to the Bus Simulation, where the operation is distributed with respect to the simulated bus behavior. Depending on the simulation details, the Bus Simulation might respond with a Bus Error or Format Error operation.

Table 3. Detailed description of the LIN Response operation.

Name

Response

Description

Represents an operation for the transmission of a LIN response from a LIN Slave to the LIN Master.

OP Code [hex]

0x11

Content

Argument

Length

Description

OP Code

1 byte

Contains the OP Code of the specified operation. For this operation the OP Code always has the value 0x11.

Length

4 bytes

Defines the cumulative length of all arguments in bytes. For this operation always applies: Length = 8 + Data Length.

PID

1 byte

The specified protected ID (PID) of the LIN message. The maximum length of a PID is 8-bit.

Response Error

1 byte

Represents the Response Error field of a LIN frame. For specification the boolean values TRUE and FALSE (see [table-boolean-value-kinds]) shall be used.

Data Length

1 byte

Specifies the length of the Data argument in bytes.

Data

n bytes

Stores the given frame data to transfer, whereby the valid length of the data depends on the LIN Format.

Behavior

The Response operation shall be provided by Network FMUs to initiate a response to a given LIN header. In case of direct connected Network FMUs (see [common-concepts-direct-communication]), the FMU importer forwards the operation directly to the receiving Network FMUs. If a Bus Simulation is involved (see [common-concepts-composition-with-dedicated-bus-simulation-fmu] and [common-concepts-importer-with-integrated-bus-simulation]), the FMU importer forwards the operation initially to the Bus Simulation, where the operation is distributed with respect to the simulated bus behavior. Depending on the simulation details, the Bus Simulation might responsd with a Bus Error or Format Error operation.

Table 4. Detailed description of the LIN Header Response operation.

Name

Header Response

Description

Represents an operation for the transmission of a LIN header and response from a LIN Master to LIN slaves.

OP Code [hex]

0x12

Content

Argument

Length

Description

OP Code

1 byte

Contains the OP Code of the specified operation. For this operation the OP Code always has the value 0x12.

Length

4 bytes

Defines the cumulative length of all arguments in bytes. For this operation always applies: Length = 7 + Data Length.

PID

1 byte

The specified protected ID (PID) of the LIN message. The maximum length of a PID is 8-bit.

Data Length

1 byte

Specifies the length of the Data argument in bytes.

Data

n bytes

Stores the given frame data to transfer, whereby the valid length of the data depends on the LIN Format.

Behavior

The Header Response operation shall be provided by Network FMUs to initiate the transmission of a LIN frame that contains the specified header and response. In case of direct connected Network FMUs (see [common-concepts-direct-communication]), the FMU importer forwards the operation directly to the receiving Network FMUs. If a Bus Simulation is involved (see [common-concepts-composition-with-dedicated-bus-simulation-fmu] and [common-concepts-importer-with-integrated-bus-simulation]), the FMU importer forwards the operation initially to the Bus Simulation, where the operation is distributed with respect to the simulated bus behavior. Depending on the simulation details, the Bus Simulation might respond with a Bus Error or Format Error operation.

Format Error

Represents a format error that indicates a syntax or content error of receiving operations. See Format Error for definition.

Bus Error

The Bus Error represents special bus communication errors, which are delivered to the LIN Master node in the network.

Table 5. Detailed description of the Bus Error operation.

Name

Bus Error

Description

Represents an operation for bus communication error handling.

OP Code [hex]

0x20

Content

Argument

Length

Description

OP Code

1 byte

Contains the OP Code of the specified operation. For this operation the OP Code always has the value 0x20.

Length

4 bytes

Defines the cumulative length of all arguments in bytes. For this operation always applies: Length = 10.

ID

4 bytes

The specified ID of the LIN message which triggers the error.

Error Code

1 byte

The specified error code, basing on the table below.

Behavior

The specified operation shall be produced by the Bus Simulation and consumed by Network FMUs. An Error operation is always a reaction from the Bus Simulation to a Transmit operation that was produced by a Network FMU. Out of this Error operations are available in the Composition with dedicated Bus Simulation FMU and Importer with Integrated Bus Simulation communication use case only.

The following codes are allowed to use as Error Code:

Table 6. Overview of the available error states and codes.

State

Error Code

Description

BIT_ERROR

0x01

Represents a bit error. The given error is always related to a specific Transmit operation.

CHECKSUM_ERROR

0x02

Represents a CRC error. The error can occur during a collision of multiple response frames when Event-Triggered-Frames are used. The given error is always related to a specific Transmit operation.

IDENTIFIER_PARITY_ERROR

0x03

Represents an Identifier Parity Error. The error can occur during a collision of multiple LIN headers. The given error is always related to a specific Transmit operation.

SLAVE_NOT_RESPONDING_ERROR

0x04

Represents a Slave Not Responding Error. The error can occur if LIN Slaves does not respond to a specified LIN header. The given error is always related to a specific Transmit operation.

SYNCH_FIELD_ERROR

0x05

Represents an Inconsistent-Synch Field Error. The given error is always related to a specific Transmit operation.

PHYSICAL_BUS_ERROR

0x06

Represents a Physical Bus Error. The given error is always related to a specific Transmit operation.

Configuration

The Configuration operation allows Network FMUs the configuration of the Bus Simulation with parameters like baud rate information and further options. The following information are included within this operation:

Table 7. Detailed description of the Configuration operation.

Name

Configuration

Description

Represents an operation for the configuration of a Bus Simulation. In detail the configuration of a LIN baud rate is possible. Also the configuration of further options, like LIN Master or LIN Slave representation, is supported by this operation.

OP Code [hex]

0x30

Content

Argument

Length

Description

OP Code

1 byte

Contains the OP Code (0x30) of the operation.

Length

4 bytes

Defines the cumulative length of all arguments in bytes. The following applies for this operation: Length = 6 + Length of parameter arguments in bytes.

Parameter Type

1 byte

Defines the current configuration parameter. Note that only one parameter can be set per Configuration operation.

Parameters

LIN_BAUDRATE

Baud Rate

4 byte

The specified baud rate value to configure, whereby the specified ranges are defined by the LIN standard. The required unit for the baud rate value is bit/s.

LIN_NODE_DEFINITION

Node Definition

1 byte

Configures the required node type (Master or Slave) within a Bus Simulation. Possible values are: LIN_MASTER and LIN_SLAVE (see Overview of the available node definition values for LIN.).

Behavior

The specified operation shall be produced by a Network FMU and consumed by the Bus Simulation. The operation shall not be routed to other Network FMUs by the Bus Simulation. A Network FMU shall ignore this operation on consumer side. The configuration shall be completed by a specified Network FMU before it produces any Transmit operations. The configuration must not be repeated multiple times during the runtime of a Network FMU. A Bus Simulation should stop as soon as more than one LIN_MASTER is configured in a network. If required configuration parameters are not adjusted by a Network FMU the Bus Simulation shall choose a default behavior by itself.

The following Kind values are allowed to be used:

Table 8. Overview of the available configuration kinds and values.

Kind

Value

Description

LIN_BAUDRATE

0x01

This code indicates that a LIN baud rate should be configured for the Bus Simulation.

LIN_NODE_DEFINITION

0x02

This code configures the specified node type (Master or Slave) within a Bus Simulation.

The following values for the Arbitration Lost Behavior option are defined:

Table 9. Overview of the available node definition values for LIN.

Node Definition

Value

Description

LIN_MASTER

0x01

Configuration of a LIN Master node within a specified Bus Simulation.

LIN_SLAVE

0x02

Configuration of a LIN Slave node within a specified Bus Simulation.

Status

By using the Status operation a Network FMU can communicate the current LIN node state of the simulated LIN Controller within the Network FMU to the Bus Simulation. The following information are included within this operation:

Table 10. Detailed description of the Status operation.

Name

Status

Description

Represents an operation for status handling.

OP Code [hex]

0x40

Content

Argument

Length

Description

OP Code

1 byte

Contains the OP Code of the specified operation. For this operation the OP Code always has the value 0x40.

Length

4 bytes

Defines the cumulative length of all arguments in bytes. For this operation always applies: Length = 6.

Status

1 byte

The specified status code, basing on the table below.

Behavior

The specified operation shall be produced by Network FMUs and consumed by the Bus Simulation. The operation shall not be routed to other Network FMUs by the Bus Simulation. A Network FMU shall ignore this operation on the consumer side. A Network FMU shall report its status to the Bus Simulation after it changes.

The following status values are allowed to use:

Table 11. Overview of the available status values.

Kind

Value

Description

POWER_OFF

0x01

Indicates that a simulated LIN controller within the Network FMU has currently the LIN node state: Power Off.

INITIALIZATION

0x02

Indicates that a simulated LIN controller within the Network FMU has currently the LIN node state: Initialization.

OPERATION

0x03

Indicates that a simulated LIN controller within the Network FMU has currently the LIN node state: Operation.

SLEEP

0x04

Indicates that a simulated LIN controller within the Network FMU has currently the LIN node state: Sleep.

Wake Up

By using the Wakeup operation the underlying Bus Simulation can trigger a bus-specific wake-up.

Table 12. Detailed description of the Wakeup operation.

Name

Wakeup

Description

Represents an operation for triggering a bus-specific wake-up.

OP Code [hex]

0x41

Content

Argument

Length

Description

OP Code

1 byte

Contains the OP Code of the specified operation. For this operation the OP Code always has the value 0x41.

Length

4 bytes

Defines the cumulative length of all arguments in bytes. For this operation always applies: Length = 5.

Behavior

The specified operation shall be produced by a Network FMU and distributed to all participants, except the wake-up initiator, of the bus by using the Bus Simulation. If a Network FMU does not support wake-up this operation can be ignored on consumer side.

Transmission and Reception

To be defined.

Detection of Collisions

To be defined.

Configuration of Bus Simulation

The configuration of the Bus Simulation is done by the Network FMUs itself. For this purpose, the Configuration operation provides several configuration parameters. Configuration operations can be produced multiple times during the runtime of a Network FMU. Because the Bus Simulation shall choose a default behavior, it might be useful in several scenarios that Network FMUs finish configuration before the production of Transmit operations.

Baud Rate Handling

In order to calculate the time required for the transmission of a bus message, it is necessary to inform the Bus Simulation about the specified baud rate from a Network FMU. This baud rate information can be configured by using LIN_BAUDRATE configuration kind of the Configuration operation. If the baud rate information is not adjusted by a specified Network FMU, the Bus Simulation shall choose a default behavior by itself.

Node Definition

By using the LIN_NODE_DEFINITION kind of Configuration operation, the specified node type LIN_MASTER or LIN_SLAVE needs to be adjusted. This configuration must be done before the first exchange of Transmit operations. A Bus Simulation should stop as soon as more than one LIN Master is configured in a network.

Error Handling

To be defined.

Wake Up/Sleep

This standard supports wake up and sleep for the LIN bus, whereby only the bus-specific parts are taken into account. This means that the realization of local virtual ECU wake-up and sleeping processes are internal parts of the respective FMU, which is not covered by this document. Because entering sleep state is a virtual ECU internal process always within LIN bus, this can be ignored. Also, the virtual ECU local wake-up process is ignored as well. The LIN-specific wake-up pulse can be simulated by using the Wakeup operation. A Wakeup operation is initiated by one Network FMU and shall be distributed to all participants of the bus,except the wake-up initiator, by the Bus Simulation.

lin wake up
Figure 1. Wake up initiated by FMU 1 wakes up FMU 2 and FMU 3 via bus.