Skip to content

Commit 9ce4ab7

Browse files
Benedikt MenneBenedikt Menne
authored andcommitted
Adding some LIN content
1 parent b8f14e7 commit 9ce4ab7

File tree

3 files changed

+149
-8
lines changed

3 files changed

+149
-8
lines changed

docs/4_4_2_lin.adoc

Lines changed: 145 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,107 @@
11
==== LIN
22
This chapter describes the <<low-cut-layered-standard-bus-protocol, Layered Standard Bus Protocol>> for LIN.
33

4+
===== Overview
5+
To simulate LIN buses, LIN-specific operations are specified based on the <<low-cut-layered-standard-bus-protocol, Layered Standard Bus Protocol>>.
6+
Overall, the following groups of operations exists:
7+
8+
* Transmit: This group of operations is used to simulate a frame transmission.
9+
There are three specific operations that represent the different communication options between a LIN Master and one or more LIN Slaves.
10+
* Error: This group of operations is used for protocol format errors and to simulate bus failures.
11+
For example, the failure of a transmission can be indicated.
12+
* Configuration: The configuration operation enables the configuration of bus-specific parameters and options that are required to simulate the bus behavior properly.
13+
For example, it allows the specification of the baud rate.
14+
* Status: The Status 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.
15+
* Wake up: LIN supports wake up and sleep scenarios.
16+
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.
17+
This operation is used to simulate triggering a wake up from bus side.
18+
19+
The following table gives a detailed overview of the available operations.
20+
It shows all operations and the arguments they contain.
21+
22+
.Overview of the available operations for LIN.
23+
[#table-operation-content-lin]
24+
[cols="9,1,6,5,5,5,5,5,5,5,5"]
25+
|====
26+
.2+h|Operation Name
27+
10+h|Operation Content
28+
29+
h|OP Code
30+
h|Total Length
31+
8+h|Specific Content
32+
33+
|Format Error
34+
|0x00
35+
|:= 5 + n +
36+
(4 byte)
37+
8+|Data +
38+
(n byte)
39+
40+
|Header
41+
|0x10
42+
|:= 7 +
43+
(4 byte)
44+
|PID +
45+
(1 byte)
46+
7+|Response Data Length +
47+
(1 byte)
48+
49+
|Response
50+
|0x11
51+
|:= 8 + DL +
52+
(4 byte)
53+
|PID +
54+
(1 byte)
55+
2+|Response Error +
56+
(1 byte)
57+
|DL +
58+
(1 byte)
59+
4+|Data +
60+
(n byte)
61+
62+
|Header Response
63+
|0x12
64+
|:= 7 + DL +
65+
(4 byte)
66+
|PID +
67+
(1 byte)
68+
|DL +
69+
(1 byte)
70+
6+|Data +
71+
(n byte)
72+
73+
|Bus Error
74+
|0x20
75+
|:= 12 +
76+
(4 byte)
77+
|ID +
78+
(4 byte)
79+
7+|Error Code +
80+
(1 byte)
81+
82+
|Configuration
83+
|0x30
84+
|<Length> +
85+
(4 byte)
86+
|Kind +
87+
(1 byte)
88+
7+|_Dynamic Part_
89+
90+
|Status
91+
|0x40
92+
|:= 6 +
93+
(4 byte)
94+
8+|Status +
95+
(1 byte)
96+
97+
|Wakeup
98+
|0x41
99+
|:= 5 +
100+
(4 byte)
101+
8+|---
102+
103+
|====
104+
4105
===== Operations
5106
This section defines the allowed operations for LIN.
6107
The following tables provides an overview of all operations and specifies the position and length of the corresponding arguments, as well as the respective flow direction.
@@ -36,7 +137,7 @@ Depending on the simulation details, the Bus Simulation might response with a <<
36137
[cols="5,4,3,20"]
37138
|====
38139
h|Name 3+| Response
39-
h|Description 3+| Represents an operation for the transmission of a LIN response from a LIN slave to the LIN Master.
140+
h|Description 3+| Represents an operation for the transmission of a LIN response from a LIN Slave to the LIN Master.
40141
h|OP Code [hex] 3+| 0x11
41142
.7+h|Content h|Argument h|Length h|Description
42143
| OP Code | 1 byte | Contains the OP Code of the specified operation.
@@ -220,9 +321,9 @@ h|Behavior
220321
The operation shall not be routed to other Network FMUs by the Bus Simulation.
221322
A Network FMU shall ignored this operation on consumer side.
222323
The configuration shall be completed by a specified Network FMU before it produces any <<low-cut-lin-transmit-operation, Transmission operation>>.
223-
Any configuration can be repeated multiple times during the runtime of a Network FMU.
324+
The configuration must not be repeated multiple times during the runtime of a Network FMU.
325+
A Bus Simulation should stop as soon as more than one `LIN_MASTER` is configured in a network.
224326
If required configuration parameters are not adjusted by a Network FMU the Bus Simulation shall choose a default behavior by itself.
225-
For a smooth simulation, it must be ensured that exactly one master node is configured.
226327
|====
227328

228329
The following Kind values are allowed to be used:
@@ -264,12 +365,12 @@ h|Name
264365
h|Description
265366
3+|Represents an operation for status handling.
266367
h|OP Code [hex]
267-
3+|0x31
368+
3+|0x40
268369
.4+h|Content h|Argument h|Length h|Description
269370
|OP Code
270371
|1 byte
271372
|Contains the OP Code of the specified operation.
272-
For this operation the OP Code always has the value 0x31.
373+
For this operation the OP Code always has the value 0x40.
273374

274375
|Total Length
275376
|4 byte
@@ -302,7 +403,7 @@ h|Kind h|Value h|Description
302403
|SLEEP|0x04|Indicates that a simulated LIN controller within the Network FMU has currently the LIN node state: Sleep.
303404
|====
304405

305-
====== Wake-up [[low-cut-lin-wakeup-operation]]
406+
====== Wake Up [[low-cut-lin-wake-up-operation]]
306407
By using the `Wakeup operation` the underlying Bus Simulation can trigger a bus-specific wake up.
307408

308409
.Detailed description of the Wakeup operation.
@@ -314,12 +415,12 @@ h|Name
314415
h|Description
315416
3+|Represents an operation for triggering a bus-specific wake up.
316417
h|OP Code [hex]
317-
3+|0x32
418+
3+|0x41
318419
.3+h|Content h|Argument h|Length h|Description
319420
|OP Code
320421
|1 byte
321422
|Contains the OP Code of the specified operation.
322-
For this operation the OP Code always has the value 0x32.
423+
For this operation the OP Code always has the value 0x41.
323424

324425
|Total Length
325426
|4 byte
@@ -332,3 +433,39 @@ If a Network FMU does not support wake-up this operation can be ignored on consu
332433

333434
|====
334435

436+
===== Transmission and Reception
437+
#TODO#
438+
439+
===== Detection of Collisions
440+
#TODO#
441+
442+
===== Configuration of Bus Simulation
443+
The configuration of the Bus Simulation is done by the Network FMUs itself.
444+
For this purpose, the <<low-cut-lin-configuration-operation, Configuration operation>> provides several configuration parameters.
445+
<<low-cut-lin-configuration-operation, Configuration operations>> can be produced multiple times during the runtime of a Network FMU.
446+
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 <<low-cut-lin-transmit-operation, Transmit operations>>.
447+
448+
====== Baudrate Handling
449+
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.
450+
This baud rate information can be configured by using `LIN_BAUDRATE` configuration kind of the <<low-cut-lin-configuration-operation, Configuration operation>>.
451+
If the baud rate information is not adjusted by a specified Network FMU, the Bus Simulation shall choose a default behavior by itself.
452+
453+
====== Node Definition
454+
By using the `LIN_NODE_DEFINITION` configuration kind of a <<low-cut-lin-configuration-operation, Configuration operation>>, the specified node type `LIN_MASTER` or `LIN_SLAVE` needs to be adjusted.
455+
This configuration must be done before the first exchange of <<low-cut-lin-transmit-operation, Transmit operations>>.
456+
A Bus Simulation should stop as soon as more than one LIN Master is configured in a network.
457+
458+
===== Error Handling
459+
#TODO#
460+
461+
===== Wake Up/Sleep
462+
This standard supports wake up and sleep for the LIN bus, whereby only the bus-specific parts are taken into account.
463+
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.
464+
Because entering sleep state is a virtual ECU internal process always within LIN bus, this can be ignored.
465+
Also, the virtual ECU local wake-up process is ignored as well.
466+
The LIN-specific wake-up pulse can be simulated by using the <<low-cut-lin-wake-up-operation, Wakeup operation>>.
467+
A <<low-cut-lin-wake-up-operation, 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.
468+
469+
.Wake up initiated by FMU 1 wakes up FMU 2 and FMU 3 via bus.
470+
[#figure-lin-wake-up]
471+
image::lin_wake_up.svg[width=70%, align="center"]

docs/images/lin_wake_up.drawio

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<mxfile host="app.diagrams.net" modified="2023-02-15T12:32:01.101Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.41" etag="1NeC_8ngNpeCc3fMXIMg" version="20.8.20" type="device"><diagram id="kgpKYQtTHZ0yAKxKKP6v" name="Page-1">5Vhdc6IwFP01PMoEwoc+alvtTOvU3Xa36750UoiYioQJwWp//QYJ32i/3LXdMn3gnoQLnHMu91YFnizXI4bC+Zi62Fd04K4VeKroyaEkf8DdpICmGyngMeJKqACuyROWIJBoTFwcVTZySn1Owiro0CDADq9giDH6WN02o371riHycAO4dpDfRG+Jy+cp2jVBgZ9j4s2zO2tArixRtlkC0Ry59LEEwTMFnjBKeXq2XJ9gP+Eu4yW9brhjNX8whgP+kgtgEA+Ga9ZzNpcgDK5ub3Q06phplhXyY/nCCuwP4khg12QZ+4gTGsjn55uMFPEqYXIaL/1LMsM+CUQ0CDEjS8wxEyu+hCcFNhAScSSwZF3bxr6Pwojcb9MCgTDsxCwiK/wdR6kTtiiNAxe7Mspp3Aac0UUuTJK0yYokaoUZx+sSJFkaYSoekG3Elmy1KxWTlrVl+Fjor0GJzUva50oj6TkvT13IIk6kMq9QyWqqVJckpCTg2/uaA8U8rclBGZ9TjwbILwvyTmL3GurFbFtVsrstZLdwnQvwHq7xyInCJ6/zMKU/p1bwcAXBRUdrcg37w/EPgWlfrBBg7/lCAH+rEFrF0T9kIez10YvZNsyjFcLd+Tc6NX9THSFX3G/inW8uOvbuQmiy/n8XgqlpxyuEVnG6H7IQ9vro0xZCdrcS2bdogeOwQXnyjkTMjn2feIGA7inndCmowoHbT4bRBPOps3ieXMEp2/wSQQeoGrAzZJpcoBqakQGna5kijTblqKTsFtxZCditDME7lRHPYgBbDvAMJ9Phqjont5Ev000SPxa5dKOnVoUWElaTRDRmDpbXlSfbWirTNNQeBPmh1dLqareamCPmYb4ncbaRzmYR5g0H5cy8w1S9Y5pKUzWr5ikx9r7FU1GIHBJ4IjIO4TCgAgi7Vf0OYjcDGjW7aXb3bXYT7UC1rF5xWPW8KoSlZfuY5jPRBNyFN8Ox/TDlN+O7kCzO9s248Iu1dgsesbW3ivMxZ9y9PvoMrb31BeCxO3v1G2zD3kH7evqped5rr+j/pm2Zh+n/ZvWfS92w3vY5tmxbNfTic1vrHob5T7u/CIuf9NLtxe+i8OwP</diagram></mxfile>

docs/images/lin_wake_up.svg

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)