LIN Specification Package Revision 2.1
LIN Specification Package Revision 2.1
LIN Specification Package Revision 2.1
Revision 2.1
November 24, 2006; Page 1
LIN
REVISION HISTORY
Issue Date Remark
LIN 1.0 1999-07-01 Initial Version of the LIN Specification
LIN 1.1 2000-03-06
LIN 1.2 2000-11-17
LIN 1.3 2002-12-13
LIN 2.0 2003-09-16 Major Revision Step
Clarifications, configuration modified, transport layer
LIN 2.1 2006-11-24
enhanced and diagnostics added.
TABLE OF CONTENTS
Specification Package
1.1 LIN ....................................................................................................10
1.1.1 Scope ...........................................................................................10
1.1.2 Features and possibilities .............................................................10
1.1.3 Work flow concept ........................................................................11
1.1.4 Node concept ...............................................................................12
1.1.5 Concept of operation ....................................................................12
1.1.5.1 Master and slave ..........................................................................12
1.1.5.2 Frames .........................................................................................13
1.1.5.3 Data transport...............................................................................13
1.1.5.4 Schedule table..............................................................................14
1.1.6 Document overview ......................................................................14
Protocol Specification
2.1 Introduction .......................................................................................24
2.2 Signal Management ..........................................................................25
2.2.1 Signal types ..................................................................................25
2.2.2 Signal consistency........................................................................25
2.2.3 Signal packing ..............................................................................25
2.2.4 Signal reception and transmission................................................26
2.3 Frame Transfer .................................................................................28
2.3.1 Frame structure ............................................................................28
2.3.1.1 Break field.....................................................................................29
2.3.1.2 Sync byte field ..............................................................................29
2.3.1.3 Protected identifier field ................................................................30
2.3.1.4 Data ..............................................................................................30
2.3.1.5 Checksum.....................................................................................31
2.3.2 Frame length ................................................................................31
2.3.3 Frame types..................................................................................32
2.3.3.1 Unconditional frame......................................................................32
2.3.3.2 Event triggered frame ...................................................................32
Diagnostic specification
5.1 Introduction .......................................................................................78
5.1.1 using the transport layer ...............................................................78
5.1.2 LIN master ....................................................................................79
5.1.3 slave nodes ..................................................................................79
5.2 Diagnostic classes ............................................................................80
5.2.1 Diagnostic Class I.........................................................................80
5.2.1.1 Transport protocol ........................................................................80
5.2.1.2 Diagnostic services.......................................................................80
5.2.2 Diagnostic Class II........................................................................80
5.2.2.1 Transport protocol ........................................................................80
5.2.2.2 Diagnostic services.......................................................................81
5.2.3 Diagnostic Class III.......................................................................81
5.2.3.1 Addressing....................................................................................81
1.1 LIN
LIN (Local Interconnect Network) is a concept for low cost automotive networks, which
complements the existing portfolio of automotive multiplex networks. LIN will be the
enabling factor for the implementation of a hierarchical vehicle network in order to
gain further quality enhancement and cost reduction of vehicles. The standardization
will reduce the manifold of existing low-end multiplex solutions and will cut the cost of
development, production, service, and logistics in vehicle electronics.
1.1.1 SCOPE
The LIN standard includes the specification of the transmission protocol, the transmis-
sion medium, the interface between development tools, and the interfaces for soft-
ware programming. LIN promotes the interoperability of network nodes from the
viewpoint of hardware and software and a predictable EMC behavior.
LIN provides a cost efficient bus communication where the bandwidth and versatility
of CAN are not required. The specification of the line driver/receiver is based on the
ISO 9141 standard [1] with some enhancements regarding the EMI behavior.
LIN
The slave nodes are connected to the master node forming a LIN cluster. The corre-
sponding node capability files are parsed by the LIN cluster design tool to generate a
LIN description file (LDF) in the LIN cluster design process. The LDF is parsed by the
LIN cluster generator to automatically generate LIN related functions in the desired
nodes (the Master node and Slave3 node in the example shown in the picture above).
The LDF is also used by a LIN bus analyzer/emulator tool to allow for cluster debug-
ging.
Application
Protocol
Frame handler
Physical
LIN bus line
LIN bus
The master task decides when and which frame shall be transferred on the bus. The
slave tasks provide the data transported by each frame.
Both the master task and the slave task are parts of the Frame handler, see
Section 1.1.4.
1.1.5.2 Frames
A frame consists of a header (provided by the master task) and a response (provided
by a slave task).
The header consists of a break field and sync field followed by a frame identifier. The
frame identifier uniquely defines the purpose of the frame. The slave task appointed
for providing the response associated with the frame identifier transmits it, as depicted
below. The response consists of a data field and a checksum field.
The slave tasks interested in the data associated with the frame identifier receives the
response, verifies the checksum and uses the data transported.
The LIN 2.0 represents an evolutionary growth from its predecessor, LIN 1.3. Nodes
designed for LIN 2.0 and LIN 1.3 will communicate with each other with a few excep-
tions, as described in Section 1.1.7.1.
At the same time, the LIN 2.0 specification was completely reworked and areas where
problems have been found were clarified and, when needed, reworked.
LIN 2.0 was an adjustment of the LIN specification to reflect the latest trends identi-
fied; especially the use of off-the-shelves slave nodes. Three years of experience with
LIN and inputs from the SAE J2602 Task Force have contributed to this major revi-
sion. LIN 2.0 also incorporates new features, mainly standardized support for configu-
ration/diagnostics and specified node capability files, both targeted at simplifying use
of off-the-shelves slave nodes.
Practical experience with LIN 2.0 has led to some findings in the specification. At the
start of the work to update to LIN 2.1 it was decided that backwards compatibility is a
1.1.8 REFERENCES
[2] LIN Slave Node Position Detection - Implementation Note, version 1.0
[3] “Road vehicles - Diagnostics on Controller Area Network (CAN) - Part 2: Network
layer services“, International Standard ISO 15765-2.4, Issue 4, 2002-06-21
[4] “Road vehicles - Diagnostics on controller area network (CAN) - Part 3: Imple-
mentation of diagnostic services”, International Standard ISO 15765-3.5, Issue
5, 2002-12-12.
diagnostic frame The collective name for the master request frame and the
slave response frame. Section 2.3.3.4.
DTC Diagnostic Trouble Code. Diagnostic specification.
enhanced checksum The checksum model used in the LIN specification ver-
sions starting from LIN 2.0 for all frames, except the diag-
nostic frames. The enhanced checksum includes the PID
and the data bytes. Section 2.3.1.5.
event triggered frame An event triggered frame is used to allow multiple slave
nodes to provide their response to the same header. This
is useful when the signals in slave nodes involved are
changed sporadically. Section 2.3.3.2.
frame All information is transmitted packed as frames; a frame
consist of the header and a response. Section 1.1.5.2.
master task The master task is responsible for sending all headers on
the bus, i.e. it controls the timing and schedule table for
the bus. Section 2.5.1.
NAD Node Address for slave nodes. Diagnostic frames are
broadcasted and the NAD specifies the addressed, respec-
tively responding slave node. The NAD is the address of a
logical node. Section 4.2.3.2.
node Loosely speaking, a node is an ECU (electronic control
unit). However, a single ECU may be connected to multiple
LIN clusters; in the latter case the term node should be
replaced with bus interface. A physical slave node may be
composed of one or more logical nodes.
Node Capability File A NCF describes a slave node as seen from the LIN bus.
slave node A node that contains a slave task only, i.e. it does not con-
tain a master task.
slave response frame The slave response frame has frame identifier 61 (0x3D)
and is used for diagnostic frames issued by one of the
slave nodes. Section 2.3.3.4.
slave task The slave task is responsible for listening to all headers on
the bus and react accordingly, i.e. either publish a frame
response or subscribe to it (or ignore it).
signal A signal is a value or byte array transported in the cluster
using a signal carrying frame. Section 2.2.
signal carrying frame A frame that carries signals shall have an frame identifier
in the range 0 (zero) to 59 (0x3B). Unconditional frames,
sporadic frames and event triggered frames are signal
LIN
2.1 INTRODUCTION
The protocol specification describes the behavior on the bus (e.g. frame transporta-
tion) and in the nodes (e.g. status management).
The scope is covering one LIN bus and its LIN nodes. A node (normally a master
node) that is connected to more than one LIN bus must be handled by higher layers
(e.g. the application).
time
time base tick
time base time base
A signal is considered transmitted (latest point in time when the application may write
to the signal) as follows (see also Figure 2.2):
• Master node - before the frame transmission is initiated.
• Slave node - when the ID for the frame is received.
Master: Latest point the application Slave: Latest point the application
can update the signal can update the signal
time
time base tick
time base time base
Frame
Header Response
Response space
Each byte field, except the break field, is transmitted as the byte field shown in Figure
2.4. The LSB of the data is sent first and the MSB last. The start bit is encoded as a bit
with value zero (dominant) and the stop bit is encoded as a bit with value one (reces-
sive).
Byte field
Break
Break
delimiter
Figure 2.5: The break field
Start Stop
bit bit
Figure 2.6: The sync byte field.
A slave task shall always be able to detect the break/sync field sequence, even if it
expects a byte field (assuming the byte fields are separated from each other). A
desired, but not required, feature is to detect the break/sync field sequence even if the
break is partially superimposed with a data byte. When a break/sync field sequence
happens, the transfer in progress shall be aborted and processing of the new frame
shall commence.
Start Stop
ID0 ID1 ID2 ID3 ID4 ID5 P0 P1
bit bit
Figure 2.7: Mapping of frame identifier and parity to the protected identifier byte field.
2.3.1.4 Data
A frame carries between one and eight bytes of data. The number of data contained in
a frame with a specific frame identifier shall be agreed by the publisher and all sub-
scribers. A data byte is transmitted as part of a byte field, see Figure 2.4.
For data entities longer than one byte, the entity LSB is contained in the byte sent first
and the entity MSB in the byte sent last (little-endian). The data fields are labeled data
1, data 2,... up to maximum data 8, see Figure 2.8.
Figure 2.8: Numbering of the data bytes in a frame with eight data bytes.
2.3.1.5 Checksum
The last field of a frame is the checksum. The checksum contains the inverted eight
bit sum with carry over all data bytes or all data bytes and the protected identifier.
Checksum calculation over the data bytes only is called classic checksum and it is
used for the master request frame, slave response frame and communication with LIN
1.x slaves.
Eight bit sum with carry is equivalent to sum all values and subtract 255 every time the
sum is greater or equal to 256. See section 2.8.3 for examples how to calculate the
checksum.
Checksum calculation over the data bytes and the protected identifier byte is called
enhanced checksum and it is used for communication with LIN 2.x slaves.
The checksum is transmitted in a byte field, see Figure 2.4.
All subscribing nodes shall be able to receive a frame that has a zero overhead, i.e.
that is TFrame_Nominal long.
Tools and tests shall check the TFrame_Maximum. Nodes shall not check this time. The
receiving node of the frame shall accept the frame up to the next frame slot (i.e. next
break field), even if it is longer then TFrame_Maximum.
All subscribers of the event triggered frame shall receive the frame and use its data (if
the checksum is validated) as if the associated unconditional frame was received.
If the unconditional frame associated with an event triggered frame is scheduled as an
unconditional frame the response shall always be transmitted (i.e. behave as a sched-
uled unconditional frame).
Uncoditional frames associated with the event triggered frame
Event triggered frames carry the response of one or more unconditional frames.
The unconditional frames associated with an event triggered frame shall:
• Have equal length.
• Use the same checksum model (i.e. mixing LIN 1.x and LIN 2.x frames is not
allowed).
• Reserve the first data field to its protected identifier (even if the associated
At least all the associated unconditional frames shall be listed in this collision resolv-
ing schedule table. The collision resolving schedule may contain other unconditional
frames than the associated frames. These other unconditional frames may be of dif-
ferent length.
After the collision schedule table has been processed once, the driver in the master
node shall switch back to the previous schedule table. It shall continue with the sched-
ule entry subsequent to the schedule entry where the collision occurred (or first
schedule entry in case the collision occurred in the last entry).
If one of the colliding slave nodes withdraws without corrupting the transfer, the mas-
ter node will not detect this. A slave node that has withdrawn its response must there-
fore retry transmitting its response until successful, otherwise the response will be
lost.
In case the master node application switches the schedule table before the collision is
Example 1
A schedule table contains only one event-triggered frame (ID=0x10). The event-trig-
gered frame is associated with two unconditional frames from slave 1 (ID=0x11) and
slave 2 (ID=0x12). The collision resolving schedule table contains the two uncondi-
tional frames. See Figure 2.10 for the behavior on the bus.
ID=0x11
Frame from slave 1 is requested
ID=0x10
One of the slave nodes has a new response
Example 2
A typical use for the event triggered frame is to monitor the door knobs in a four door
central locking system. By using an event triggered frame to poll all four doors the sys-
tem shows good response times, while still minimizing the bus load. In the rare occa-
sion that multiple passengers press a knob each, the system will not lose any of the
pushes, but it will take some additional time.
itized (see below) frame will be transmitted. The candidate frames not transmitted will
not be lost. They will be candidates to be transmitted every time the sporadic frame is
due, as long as they have not been transmitted.
If the unconditional frame was successfully transmitted, the unconditional frame shall
no longer be pending for transmission until a signal is updated in the unconditional
frame again.
Normally multiple sporadic frames are associated with the same frame slot, the most
prioritized of the pending unconditional frames shall be transmitted in the frame slot. If
none of the unconditional frames is pending for transmission the frame slot shall be
silent. How the sporadic frames are prioritized is described in Configuration Language
Specification, section 9.2.4.2.
The master node is the only publisher of the uncoditional frames in a sporadic frame.
Therefore only the master task knows when an unconditional frame is pending for
Master Slave
Master has nothing to send
Something happens that
updates a signal in frame ID=0x22 The associated frame 0x22 has an updated signal and
0x22 is sent by the master
An unconditional frame associated with a sporadic frame may not be allocated in the
same schedule table as the sporadic frame.
Before transmitting a master request frame, the master task queries its diagnostic
module if it shall be transmitted or if the bus shall be silent. A slave response frame
header shall be sent unconditionally.
The slave tasks publish and subscribe to the response according to their diagnostic
modules.
TFrame_Slot
Idle
unique in the whole LIN communication and provides enough information for any
slave task to detect the beginning of a new frame and to be synchronized at the start
of the identifier field.
Idle
Activ e
Rx checksum Tx checksum
Checksum
Readback
Checksum valid i nvali d or
correct
fram ing error Readback not
/Error correct
Success
Error and Success refers to the status management described in section 2.7.
The last frame response too short means that the last frame contained at least one
field (correct data byte or even framing error) in the response. This is to distinguish
between error in response and no response.
A mismatch between readback and sent data shall be detected not later than after
completion of the byte field containing the mismatch. When a mismatch is detected,
the transmission shall be aborted.
2.6.2 WAKE UP
Any node in a sleeping LIN cluster may request a wake up, by transmitting a wake up
signal. The wake up signal is issued by forcing the bus to the dominant state for 250
µs to 5 ms. The master node may issue a break field, e.g. by issuing an ordinary
header since the break will act as a wake up signal (in this case the master must be
aware of that this frame may not be processed by the slave nodes since they may not
yet awake and ready to listen to headers).
Every slave node (connected to power) shall detect the wake up signal (a dominant
pulse longer than 150 µs) and be ready to listen to bus commands within 100 ms,
measured from the ending edge of the dominant pulse, see Figure 2.16. A detection
threshold of 150 µs combined with a 250 µs pulse generation gives a detection margin
that is enough for uncalibrated slave nodes. If the node that transmitted the wake up
signal is a slave node, it will be ready to receive or transmit frames immediately. The
master node shall also wake up and, when the slave nodes are ready, start transmit-
If the master node does not transmit a break field (i.e. starts to transmit a frame) or if
the node issuing the wake up signal does not receive a wake up signal (from another
node) within 150 ms to 250 ms from the wake up signal, the node issuing the wake up
signal shall transmit a new wake up signal, see Figure 2.17. In case the slave node
transmits a wake up signal in the same time as the master node transmits a break
field, the slave shall receive and recognize this break field.
After three (failing) requests the node shall wait minimum 1.5 seconds before issuing
a fourth wake up signal. The reason for this longer duration is to allow the cluster to
communicate in case the waking slave node has problems, e.g. if the slave node has
problems with reading the bus it will probably retransmit the wake up signal infinitely.
There is no restriction of how many times a slave may transmit the wake up signal.
However, it is recommended that a slave node transmits not more than one block of
three wake up signals for each wake up condition. The Figure 2.18 shows how wake
up signals are transmitted over a longer time .
2.6.3 GO TO SLEEP
The master sets the cluster into bus sleep mode by transmitting a go to sleep com-
mand. The request will not necessarily enforce the slave nodes into a low-power
mode. The slave node application may still be active after the go to sleep command
has been received. This behavior is application specific.
The go to sleep command is a master request frame with the first data field set to 0
and rest set to 0xFF, see Table 2.1. The slave nodes shall ignore the data fields 2 to 8
and interpret only the first data field.
data1 data2 data3 data4 data5 data6 data7 data8
0 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
Note 1: LIN transceivers normally have filters to remove short spikes on the bus. The transition
here refers to the signal after this filter.
2.7.1 CONCEPT
Central cluster status management is made in the master node. The master node
monitors status reports from each node and filters/integrates the reports to conclude if
Based on this single bit the master node can make the conclusions as presented in
Table 2.2:
response_error Interpretation
false the slave node is operating correctly
true the slave node has intermittent problems
The slave node did not the slave node, bus or master node has serious
answer problems
2.8 APPENDICES
2.8.1 TABLE OF NUMERICAL PROPERTIES
Property Min Max Unit Reference
Scalar signal size 1 16 bit section 2.2.1
Byte array size 1 8 byte section 2.2.1
Break field length (dominant + delimiter) 14 Tbit section 2.3.1.1
Break detect threshold 11 11 Tbit section 2.3.1.1
Wake up signal duration 0.25 5 ms section 2.6.2
Slave initialize time 100 ms section 2.6.2
Silence period between wake up signals 150 250 ms section 2.6.2
Silence period after three wake up signals 1.5 s section 2.6.2
+0x55 = 0x9F 0 1 0 0 1 1 1 1 1
(Add Carry) 0x9F 1 0 0 1 1 1 1 1
+0x93 = 0x132 1 0 0 1 1 0 0 1 0
Add Carry 0x33 0 0 1 1 0 0 1 1
+0xE5 = 0x118 1 0 0 0 1 1 0 0 0
Invert 0xE6 1 1 1 0 0 1 1 0
0x19+0xE6 = 0xFF 1 1 1 1 1 1 1 1
Mathematical symbols
The following mathematical symbols and notations are used in this standard:
f ∈S Belongs to. True if f is in the set S.
a⊕b Exclusive or. True if exactly one of a or b is true.
¬a Negate. True if a is false.
LIN
3.1 INTRODUCTION
The transport layer defines transportation of data that is contained in one or more
frames.
The transport layer messages are transported by diagnostic frames as specified in the
Protocol Specification. A standardized API for the transport layer is specified in the
Application Program Interface Specification.
Master
LIN cluster
Slave1 Slave2
Figure 3.1: Typical system setup for a LIN cluster using the transport layer.
Flow control [3] is not used in LIN clusters. If the back-bone bus test equipment needs
flow control PDUs, these must be generated by the master node on the back-bone
side.
3.2.1.1 Overview
To simplify conversion between ISO transport layer frames [3] and LIN transport layer
frames a very similar structure is defined, which support the PDU types shown in Fig-
ure 3.2. The left byte (NAD) is sent first and the right byte (D4, D5 or D6) is sent last.
Request
NAD PCI LEN SID D1 D2 D3 D4 PCI-type = FF
Requests are always sent in master request frames and responses are always sent in
slave response frames. The meaning of each byte in the PDUs is defined in the fol-
lowing sections.
3.2.1.2 NAD
The NAD is defined in Section 4.2.3.2.
3.2.1.3 PCI
The PCI (Protocol Control Information) contains the transport layer flow control infor-
mation. Three interpretations of the PCI byte exist, as defined in Table 3.1.
The PCI type Single Frame (SF) indicates that the transported message fits into the
single PDU, i.e. it contains at maximum five data bytes. The length shall then be set to
the number of used data bytes plus one (for the SID or RSID).
The PCI type First Frame (FF) is used to indicate the start of a multi PDU message;
the following frames are of CF type, see below. The total number of data bytes in the
message plus one (for the SID or RSID) shall be transmitted as Length: The four most
significant bits of Length is transmitted in the PCI byte (the eight least significant bits
are sent in LEN, see below).
A multi-PDU message is continued with a number of Consecutive Frames (CF). The
first CF frame of a message is numbered 1, the second 2 and so on. If more than 15
CF PDUs are needed to transport the complete message, the frame counter wraps
around and continues with 0, 1,...
3.2.1.4 LEN
3.2.1.5 SID
The Service Identifier (SID) specifies the request that shall be performed by the slave
node addressed. 0 to 0xAF and 0xB8 to 0xFE are used for diagnostics while 0xB0 to
0xB7 are used for node configuration.
The Response Service Identifier (RSID) specifies the contents of the response.
3.2.1.6 D1 to D6
The interpretation of the data bytes (up to six in a single PDU) depends on the SID or
RSID. In multi-PDU messages, all the bytes in all PDUs of the message shall be con-
catenated into a complete message, before being parsed.
If a PDU is not completely filled (applies to CF and SF PDUs only) the unused bytes
shall be filled with ones, i.e. their value shall be 255 (0xFF).
3.2.2 COMMUNICATION
It is required that a transport layer message is exclusive on one bus. This means that
only one message can be active at one time.
If a node is receives a message with a NAD equal to the node’s own NAD or the
broadcast NAD and no other message is active the message shall be received and
processed.
Timeout values are defined to be higher than the values for the performance require-
ments to ensure a working system and to overcome communication conditions where
the performance requirement can absolutely not be met (e.g. high bus load). Specified
timeout values in Table 3.2 or values given by the node (i.e. the NCF) shall be treated
as the upper limit for any given implementation.
Figure 3.3 and Figure 3.4 illustrates the parameters in the time domain. The intention
of the figures is to show the transport layer timing parameters, not to require a certain
implementation. The behavior for the master node and the slave node in the lower lay-
ers are generalized.
Request transmission
of diagnostic frame (FF or CF)
Diagnostic frame
(MRF or SRF)
frame received
diagnostic frame (FF or CF)
reception indication
LIN
4.1 INTRODUCTION
The node configuration and identification services define how a slave node is config-
ured, and identifying a slave node using the identification service.
The node configuration and identification services are transported by the transport
layer as specified in the Transport Layer Specification. A standardized API for the
node configuration and identification is specified in the Application Program Interface
Specification.
D1 D2 D3 D4 D5
Supplier ID Supplier ID Function ID Function ID
D1 D2 D3 D4
LSB ... ... MSB
4.2.1.1 Wildcards
To be able to leave some information unspecified the wildcard values in Table 4.3
may be used in node configuration requests. All slave nodes shall understand the
wildcards in requests.
Configuration from
master node, over the bus
Figure 4.1: Slave node memory model.
VRAM (Volatile RAM) is considered a memory that is not valid after reset. The
NVRAM (Non-Volatile RAM) is memory that is maintained after reset and can be mod-
ified with internal processes (e.g. the application). ROM (Read Only Memory) is con-
sidered as constant memory that cannot be modified with internal processes (e.g.
application).
A slave node has a fixed LIN Product Identification, see Section 4.2.1. The serial num-
ber is optional.
Instance generation
Initial NAD
Configured NAD
Assign NAD
Figure 4.2: NAD instantiation and configuration process
4.2.3.1 Overview
Requests are always sent in master request frames and responses are always sent in
slave response frames. The meaning of each byte in the PDUs is defined in the fol-
lowing sections.
4.2.3.2 NAD
NAD is the address of the slave node being addressed in a request, i.e. only slave
nodes have an address. NAD is also used to indicate the source of a response.
NAD values are in the range 1 to 127 (0x7F), while 0 (zero) and 128 (0x80) to 255
(0xFF) are reserved for other purposes:
4.2.3.3 PCI
The PCI (Protocol Control Information) contains the transport layer flow control infor-
mation. For node configuration, one interpretation of the PCI byte exist, as defined in
Table 4.5.
The PCI type Single Frame (SF) indicates that the transported message fits into the
single PDU, i.e. it contains at maximum five data bytes. The length shall then be set to
the number of used data bytes plus one (for the SID or RSID).
4.2.3.4 SID
The Service Identifier (SID) specifies the request that shall be performed by the slave
node addressed. This SID numbering is consistent with ISO 15765-3 [4] and places
node configuration (0xB0 to 0xB7) in an area “Defined by vehicle manufacturer”.
The following Table 4.6 shows what SIDs are used:
4.2.3.5 RSID
The Response Service Identifier (RSID) specifies the contents of the response. The
RSID for a positive response is always SID + 0x40.
If the service is supported in the slave node the response is mandatory (even if the
request is broadcast). The support of a specific service will be listed in the NCF, see
Node Capability Language Specification.
A slave shall process the configuration request immediately and be able to respond in
the next schedule slave response frame (t_sep_min and t_resp_min, see Section 5.6,
are not used for node configuration).
4.2.3.6 D1 to D5
The interpretation of the data bytes (up to five in a node configuration PDU) depends
on the SID or RSID.
If a PDU is not completely filled the unused bytes shall be recessive, i.e. their value
shall be 255 (0xFF). This is necessary since a diagnostic frame is always eight bytes
long.
Example 1
A slave node has five frames {power_status, IO_1, IO_2, IO_3, IO_4}. The master
node application will setup a assign frame id request with the parameters: start index
set to 1 and PID (index 1..4) set to {0x80, 0xC1, 0x42, 0x0}. When the slave node
receives the request it will set the PIDs to {IO_1=0x80, IO_2=0xC1, IO_3=0x42,
IO_4=unassigned}. Note that the power_status frame will not be affected. The slave
will respond with a positive response if requested.
Example 2
A slave node has only two frames {status_frame, response_frame}. To assign PIDs to
these two frames the master application will setup the following request: start index
set to 0 and PID (index 0..3) set to {0xC4, 0x85, 0xFF, 0xFF}. Since the slave node
has only two frames the last two must be set to do not care, otherwise the request will
fail.
4.2.6 IDENTIFICATION
Support of identifier 0 (zero) is the only mandatory identifier, i.e. the serial number is
optional.
If the slave successfully processed the request it will respond according to Table 4.20.
Each row represents one possible response.
Id NAD PCI RSID D1 D2 D3 D4 D5
Function ID
0 NAD 0x06 0xF2 Supplier ID LSB Supplier ID MSB Function ID LSB Variant
MSB
1 NAD 0x05 0xF2 Serial 0, LSB Serial 1 Serial 2 Serial 3, MSB 0xFF
32-
NAD 0x05 0xF2 user defined user defined user defined user defined user defined
63
If the slave is not supporting this request or could not process the request it will
respond according to Table 4.21.
NAD PCI RSID D1 D2 Unused
Requested SID Error code
NAD 0x03 0x7F 0xFF 0xFF 0xFF
(= 0xB2) (= 0x12)
LIN
5.1 INTRODUCTION
The LIN diagnostics defines methods to implement diagnostic data transfer between a
master node, respectively a diagnostic tester, and the slave nodes.
Three different classes of diagnostic nodes are defined. Class I is using normal signal-
ling and class II and class III uses the transport layer, see Transport Layer Specifica-
tion.
ID=0x3D
Diagnostic response Diagnostic response (gatewayed to CAN)
ID=0x3D
Header, but no response from slave
5.2.3.1 Addressing
Class III slave nodes require a unique NAD in the cluster.
UDS ser-
Slave Diagnostic Class I II III vice index
[Hex]
Diagnostic Transport Protocol Requirements
Single frame transport only +
Full transport protocol (multi-segment) + +
Required Configuration Services
Assign frame identifier range + + + 0xB7
Read by identifier (0 = product id) + + + 0xB2 0x00
Read by identifier (all others) optional optional + 0xB2 0xXX
Assign NAD optional optional optional 0xB0
Conditional change NAD optional optional optional 0xB3
Positive response on service +
+ + +
supported configuration services 0x40
Required UDS Services
Read data by identifier: 0x22
- hardware and software version + + 0x22
- hardware part number (OEM specific) + + 0x22
- diagnostic version + + 0x22
Read by identifier (parameters) + + 0x22
Write by identifier (parameters) if applicable if applicable 0x2E
UDS ser-
Slave Diagnostic Class I II III vice index
[Hex]
Session control + 0x10
Read by identifier (sensor and actuator data) + 0x22
I/O control by identifier + 0x2F
Read and clear DTC (fault memory) + 0x19, 0x14
Routine control if applicable 0x31
Other diagnostic services if applicable ...
Flash Reprogramming Services
Flash programming services optional 0xXX
Description
no test result available, default, initialization value
test result: failed
test result: passed
If a slave node implements more than one independent function, a status signal can
be assigned to each function. In this case only the failing function could be disabled by
the application.
The fault state signals are set in the NCF, status management clausal, see
Section 8.2.6.
The transport layer defines a special functional NAD (0x7E) that is used to broadcast
diagnostic requests. The broadcast NAD (0x7F) is normally not used in diagnostics,
since there will be collisions if the master requests responses. If used anyway, the
behavior will be the same as if a request with the slave node’s own NAD was received
(i.e. same behavior as for the configuration).
The diagnostic master request schedule table shall be executed whenever a master
request frame shall be transmitted (see Figure 5.4). Note that by insertion of an exe-
cution of the diagnostic master request schedule table the overall timing of the normal
communication schedule is affected.
Normal communication
schedule
Normal communication
schedule
Normal communication
schedule
Normal communication
schedule
Normal communication
schedule
Normal communication
schedule
Normal communication
schedule
.
Normal communication
schedule
Normal communication
schedule
The number of executions of the diagnostic master request schedule table depends
on the amount of data that needs to be transmitted and shall be determined by the
master node considering the LIN transport protocol (e.g. Two executions of the sched-
ule for transmitting 10 user data bytes using the LIN transport protocol).
The subsequent interleaved execution of the diagnostic slave response schedule
table depends on the amount of data to be transferred and shall therefore be per-
formed by the master node until the transmission has been successfully finished or a
transport protocol timeout occurs.
If a diagnostic transmission from a slave node to the master node has been started,
the master node shall keep executing the diagnostic slave response schedule even
when one or several slave response frame headers have not been answered (see
Figure 5.8) until:
• A P2max / P2*max timeout occurs, see Section 5.6.
• A transport protocol timeout occurs, see Section 3.2.5
External
test tool Master Slave
Active schedule table
Diagnostic request
to slave node ID=0x3C Diagnostic master request
Master request frame
schedule
Normal communication
schedule
ID=0x3D
Slave response frame Diagnostic slave response
without response schedule
Normal communication
CAN schedule
ID=0x3D
Normal communication
schedule
ID=0x3D
Slave response frame Diagnostic slave response
with response (SF) schedule
Diagnostic response
Figure 5.8: Continued execution of diagnostic slave response schedule table until
response is received
. . .
The diagnostics only mode shall be enabled and disabled via diagnostic service
request from external test tool (e.g. service "Communication Control" in UDS to dis-
able normal communication on the LIN cluster will lead to the activation of the Diag-
nostics Only Mode). When operating in the diagnostics only mode without any active
transmission the master node shall execute diagnostic slave response schedule
tables (see Figure 5.10).
This is the state in which the master node routes a functional addressed request
from the back-bone bus to the LIN cluster while a transmission to a slave node is
currently active. Functional addressed Single Frames (SF) can be transmitted,
but shall be ignored by the active slave node while receiving a physically
addressed transmission.
• Interleaved functional during Rx
In this state the master node routes a functional addressed request from the
back-bone bus to the cluster while a reception from a slave node is currently
active. Functional addressed Single Frames (SF) can be transmitted, but shall
be ignored by the active slave node while transmitting the physically addressed
response.
Tx functional activ e
Idle
(2) (10)
(1) (14)
Tx physical Rx physical
(3) (6) (7)
Interleav ed Tx Interleav ed
functional during Tx functional during Rx
physical physical
Receiv e functional
request
Idle
(10)
A timing sequence chart of the diagnostic communication is shown in Figure 5.13. The
tester tool is shown only as an example.
ID=0x3C
STmin
CF
ID=0x3C
CF ID=0x3D
STmin
ID=0x3D
CF
Figure 5.13: Timing sequence chart of the diagnostic communication from the tester
to LIN via a back-bone bus.
LIN
6.1 INTRODUCTION
In Revision 2.0 of the LIN Physical Layer Specification the receiver specification has
been left unchanged. Just the LIN transmitter specification has been modified in order
to provide higher transmission reliability compared to older LIN physical layer specifi-
cation versions (e.g. Rev. 1.3).
The LIN physical layer of this revision is technically identical to Revision 2.0. Only
ambiguous and incorrect specifications have been clarified and missing specifications
have been added.
• A chapter about the physical layer compatibility has been added.
• The ambiguous term "clock tolerance" has been changed into "bit rate
tolerance".
• The constraint for slave-to-slave communication has been clarified.
Table 6.2: Slave node bit rate tolerance relative to master node bit rate
start 0 1 2 3 4 5 6 7 stop
bit bit
It is recommended to measure the time between the falling edges of both, the start bit
and bit 7, and to divide the obtained value by 8. For the division by 8 it is recom-
mended to shift the binary timer value by three positions towards LSB, and to use the
first insignificant bit to round the result
After the byte field synchronization on the falling edge of the start bit the start bit itself
shall be sampled within the window between the earliest bit sample (EBS) time tEBS
and the latest bit sample (LBS) time tLBS. The latest bit sample time tLBS depends on
the accuracy of the byte field synchronization tBFS. The dependency between tLBS and
tBFS is given in following equation:
tLBS = 10/16 TBIT - tBFS (11)
The following bits shall be sampled within the same range as the sample window of
the start bit with the sample window repetition time tSR respectively. The sample win-
dow repetition time tSR is specified from the EBS of the former bit (n-1) to the EBS of
the current bit:
tSR = tEBS(n) - tEBS(n-1) = tLBS(n) - tLBS(n-1) = TBIT (12)
UART/SCI
tBFS tEBS tLBS = 10/16 TBIT - tBFS
cycles per TBIT
16 1/16 TBIT 7/16 TBIT 9/16 TBIT
8 1/8 TBIT (= 2/16 TBIT) 4/8 TBIT (= 8/16 TBIT) 4/8 TBIT (= 8/16 TBIT)
TBIT
VShift_BAT
Dser_int
Master ECU Transceiver IC
VBATTERY VBAT
Dser_master
VSUP
VBATTERY VBAT 30K 1K
Rx
VBUS
Tx
VGND_BATTERY VGND_ECU
VShift_GND
VBUSdom
t
Figure 6.3: Illustration of the Difference between External Supply Voltage VBAT and
the Internal Supply Voltage VSUP
40%
dominant dominant
For a correct transmission and reception of a bit, it has to be asserted that the signal is
Timing diagram:
TXD
(input to transmitting Node)
tBus_dom(max) tBus_rec(min)
Thresholds of
THRec(max)
VSUP receiving node 1
tBus_dom(min) tBus_rec(max)
RXD
(output of receiving Node 1)
trx_pdf(1) trx_pdr(1)
RXD
(output of receiving Node 2)
trx_pdr(2) trx_pdf(2)
as shown in Section 6.5.3. The time constant τ (and thus the overall capacitance) of
the bus (Section 6.5.5) has to be selected carefully in order to allow for a correct sig-
nal implementation under worst case conditions.
The following table (Table 6.8) specifies the timing parameters for proper operation at
20 kBit/sec.
Table 6.8: Driver Electrical AC Parameters of the LIN Physical Layer (20kBit/s)
For improved EMC performance, exception is granted for speeds of 10.4 kBit/sec or
below. For details see the following table (Table 6.9), which specifies the timing
parameters for proper operation at 10.4 kBit/sec.
Table 6.9: Driver Electrical AC Parameters of the LIN Physical Layer (10.4kBit/s)
Application specific implementations (ASICs) shall meet the parameters in Table 6.8
and/or Table 6.9. If both sets of parameters are implemented, the proper mode shall
be selected based on the bus bit rate.
LIN
7.1 INTRODUCTION
The LIN API is a network software layer that hides the details of a LIN network config-
uration (e.g. how signals are mapped into certain frames) for a user making an appli-
cation program for an arbitrary ECU. Instead the user will be provided an API, which is
focused on the signals transported on the LIN network. A tool is used to take care of
the step from network configuration to ready made program code. This will provide the
user with configuration flexibility.
This document defines a mandatory interface to a software LIN device driver imple-
mented in the C programming language. Thus, hardware implementations are not
standardized nor are implementations in other programming languages.
Note that the named objects (signals, schedules) defined in the LDF may extend their
names with the channel postfix name, see Section 9.2.1.4.
7.2.1.1 l_sys_init
Prototype
l_bool l_sys_init (void);
Availability
Master and slave nodes.
Description
l_sys_init performs the initialization of the LIN core. The scope of the initialization is
the physical node (i.e. the complete node), see Section 9.2.2.3.
The call to the l_sys_init is the first call a user must use in the LIN core before using
any other API functions.
The function returns:
Zero If the initialization succeeded.
Non-zero If the initialization failed.
Dynamic prototype
l_bool l_bool_rd (l_signal_handle sss);
l_u8 l_u8_rd (l_signal_handle sss);
l_u16 l_u16_rd (l_signal_handle sss);
Static prototype
l_bool l_bool_rd_sss (void);
Availability
Master and slave nodes.
Description
Reads and returns the current value of the signal.
Reference
Protocol Specification, Section 2.2.
Dynamic prototype
void l_bool_wr (l_signal_handle sss, l_bool v);
void l_u8_wr (l_signal_handle sss, l_u8 v);
void l_u16_wr (l_signal_handle sss, l_u16 v);
Static prototype
void l_bool_wr_sss (l_bool v);
void l_u8_wr_sss (l_u8 v);
void l_u16_wr_sss (l_u16 v);
Availability
Master and slave nodes.
Description
Sets the current value of the signal to v.
Reference
Protocol Specification, Section 2.2.
Dynamic prototype
void l_bytes_rd (l_signal_handle sss,
l_u8 start, /* first byte to read from */
l_u8 count, /* number of bytes to read */
l_u8* const data); /* where data will be written */
Static prototype
void l_bytes_rd_sss_iii (l_u8 start,
l_u8 count,
l_u8* const data);
Description
Reads and returns the current values of the selected bytes in the signal.
The sum of start and count shall never be greater than the length of the byte array.
Example
Assume that a byte array is 6 bytes long, numbered 0 to 5. Reading byte 2 and 3 from
this array requires start to be 2 (skipping byte 0 and 1) and count to be 2 (reading byte
2 and 3). In this case byte 2 is written to data[0] and byte 3 is written to data[1].
Reference
Protocol Specification, Section 2.2.
Dynamic prototype
void l_bytes_wr (l_signal_handle sss,
l_u8 start, /* first byte to write to */
l_u8 count, /* number of bytes to write */
const l_u8* const data); /* where data is read from */
Static implementation
void l_bytes_wr_sss (l_u8 start,
l_u8 count,
const l_u8* const data);
Where sss is the name of the signal, e.g. l_bytes_wr_EngineSpeed (..).
Availability
Master and slave nodes.
Description
Sets the current value of the selected bytes in the signal specified by the name sss to
the value specified.
The sum of start and count shall never be greater than the length of the byte array,
although the device driver may choose not to enforce this in runtime.
Example
Assume that a byte array is 7 bytes long, numbered 0 to 6. Writing byte 3 and 4 from
this array requires start to be 3 (skipping byte 0, 1 and 2) and count to be 2 (writing
byte 3 and 4). In this case byte 3 is read from data[0] and byte 4 is read from data[1].
Reference
7.2.3 NOTIFICATION
Flags are local objects in a node and they are used to synchronize the application pro-
gram with the LIN core. The flags will be automatically set by the LIN core and can
only be tested or cleared by the application program. Flags may be attached to all
types of frames. A flag is set when the frame/signal is considered to be transmitted
respectively received, see Section 2.2.4.
Three types of flags can be created:
• A flag that is attached to a signal
• A flag that is attached to a frame
• A flag that is attached to a signal in a particular frame. This is used when a
signal is packed into multiple frames
All three listed flag types above are applicable on both transmitted and received sig-
nals/frames.
7.2.3.1 l_flg_tst
Dynamic prototype
l_bool l_flg_tst (l_flag_handle fff);
Static implementation
l_bool l_flg_tst_fff (void);
Where fff is the name of the flag, e.g. l_flg_tst_RxEngineSpeed ().
Availability
Master and slave nodes.
Description
Returns a C boolean indicating the current state of the flag specified by the name fff,
i.e. returns zero if the flag is cleared, non-zero otherwise.
Reference
No reference, flags are API specific and not described anywhere else.
Example
A flag, named txconfirmation, is attached to a published signal valve_position stored
in the IO_1 frame. The static implementation of the l_flg_tst will be:
l_bool l_flg_tst_txconfirmation (void);
7.2.3.2 l_flg_clr
Dynamic prototype
void l_flg_clr (l_flag_handle fff);
Static implementation
void l_flg_clr_fff (void);
Where fff is the name of the flag, e.g. l_flg_clr_RxEngineSpeed ().
Availability
Master and slave nodes.
Description
Sets the current value of the flag specified by the name fff to zero.
Reference
No reference, flags are API specific and not described anywhere else.
7.2.4.1 l_sch_tick
Dynamic prototype
l_u8 l_sch_tick (l_ifc_handle iii);
Static implementation
l_u8 l_sch_tick_iii (void);
Where iii is the name of the interface, e.g. l_sch_tick_MyLinIfc ().
Availability
Master nodes only.
Description
The l_sch_tick function follows a schedule. When a frame becomes due, its transmis-
sion is initiated. When the end of the current schedule is reached, l_sch_tick starts
again at the beginning of the schedule.
The l_sch_tick must be called periodically and individually for each interface within the
node. The period is the time base, see Section 2.4, set in the LDF, see
Section 9.2.2.1. The period of the l_sch_tick call effectively sets the time base tick,
7.2.4.2 l_sch_set
Dynamic prototype
void l_sch_set (l_ifc_handle iii,
l_schedule_handle schedule_iii,
l_u8 entry);
Static implementation
void l_sch_set_iii (l_schedule_handle schedule, l_u8 entry);
Where iii is the name of the interface, e.g. l_sch_set_MyLinIfc (MySchedule1, 0).
Availability
Master node only.
Description
Sets up the next schedule to be followed by the l_sch_tick function for a certain inter-
face iii. The new schedule will be activated as soon as the current schedule reaches
its next schedule entry point. The extension “_iii“ is the interface name. It is optional
and the intention is to solve naming conflicts when the node is a master on more than
one LIN cluster.
The entry defines the starting entry point in the new schedule table. The value should
be in the range 0 to N if the schedule table has N entries, and if entry is 0 or 1 the new
schedule table will be started from the beginning.
A predefined schedule table, L_NULL_SCHEDULE, shall exist and may be used to
stop all transfers on the LIN cluster.
Example
A possible use of the entry value is in combination with the l_sch_tick return value to
temporarily interrupt one schedule with another schedule table, and still be able to
switch back to the interrupted schedule table at the point where this was interrupted.
7.2.5.1 l_ifc_init
Dynamic prototype
l_bool l_ifc_init (l_ifc_handle iii);
Static implementation
l_bool_ifc_init_iii (void);
Where iii is the name of the interface, e.g. l_ifc_init_MyLinIfc ().
Availability
Master and slave nodes.
Description
l_ifc_init initializes the controller specified by the name iii, i.e. sets up internal func-
tions such as the baud rate. The default schedule set by the l_ifc_init call will be the
L_NULL_SCHEDULE where no frames will be sent and received.
This is the first call a user must perform, before using any other interface related LIN
API functions.
The function returns zero if the initialisation was successful and non-zero if failed.
Reference
A general description of the interface concept is found in Section 1.1.5.
7.2.5.2 l_ifc_goto_sleep
Dynamic prototype
Static implementation
void l_ifc_goto_sleep_iii (void);
Where iii is the name of the interface, e.g. l_ifc_goto_sleep_MyLinIfc ().
Availability
Master node only.
Description
This call requests slave nodes on the cluster connected to the interface to enter bus
sleep mode by issuing one go to sleep command, see Section 7.2.5.8.
The go to sleep command will be scheduled latest when the next schedule entry is
due.
The l_ifc_goto_sleep will not affect the power mode. It is up to the application to do
this.
If the go to sleep command was successfully transmitted on the cluster the go to sleep
bit will be set in the status register, see Section 7.2.5.8.
Reference
Protocol Specification, Section 2.6.3.
7.2.5.3 l_ifc_wake_up
Dynamic prototype
void l_ifc_wake_up (l_ifc_handle iii);
Static implementation
void l_ifc_wake_up_iii (void);
Where iii is the name of the interface, e.g. l_ifc_wake_up_MyLinIfc ().
Availability
Master and slave nodes.
Description
The function will transmit one wake up signal. The wake up signal will be transmitted
directly when this function is called. It is the responsibility of the application to retrans-
mit the wake up signal according to the wake up sequence defined in Section 2.6.2.
Reference
Protocol Specification, Section 2.6.2.
Dynamic prototype
l_u16 l_ifc_ioctl (l_ifc_handle iii, l_ioctl_op op, void* pv);
Static implementation
l_u16 l_ifc_ioctl_iii (l_ioctl_op op, void* pv);
Where iii is the name of the interface, e.g. l_ifc_ioctl_MyLinIfc (MyOp, &MyPars).
Availability
Master and slave nodes.
Description
This function controls functionality that is not covered by the other API calls. It is used
for protocol specific parameters or hardware specific functionality. Example of such
functionality can be to switch on/off the wake up signal detection.
The iii is the name of the interface to which the operation defined in op should be
applied. The pointer pv points to an optional parameter that may be provided to the
function.
Exactly which operations that are supported are implementation dependent.
Reference
No reference, the behavior is API specific and not described anywhere else.
7.2.5.5 l_ifc_rx
Dynamic prototype
void l_ifc_rx (l_ifc_handle iii);
Static implementation
void l_ifc_rx_iii (void);
Where iii is the name of the interface, e.g. l_ifc_rx_MyLinIfc ().
Availability
Master and slave nodes.
Description
The application program is responsible for binding the interrupt and for setting the cor-
rect interface handle (if interrupt is used).
For UART based implementations it may be called from a user-defined interrupt han-
dler triggered by a UART when it receives one character of data. In this case the func-
tion will perform necessary operations on the UART control registers.
For more complex LIN hardware it may be used to indicate the reception of a com-
7.2.5.6 l_ifc_tx
Dynamic prototype
void l_ifc_tx (l_ifc_handle iii);
Availability
Master and slave nodes.
Static implementation
void l_ifc_tx_iii (void);
Where iii is the name of the interface, e.g. l_ifc_tx_MyLinIfc ().
Description
The application program is responsible for binding the interrupt and for setting the cor-
rect interface handle (if interrupt is used).
For UART based implementations it may be called from a user-defined interrupt han-
dler triggered by a UART when it has transmitted one character of data. In this case
the function will perform necessary operations on the UART control registers.
For more complex LIN hardware it may be used to indicate the transmission of a com-
plete frame.
Reference
No reference, the behavior is API specific and not described anywhere else.
7.2.5.7 l_ifc_aux
Dynamic prototype
void l_ifc_aux (l_ifc_handle iii);
Static implementation
void l_ifc_aux_iii (void);
Where iii is the name of the interface, e.g. l_ifc_aux_MyLinIfc ().
Availability
Master and slave nodes.
Description
This function may be used in the slave nodes to synchronize to the break/sync field
7.2.5.8 l_ifc_read_status
Dynamic prototype
l_u16 l_ifc_read_status (l_ifc_handle iii);
Static implementation
l_u16 l_ifc_read_status_iii (void);
Where iii is the name of the interface, e.g. l_ifc_read_status_MyLinIfc ().
Availability
Master and slave nodes. The behavior is different for master and slave nodes, see
description below.
Description
This function will return the status of the previous communication. The call returns the
status word (16 bit value), as shown in Table 7.1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Save Event trig-
Bus Go to Successful Error in
Last frame PID 0 configu- gered frame Overrun
activity sleep transfer response
ration collision
The status word is only set based on a frame transmitted or received by the node
(except bus activity).
The call is a read-reset call; meaning that after the call has returned, the status word is
set to 0.
Event triggered frame collision is set as long the collision resolving schedule is exe-
cuted. The intention is to use it in parallel with the return value from l_sch_tick. In the
slave, this bit will always be 0 (zero). If the master node application switches schedule
table during the collision is resolved the event triggered frame collision flag will be set
to 0 (zero). See example below how this flag is set.
Save configuration is set when the save configuration request, see Section 4.2.5.4,
has been successfully received. It is set only in the slave node, in the master node it is
always 0 (zero).
Last frame PID is the PID last detected on the bus and processed in the node. If over-
run is set one or more values of last frame PID are lost; only the latest value is main-
tained. It is set simultaneously with successful transfer or error in response.
The combination of the two status bits successful transfer and error in response is
interpreted according to Table 7.2.
Example 1
The l_ifc_read_status is designed to allow reading at a much lower frequency than the
frame slot frequency, e.g. once every 50 frame slots. In this case, the last frame PID
has little use. Overrun is then used as a check that the traffic is running as it should,
i.e. is shall always be set.
It is, however, also possible to call l_ifc_read_status every frame slot and get a much
better error statistics; you can see the protected identifier of the failing transfers and
by knowing the topology, it is possible to draw better conclusion of faulty nodes. This
is maybe most useful in the master node, but is also possible in any slave node.
Example 2
This example shows how the event triggered flag behaves in case of a collision
resolving.
Return value of
0 2 0 1 0 2 0 1 0 2 l_ifc_sch_tick
Event triggered frame
0 0 0 0 1 1 1 1 0 0 flag - the l_read_status is
called directly after
l_ifc_sch_tick
7.2.6.1 l_sys_irq_disable
Dynamic prototype
l_irqmask l_sys_irq_disable (void);
Availability
Master and slave nodes.
Description
The user implementation of this function must achieve a state in which no interrupts
from the LIN communication can occur.
Reference
No reference, the behavior is API specific and not described anywhere else.
7.2.6.2 l_sys_irq_restore
Dynamic prototype
void l_sys_irq_restore (l_irqmask previous);
Description
The user implementation of this function must restore the interrupt level identified by
the provided l_irqmask previous.
Reference
No reference, the behavior is API specific and not described anywhere else.
7.3.1.1 ld_is_ready
Availability
Master node only.
Description
This call returns the status of the last requested configuration service. The return val-
ues are interpreted as follows:
LD_SERVICE_BUSY Service is ongoing.
LD_REQUEST_FINISHED The configuration request has been completed. This is a
intermediate status between the configuration request
and configuration response.
LD_SERVICE_IDLE The configuration request/response combination has
been completed, i.e. the response is valid and may be
analyzed. Also, this value is returned if no request has
yet been called.
LD_SERVICE_ERROR The configuration request or response experienced an
error. Error here means error on the bus, and not a neg-
ative configuration response from the slave node.
The following Figure 7.2 shows the situation where a successful configuration request
and configuration response is made. Note that the state change after the master
request frame and slave response frame are finished may be delayed up to one time
base.
Reference
No reference, the behavior is API specific and not described anywhere else.
7.3.1.2 ld_check_response
Dynamic prototype
Availability
Master node only.
Description
This call returns the result of the last node configuration service, in the parameters
RSID and error_code. A value in RSID is always returned but not always in the
error_code. Default values for RSID and error_code is 0 (zero).
Reference
No reference, the behavior is API specific and not described anywhere else.
7.3.1.3 ld_assign_frame_id_range
Dynamic prototype
void ld_assign_frame_id_range (l_ifc_handle iii,
l_u8 NAD,
l_u8 start_index,
const l_u8* const PIDs);
Availability
Master node only.
Description
This call assigns the protected identifier of up to four frames in the slave node with the
addressed NAD. The PIDs parameter shall be four bytes long, each byte shall contain
a PID, do not care or unassign value.
Reference
See the definition of the service assign frame id range, Section 4.2.5.5.
7.3.1.4 ld_assign_NAD
Dynamic prototype
void ld_assign_NAD (l_ifc_handle iii,
l_u8 initial_NAD,
l_u16 supplier_id,
l_u16 function_id,
Availability
Master node only.
Description
This call assigns the NAD (node diagnostic address) of all slave nodes that matches
the initial_NAD, the supplier ID and the function ID. The new NAD of the slave node
will be new_NAD.
Reference
See the definition of the service assign NAD, Section 4.2.5.1.
7.3.1.5 ld_save_configuration
Dynamic prototype
void ld_save_configuration (l_ifc_handle iii,
l_u8 NAD);
Availability
Master node only.
Description
This call will make a save configuration request to a specific slave node with the given
NAD, or to all slave nodes if NAD is set to broadcast.
Reference
See the definition of the service save configuration, Section 4.2.5.4. API call
l_ifc_read_status, Section 7.2.5.8. See also the example in Section 7.5.2.
7.3.1.6 ld_read_configuration
Dynamic prototype
l_u8 ld_read_configuration (l_ifc_handle iii,
l_u8* const data,
l_u8* const length);
Availability
Slave node only.
Description
This function will not transport anything on the bus.
This call will serialize the current configuration and copy it to the area (data pointer)
provided by the application. The intention is to call this function when the save config-
uration request flag is set in the status register, see Section 7.2.5.8. After the call is
7.3.1.7 ld_set_configuration
Dynamic prototype
l_u8 ld_set_configuration (l_ifc_handle iii,
Availability
Slave node only.
Description
This call will not transport anything on the bus.
The function will configure the NAD and the PIDs according to the configuration given
by data. The intended usage is to restore a saved configuration or set an initial config-
uration (e.g. coded by I/O pins). The function shall be called after calling l_ifc_init.
The caller shall set the size of the data area before calling the function.
The data contains the NAD and the PIDs and occupies one byte each. The structure
of the data is: NAD and then all PIDs for the frames. The order of the PIDs are the
7.3.2 ld_conditional_change_NAD
Dynamic prototype
void ld_conditional_change_NAD (l_ifc_handle iii,
l_u8 NAD,
l_u8 id,
l_u8 byte,
l_u8 mask,
l_u8 invert,
l_u8 new_NAD);
Availability
Master node only.
Description
This call changes the NAD if the node properties fulfil the test specified by id, byte,
mask and invert.
Id shall be in the range 0 to 31, see Table 4.20, and byte in the range 1 to 5 (specify-
ing the byte to use in the id). Mask and Invert shall have values between 0 and 255.
Reference
See the definition of the service conditional change NAD, Section 7.3.2.
7.3.3 IDENTIFICATION
7.3.3.1 ld_read_by_id
Dynamic prototype
Availability
Master node only.
Description
The call requests the slave node selected with the NAD to return the property associ-
ated with the id parameter, see Table 4.19 in the Node configuration and Identification
Specification, for interpretation of the id. When the next call to ld_is_ready returns
LD_SERVICE_IDLE (after the ld_read_by_id is called), the RAM area specified by
data contains between one and five bytes data according to the request.
The result is returned in a big-endian style. It is up to little-endian CPUs to swap the
bytes, not the LIN diagnostic driver. The reason for using big-endian data is to simplify
message routing to a (e.g. CAN) back-bone network.
Reference
Node configuration and Identification Specification, Section 4.2.6.1.
7.3.3.2 ld_read_by_id_callout
Dynamic prototype
l_u8 ld_read_by_id_callout (l_ifc_handle iii,
l_u8 id,
l_u8* data);
Availability
This callout is optional and is available in slave node only. In case the user defined
read by identifier request is used, the slave node application must implement this call-
out.
Description
This callout is used when the master node transmits a read by identifier request with
an identifier in the user defined area. The slave node application will be called from
the driver when such request is received.
7.4.2 INITIALIZATION
Dynamic prototype
void ld_init (l_ifc_handle iii);
Availability
Master and slave nodes.
Description
This call will (re)initialize the raw and the cooked layers on the interface iii.
All transport layer buffers will be initialized.
7.4.3.1 ld_put_raw
Dynamic prototype
Availability
Master and slave nodes.
Description
The call queues the transmission of 8 bytes of data in one frame.
The data is sent in the next suitable frame (master request frame for master nodes
and slave response frame for slave nodes).
The data area will be copied in the call, the pointer will not be memorized.
If no more queue resources are available, the data may be jettisoned and the appro-
priate error status will be set.
Reference
The raw and cooked is not differentiated outside the API. A general description of the
transport layer can be found in Transport Layer Specification.
7.4.3.2 ld_get_raw
Dynamic prototype
void ld_get_raw (l_ifc_handle iii,
l_u8* const data);
Availability
Master and slave nodes.
Description
The call copies the oldest received diagnostic frame data to the memory specified by
data.
The data returned is received from master request frame for slave nodes and slave
response frame for master nodes.
If the receive queue is empty no data will be copied.
Reference
The raw and cooked is not differentiated outside the API. A general description of the
transport layer can be found in Transport Layer Specification.
7.4.3.3 ld_raw_tx_status
Dynamic prototype
Availability
Master and slave nodes.
Description
The call returns the status of the raw frame transmission function:
LD_QUEUE_EMPTY The transmit queue is empty. In case previous calls to
ld_put_raw, all frames in the queue have been trans-
mitted.
LD_QUEUE_AVAILABLE The transmit queue contains entries, but is not full.
LD_QUEUE_FULL The transmit queue is full and can not accept further
frames.
LD_TRANSMIT_ERROR LIN protocol errors occurred during the transfer; ini-
tialize and redo the transfer.
Reference
The raw and cooked is not differentiated outside the API. A general description of the
transport layer can be found in Transport Layer Specification.
7.4.3.4 ld_raw_rx_status
Dynamic prototype
l_u8 ld_raw_rx_status (l_ifc_handle iii);
Availability
Master and slave nodes.
Description
The call returns the status of the raw frame receive function:
LD_NO_DATA The receive queue is empty.
LD_DATA_AVAILABLE The receive queue contains data that can be read.
LD_RECEIVE_ERROR LIN protocol errors occurred during the transfer; ini-
tialize and redo the transfer.
Reference
The raw and cooked is not differentiated outside the API. A general description of the
transport layer can be found in Transport Layer Specification.
7.4.4.1 ld_send_message
Dynamic prototype
void ld_send_message (l_ifc_handle iii,
l_u16 length,
l_u8 NAD,
const l_u8* const data);
Availability
Master and slave nodes.
Description
The call packs the information specified by data and length into one or multiple diag-
nostic frames. If the call is made in a master node application the frames are transmit-
ted to the slave node with the address NAD. If the call is made in a slave node
application the frames are transmitted to the master node with the address NAD. The
parameter NAD is not used in slave nodes.
The value of the SID (or RSID) shall be the first byte in the data area.
Length must be in the range of 1 to 4095 bytes. The length shall also include the SID
(or RSID) value, i.e. message length plus one.
The call is asynchronous, i.e. not suspended until the message has been sent, and
the buffer may not be changed by the application as long as calls to ld_tx_status
returns LD_IN_PROGRESS.
The data is transmitted in suitable frames (master request frame for master nodes and
slave response frame for slave nodes).
If there is a message in progress, the call will return with no action.
Reference
The raw and cooked is not differentiated outside the API. A general description of the
transport layer can be found in Transport Layer Specification.
7.4.4.2 ld_receive_message
Dynamic prototype
Availability
Master and slave nodes.
Description
The call prepares the LIN diagnostic module to receive one message and store it in
the buffer pointed to by data. At the call, length shall specify the maximum length
allowed. When the reception has completed, length is changed to the actual length
and NAD to the NAD in the message.
SID (or RSID) will be the first byte in the data area.
Length will be in the range of 1 to 4095 bytes, but never more than the value originally
set in the call. SID (or RSID) is included in the length.
The parameter NAD is not used in slave nodes.
The call is asynchronous, i.e. not suspended until the message has been received,
and the buffer may not be changed by the application as long as calls to ld_rx_status
returns LD_IN_PROGRESS. If the call is made after the message transmission has
commenced on the bus (i.e. the SF or FF is already transmitted), this message will not
be received. Instead the function will wait until next message commence.
The data is received from the succeeding suitable frames (master request frame for
slave nodes and slave response frame for master nodes).
The application shall monitor the ld_rx_status and shall not call this function until the
status is LD_COMPLETED. Otherwise this function may return inconsistent data in
the parameters.
Reference
The raw and cooked is not differentiated outside the API. A general description of the
transport layer can be found in Transport Layer Specification.
7.4.4.3 ld_tx_status
Dynamic prototype
l_u8 ld_tx_status (l_ifc_handle iii);
Availability
Master and slave nodes.
7.4.4.4 ld_rx_status
Dynamic prototype
l_u8 ld_rx_status (l_ifc_handle iii);
Availability
Master and slave nodes.
Description
The call returns the status of the last made call to ld_receive_message. The following
values can be returned:
LD_IN_PROGRESS The reception is not yet completed.
LD_COMPLETED The reception has completed successfully and all
information (length, NAD, data) is available. (You can
also issue a new ld_receive_message call). This
value is also returned after initialization of the trans-
port layer.
LD_FAILED The reception ended in an error. The data was only
7.5 EXAMPLES
In the following chapters a very simple example is given in order to show how the API
can be used. The examples are not complete, there are functions that are not imple-
mented.
#define INT_ENABLE_LEVEL 1
/**********************************************************************
* Procedure : l_sys_irq_disable
* Description : Disable the UART interrupts of the controller and
* return the interrupt level to be able to restore it
* later
* In parameters : None
* Out parameters : None
* Return value : The interrupt level before disable
*/
l_irqmask l_sys_irq_disable (void)
{
l_irqmask interrupt_level;
/* Store the interrupt level and then disable UART interrupts */
return interrupt_level;
} /* l_sys_irq_disable */
/**********************************************************************
* Interrupt : lin_char_rx_handler
* Description : UART recieve character interrupt handler for the
* interface i1
* In parameters : None
* Out parameters : None
* Return value : void
*/
void __INTERRUPT /* Compiler intrinsic */ lin_char_rx_handler (void)
{
/* Just call the LIN API provided function to do the actual work */
l_ifc_rx_i1 ();
} /* lin_char_rx_handler */
/**********************************************************************
* Procedure : main
/* Start the OS */
start_OS ();
/* return code */
return 1;
} /* main */
/**********************************************************************
* Procedure : main_application_10ms
* Description : Main 10 ms task of the application
* In parameters : None
* Out parameters : None
* Return value : void */
void main_application_10ms (void)
{
/* In/output of signals. Call it first in the task to minimize jitter */
(void) l_sch_tick_i1();
} /* main_application_10ms */
#define INT_ENABLE_LEVEL 1
/**********************************************************************
* Interrupt : lin_char_rx_handler
* Description : UART recieve character interrupt handler for the
* interface i1
* In parameters : None
* Out parameters : None
* Return value : void
*/
void __INTERRUPT /* Compiler intrinsic */ lin_char_rx_handler (void)
{
/* Just call the LIN API provided function to do the actual work */
l_ifc_rx_i1 ();
} /* lin_char_rx_handler */
/**********************************************************************
* Procedure : main_task
* Description : Main task covering LIN functionalities
* In parameters : None
* Out parameters : None
* Return value : void */
void main_task (void)
{
/* Do some application specific stuff... */
/**********************************************************************
* Procedure : main
* Description : Main entry of application
* In parameters : None
* Out parameters : None
* Return value : function will never return
*/
int main (void)
{
l_u8 cfg[20];
l_u8 len = 0;
l_bool configuration_ok = 0;
l_bool stored_configuration = 0;
while (1) {
/* Call the only task */
main_task ();
}
/* return code */
return 1;
} /* main */
LIN
8.1 INTRODUCTION
The intention of a node capability language is to be able to describe the possibilities of
a slave node in a standardized, machine readable syntax.
The availability of pre-made off-the-shelf slave nodes is expected to grow in the next
years. If they are all accompanied by a node capability file, it will be possible to gener-
ate both the LIN description file (LDF), see Configuration Language Specification, and
initialization code (configuring the cluster, e.g. reconfigure conflicting frame identifiers)
for the master node.
If the setup and configuration of any cluster is fully automatic, a great step towards
plug-and-play development with LIN will be taken. In other words, it will be just as
easy to use distributed nodes in a cluster as a single CPU node with the physical
devices connected directly to the node.
LIN
Figure 8.1: Development of a LIN cluster.
8.1.1.3 Debugging
Debugging and node emulation is based on the LDF file produced in the LIN cluster
design. Thus, the monitoring will work just as in earlier versions of the LIN specifica-
tion.
Emulation of the master adds the requirement that the cluster must be configured to
be conflict free. Hence, the emulator tool must be able to read reconfiguration data
produced by the LIN cluster design tool.
Shall be in the range of "0.01" to "99.99". This specification describes version 2.1.
If a node capability file contains more than one slave node, the node_name shall be
unique within the file. The declared slave nodes shall be seen as classes (templates)
for physical slave node instances.
The properties of a node_definition are defined in the following sections.
The general_definition declare the properties that specify the general compatibility
with the cluster.
This specifies the protocol used by the slave node and it shall be in the range of "0.01"
to "99.99".
The supplier_id is assigned to each LIN consortium member as a 16 bit number. The
function_id is a 16 bit number assigned to the product by the supplier to make it
unique. Finally, variant_id is an 8 bit value specifying the variant, see Section 4.2.1.
(P2_min = real_or_integer ms ;)
(ST_min = real_or_integer ms ;)
(N_As_timeout = real_or_integer ms ;)
(N_Cr_timeout = real_or_integer ms ;)
(support_sid { integer ([, integer]) } ;)
(max_message_length = integer ;)
}
The diagnostic_definition specifies the properties for transport layer and configuration.
The NAD property defines the initial node address; the value shall be set according to
Section 4.2.3.2. Either a list of values or a range can be given. The range is inclusive,
i.e. both values are included in the range. If more than one value is given, the slave
will dynamically select one of the values within the given NAD set based on a physical
property.
The diagnostic class defines the supported class 1, 2 or 3.
Frames listed here shall be all unconditional frames and event triggered frames pro-
cessed by the slave node. Event triggered frames means the event triggered frame
header, it will therefore not contain any signals. The diagnostic frames will always be
supported and therefore not listed.
<single_frame> ::=
<frame_kind> <frame_name> {
<frame_properties>
(<signal_definition>)
}
All frames (except diagnostic frames) carry signals, which are declared in according to
the signal_definition.
<signal_properties> ::=
<init_value>
size = integer ;
offset = integer ;
(<encoding_name> ;)
<init_value> ::= <init_value_scalar> | <init_value_array>
<init_value_scalar> ::= init_value = integer
<init_value_array> ::= init_value = {integer ([, integer ])}
The init_value specifies the value used for the signal from power on until first set by
the publishing application. The init_value_scalar is used for scalar signals and the
init_value_array is used for byte array signals. The init_value_array is given in big-
endian order.
The size is the number of bits reserved for the signal and the offset specifies the posi-
tion of the signal in the frame (number of bits in offset from the first bit in the frame).
For a byte array, both size and offset must be multiples of eight.
The only way to describe if a signal with size 8 or 16 is a byte array with one or two
elements or a scalar signal is by analyzing the init_value, i.e. the curly parenthesis are
very important to distinguish between arrays and scalar values.
The encoding_name is a reference to a encoding defined in encoding clausal, defined
below.
The signal_value the min_value and the max_value shall be in range of 0 to 65535.
The max_value shall be greater than or equal to min_value. If the raw value is within
the range defined by the min and max value, the physical value shall be calculated as
in (16).
physical_value = (scale * raw_value) + offset (16)
The status_management section specifies which published signal the master node
shall monitor to determine if the slave node is operating as expected.
The identifiers above refer each to one unique published signal in the signal definition,
see Section 8.2.5.2. See the definition of the response error signal in Section 2.7.3
and the fault state signals in Section 5.3.
The free_text_definition is used to bring up help text, limitations, etc., in the LIN cluster
design tool, if desired.
Typical information provided in the free text definition is:
• Slave node purpose and physical world interaction, e.g. motor speed, power
consumption etc.
• Deviations from the LIN standard.
LIN
9.1 INTRODUCTION
The language described in this document is used in order to create a LIN description
file. The LIN description file describes a complete cluster and also contains all infor-
mation necessary to monitor the cluster. This information is sufficient to make a lim-
ited emulation of one or multiple nodes if it/they are not available.
The LIN description file can be one component used in order to write software for an
electronic control unit which shall be part of the cluster. An application program inter-
face has been defined, see Application Program Interface Specification, in order to
have a uniform way to access the cluster from within different application programs.
However, the functional behavior of the application program is not addressed by the
LIN description file.
The syntax of a LIN description file is simple enough to be entered manually, but the
development and use of computer based tools is encouraged. Node capability files, as
Shall be in the range of "0.01" to "99.99". This specification describes version 2.1.
This sets the nominal bit rate for the cluster. It shall be in the range of 1 to 20 kbit/sec-
ond.
Postfix for all named objects in the LDF. The postfix is mandatory for master nodes
that are connected too more than one cluster. It is used to avoid naming collision if a
node is connected to several clusters (i.e. using several LDFs). If given all named
objects shall add this postfix to its name.
The nodes clause lists the physical nodes participating in the cluster. All node_name
identifiers shall be unique within the node identifier set.
The node_name identifier after the Master reserved word specifies the master node.
<time_base> ::= real_or_integer
The time_base value specifies the used time base in the master node to generate the
maximum allowed frame transfer time. The time base shall be specified in millisec-
onds.
<jitter> ::= real_or_integer
The jitter shall be specified in milliseconds. For more information on time_base and jit-
ter usage see Section 2.4.
(initial_NAD = <diag_address> ;)
<attributes_def> ;
}]
}
<node_name> ::= identifier
All node_name identifiers shall exist within the node identifier set and refer to a slave
node.
<protocol_version> ::= char_string
The diag_address specifies the diagnostic address for the identified slave node in the
range as defined in Section 4.2.3.2. It shall specify the unique NAD used for the slave
node after resolving any cluster conflicts, i.e. it shall be unique within the cluster.
The supplier_id, function_id and variant_id ranges are defined in Section 4.2.1.
The variant ID is optional since it is a property of the slave node and not the cluster. It
is set here for LIN 2.0 slave nodes.
<signal_name> ::= identifier
All signal_name identifiers for the response error signals shall exist within the signal
identifier set and refer to a one bit standard signal, see Section 9.2.3.1. The response
error signal shall be published by the specified slave node. Refer to status manage-
ment, Section 2.7, for more information.
The fault_state_signals is a property of LIN 2.1 slave nodes, and are used for diag-
nostic class I and II, see Section 5.3.
The default values of P2_min is 50 ms and ST_min is 0 ms, see Section 5.6.
The default values of N_As_timeout and N_Cr_timeout are 1000 ms, see
Section 3.2.5. These values are only used in LIN 2.1 slave nodes.
Configurable frames shall list all frames (unconditional frames, event-triggered frames
and sporadic frames) processed by the slave node. This section applies to LIN 2.x
slave nodes only (not to LIN 1.x).
The message_id range is defined in the LIN Diagnostic and Configuration Specifi-
cation of LIN 2.0.
The configurable_frames_def for LIN 2.1:
<configurable_frames_21_def> ::=
configurable_frames {
[<frame_name> ;]
}
The order of the frames are important since the node configuration request assign
frame PID range dependent on the order, see Section 4.2.5.5.
[<composite_node> {
<logical_node> ([, <logical_node>]) ;]
}]
}
All composite_node identifiers and logical_node identifiers must be unique within the
slave node identifier set.
<configuration_name> ::= identifier
The composite_node groups a number of logical slave nodes into one physical slave
node. The composite_node is used in the list of participating slave nodes,
The logical slave node shall be listed in the node attributes section. Each logical slave
node will keep its NAD. The master node will communicate to the logical slave node
as if they were separated.
All signal_name identifiers shall be unique within the signal identifier set.
<signal_size> ::= integer
The signal_size specifies the size of the signal. It shall be in the range 1 to 16 bits for
scalar signals and 8, 16, 24, 32, 40, 48, 56 or 64 for byte array signals.
<init_value> ::= <init_value_scalar> | <init_value_array>
<init_value_scalar> ::= integer
The init_value specifies the signal value that shall be used by all subscriber nodes
until the frame containing the signal is received. The init_value_scalar is used for sca-
lar signals and the init_value_array is used for byte array signals. The initial_value for
byte arrays shall be arranged in big-endian order (i.e. with the most significant byte
first).
The only way to describe if a signal with size 8 or 16 is a byte array with one or two
elements or a scalar signal is by analyzing the init_value, i.e. the curly parenthesis are
very important to distinguish between arrays and scalar values.
<published_by> ::= identifier
<subscribed_by> ::= identifier
The published_by identifier and the subscribed_by identifier shall all exist in the node
identifier set.
Diagnostic signals have a separate section in the LIN description file due to the fact
that the publisher/subscriber information does not apply here.
<Signal_groups_def> ::=
Signal_groups {
[<signal_group_name>:<group_size> {
[<signal_name> ,<group_offset> ;]
}]
}
<signal_group_name> ::= identifier
<group_size> ::= integer
<signal_name> ::= identifier
<group_offset> ::= integer
All frame_name identifiers shall be unique within the frame identifier set.
<frame_id> ::= integer
The frame_id specifies the frame identifier number in range 0 to 59. The frame identi-
fier shall be unique for all frames within the frames identifier set.
<published_by> ::= identifier
The signal_offset value specifies the least-significant bit position of the signal in the
frame. This value is in the range of 0 to (8 * frame_size - 1). The least significant bit of
the signal is transmitted first.
Example
Table 9.1 below shows a ten bit signal packed in a frame with a four byte data field.
The LSB of S is at offset 16 and the MSB is at offset 25. Note that the figure is drawn
as the bytes are transmitted (LSB first).
Byte 0 Byte 1 Byte 2 Byte 3
S S S S S S S S S S
0 7 8 15 16 23 24 31
Transmitted first Transmitted last
All sporadic_frame_name identifiers shall be unique within the frame identifier set.
<frame_name> ::= identifier
All frame_name identifiers shall exist in the frame identifier set and refer to uncondi-
tional frames. In the case that more than one of the declared frames needs to be
transferred, the one first listed shall be chosen.
All frame_name identifiers shall either be unconditional frames published by the mas-
ter node. Furthermore, they shall not be scheduled as unconditional frames directly in
the same schedule table as the sporadic_frame_name.
All event_trig_frm_name identifiers shall be unique within the frame identifier set.
<collision_resolving_schedule_table> ::= identifier
This refers to a schedule table in the schedule table set. This schedule will be auto-
matically activated after the collision. It shall minimum contain the associated uncondi-
tional frames.
<frame_id> ::= integer
The frame_id specifies the frame ID number in range 0 to 59. The ID shall be unique
for all frames within the frames ID set.
<frame_name> ::= identifier
All frame_name identifiers shall exist in the frame identifier set and refer to uncondi-
tional frames.
Remark
The first byte of the frame carries the protected identifier of the associated frame and,
hence, cannot be used for other purposes.
The MasterReq and SlaveResp reserved frame names are identifying the diagnostic
frames (see Section 2.3.3.4) and shall be unique in the frame identifier set.
All schedule_table_name identifiers shall be unique within the schedule table identifier
set.
The command specifies what will be done in the frame slot. Providing a frame name
will transfer the specified frame.
<frame_name> ::= identifier
The frame_name identifier shall exist in the frame identifier set. If the frame_name
refers to an event triggered frame or a sporadic frame, the associated unconditional
frames may not be used in the same schedule table.
<node_name> ::= identifier
The frame_index sets the index to the first frame to assign a PID, see Section 9.2.2.2.
<frame_PID> ::= identifier
If the optional four frame_PID are given the request will include these values. If
The frame_time specifies the duration of the frame slot, see Section 2.4.2. The
frame_time value shall be specified in milliseconds.
The handling and switching of schedule table is controlled by the master application
program, see description in Section 2.4 and the schedule table handling API in
Section 7.2.4.
Example
Figure 9.1 shows a time line that corresponds to the schedule table VL1_ST1. It is
assumed that the time_base (see Section 9.2.2.1) is set to 5 ms.
schedule_tables {
VL1_ST1 {
VL1_CEM_Frm1 delay 15 ms;
VL1_LSM_Frm1 delay 15 ms;
time
time_base = 5 ms
Jitter TFrame_Maximum inter-frame space
The signal_value the min_value and the max_value shall be in range of 0 to 65535.
The max_value shall be greater than or equal to min_value. If the raw value is within
the range defined by the min and max value, the physical value shall be calculated as
in (17).
Signal
255
192
128
64
0
V
7 11 13 17
Figure 9.1: Representation of V_battery.
The signal_encoding_type_name identifier shall exist in the signal encoding type iden-
tifier set.
<signal_name> ::= identifier
The signal_name identifier shall exist in the signal identifier set (both scalar and byte
array signals are applicable). Each signal may only be associated with one
signal_encoding_type_name and may not be nested in a signal_group_name.
9.4 EXAMPLES
9.4.1 LIN DESCRIPTION FILE
LIN_description_file;
LIN_protocol_version = “2.1”;
LIN_language_version = “2.1”;
LIN_speed = 19.2 kbps;
Channel_name = “DB”;
Nodes {
Master: CEM, 5 ms, 0.1 ms;
Slaves: LSM, RSM;
}
Node_attributes {
LSM {
Frames {
CEM_Frm1: 0x01, CEM, 1 {
InternalLightsRequest, 0;
}
LSM_Frm1: 0x02, LSM, 2 {
LeftIntLightsSwitch, 0;
}
LSM_Frm2: 0x03, LSM, 1 {
LSMerror, 0;
IntError, 1;
}
RSM_Frm1: 0x04, RSM, 2 {
RightIntLightsSwitch, 0;
}
RSM_Frm2: 0x05, RSM, 1 {
RSMerror, 0;
}