You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/4_4_2_lin.adoc
+145-8Lines changed: 145 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,107 @@
1
1
==== LIN
2
2
This chapter describes the <<low-cut-layered-standard-bus-protocol, Layered Standard Bus Protocol>> for LIN.
3
3
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
+
4
105
===== Operations
5
106
This section defines the allowed operations for LIN.
6
107
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 <<
36
137
[cols="5,4,3,20"]
37
138
|====
38
139
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.
40
141
h|OP Code [hex] 3+| 0x11
41
142
.7+h|Content h|Argument h|Length h|Description
42
143
| OP Code | 1 byte | Contains the OP Code of the specified operation.
@@ -220,9 +321,9 @@ h|Behavior
220
321
The operation shall not be routed to other Network FMUs by the Bus Simulation.
221
322
A Network FMU shall ignored this operation on consumer side.
222
323
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.
224
326
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.
226
327
|====
227
328
228
329
The following Kind values are allowed to be used:
@@ -264,12 +365,12 @@ h|Name
264
365
h|Description
265
366
3+|Represents an operation for status handling.
266
367
h|OP Code [hex]
267
-
3+|0x31
368
+
3+|0x40
268
369
.4+h|Content h|Argument h|Length h|Description
269
370
|OP Code
270
371
|1 byte
271
372
|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.
273
374
274
375
|Total Length
275
376
|4 byte
@@ -302,7 +403,7 @@ h|Kind h|Value h|Description
302
403
|SLEEP|0x04|Indicates that a simulated LIN controller within the Network FMU has currently the LIN node state: Sleep.
303
404
|====
304
405
305
-
====== Wake-up [[low-cut-lin-wakeup-operation]]
406
+
====== Wake Up [[low-cut-lin-wake-up-operation]]
306
407
By using the `Wakeup operation` the underlying Bus Simulation can trigger a bus-specific wake up.
307
408
308
409
.Detailed description of the Wakeup operation.
@@ -314,12 +415,12 @@ h|Name
314
415
h|Description
315
416
3+|Represents an operation for triggering a bus-specific wake up.
316
417
h|OP Code [hex]
317
-
3+|0x32
418
+
3+|0x41
318
419
.3+h|Content h|Argument h|Length h|Description
319
420
|OP Code
320
421
|1 byte
321
422
|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.
323
424
324
425
|Total Length
325
426
|4 byte
@@ -332,3 +433,39 @@ If a Network FMU does not support wake-up this operation can be ignored on consu
332
433
333
434
|====
334
435
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.
0 commit comments