logo资料库

LIN2.1规范.pdf

第1页 / 共191页
第2页 / 共191页
第3页 / 共191页
第4页 / 共191页
第5页 / 共191页
第6页 / 共191页
第7页 / 共191页
第8页 / 共191页
资料共191页,剩余部分请下载后查看
LIN2.1.book
Specification Package
Revision history
Table of contents
1.1 LIN
1.1.1 Scope
1.1.2 Features and possibilities
1.1.3 Work flow concept
1.1.4 Node concept
1.1.5 Concept of operation
1.1.5.1 Master and slave
1.1.5.2 Frames
1.1.5.3 Data transport
1.1.5.4 Schedule table
1.1.6 Document overview
1.1.7 History and background
1.1.7.1 Compatibility with LIN 1.3
1.1.7.2 Compatibility with LIN 2.0
1.1.7.3 Changes between LIN 1.3 and LIN 2.0
1.1.7.4 Changes between LIN 2.0 and LIN 2.1
1.1.8 References
1.2 LIN Glossary
Protocol Specification
2.1 Introduction
2.2 Signal Management
2.2.1 Signal types
2.2.2 Signal consistency
2.2.3 Signal packing
2.2.4 Signal reception and transmission
2.3 Frame Transfer
2.3.1 Frame structure
2.3.1.1 Break field
2.3.1.2 Sync byte field
2.3.1.3 Protected identifier field
2.3.1.4 Data
2.3.1.5 Checksum
2.3.2 Frame length
2.3.3 Frame types
2.3.3.1 Unconditional frame
2.3.3.2 Event triggered frame
2.3.3.3 Sporadic frame
2.3.3.4 Diagnostic frames
2.3.3.5 Reserved frames
2.4 Schedule tables
2.4.1 Time definitions
2.4.2 frame Slot
2.4.3 Schedule table handling
2.5 Task Behavior Model
2.5.1 Master task state machine
2.5.2 Slave task state machine
2.5.2.1 Break/sync field sequence detector
2.5.2.2 Frame processor
2.6 Network Management
2.6.1 slave communication state diagram
2.6.2 Wake up
2.6.3 Go to sleep
2.7 Status Management
2.7.1 Concept
2.7.2 Event triggered frames
2.7.3 Reporting to the cluster
2.7.4 Reporting within own node
2.8 Appendices
2.8.1 Table of numerical properties
2.8.2 Table of valid frame identifiers
2.8.3 Example of checksum calculation
2.8.4 Syntax and mathematical symbols used in this standard
Transport Layer Specification
3.1 Introduction
3.2 Transport layer
3.2.1 PDU structure
3.2.1.1 Overview
3.2.1.2 NAD
3.2.1.3 PCI
3.2.1.4 LEN
3.2.1.5 SID
3.2.1.6 D1 to D6
3.2.2 Communication
3.2.2.1 Single Frame Transmission
3.2.2.2 Multiple Frame Transmission
3.2.3 Error Handling
3.2.4 Defined requests
3.2.5 timing constraints
Node configuration and Identification Specification
4.1 Introduction
4.2 Node configuration and identification
4.2.1 LIN product identification
4.2.1.1 Wildcards
4.2.2 Slave Node model
4.2.2.1 Initial NAD
4.2.3 PDU structure
4.2.3.1 Overview
4.2.3.2 NAD
4.2.3.3 PCI
4.2.3.4 SID
4.2.3.5 RSID
4.2.3.6 D1 to D5
4.2.4 Node configuration and identification
4.2.5 Node configuration services
4.2.5.1 Assign NAD
4.2.5.2 Conditional change NAD
4.2.5.3 Data dump
4.2.5.4 Save Configuration
4.2.5.5 Assign frame ID range
4.2.6 Identification
4.2.6.1 Read by identifier
Diagnostic specification
5.1 Introduction
5.1.1 using the transport layer
5.1.2 LIN master
5.1.3 slave nodes
5.2 Diagnostic classes
5.2.1 Diagnostic Class I
5.2.1.1 Transport protocol
5.2.1.2 Diagnostic services
5.2.2 Diagnostic Class II
5.2.2.1 Transport protocol
5.2.2.2 Diagnostic services
5.2.3 Diagnostic Class III
5.2.3.1 Addressing
5.2.3.2 Transport protocol
5.2.3.3 Diagnostic services
5.2.4 Summary of slave node classes
5.2.5 Master node requirements
5.2.5.1 Transport protocol
5.2.5.2 Fault management, sensor reading, I/O control
5.2.6 User defined diagnostics
5.3 Requirements for Signal based Diagnostics
5.4 Transport Protocol handling in LIN- master
5.4.1 Diagnostic master request schedule
5.4.2 Diagnostic slave response schedule
5.4.3 Diagnostic schedule execution
5.4.3.1 Diagnostics Interleaved Mode
5.4.3.2 Diagnostics Only Mode
5.4.4 Transmission handler requirements
5.4.4.1 Master node transmission handler
5.5 Slave node transmission handler
5.6 Slave diagnostic timing requirements
Physical Layer Specification
6.1 Introduction
6.2 Physical Layer Compatibility
6.3 Bit rate Tolerance
6.4 Timing Requirements
6.4.1 Bit Timing Requirements
6.4.2 Synchronization Procedure
6.4.3 Bit Sample Timing
6.5 Line Driver/Receiver
6.5.1 General Configuration
6.5.2 Definition of Supply Voltages for the Physical Interface
6.5.3 Signal Specification
6.5.4 Electrical DC parameters
6.5.4.1 Electrical AC Parameters
6.5.5 Line Characteristics
6.5.6 Performance in non-operation supply voltage range
6.5.7 Performance during fault modes
6.5.7.1 Loss of supply voltage connection or ground connection
6.5.7.2 Bus wiring short to battery or ground
6.5.8 ESD/EMI compliance
Application Program Interface Specification
7.1 Introduction
7.1.0.1 LIN cluster generation
7.1.1 Concept of operation
7.1.1.1 LIN core API
7.1.1.2 LIN node configuration and identification API
7.1.1.3 LIN transport layer API
7.2 Core API
7.2.1 Driver and cluster management
7.2.1.1 l_sys_init
7.2.2 Signal interaction
7.2.2.1 Signal types
7.2.2.2 Scalar signal read
7.2.2.3 Scalar signal write
7.2.2.4 Byte array read
7.2.2.5 Byte array write
7.2.3 Notification
7.2.3.1 l_flg_tst
7.2.3.2 l_flg_clr
7.2.4 Schedule management
7.2.4.1 l_sch_tick
7.2.4.2 l_sch_set
7.2.5 Interface management
7.2.5.1 l_ifc_init
7.2.5.2 l_ifc_goto_sleep
7.2.5.3 l_ifc_wake_up
7.2.5.4 l_ifc_ioctl
7.2.5.5 l_ifc_rx
7.2.5.6 l_ifc_tx
7.2.5.7 l_ifc_aux
7.2.5.8 l_ifc_read_status
7.2.6 User provided call-outs
7.2.6.1 l_sys_irq_disable
7.2.6.2 l_sys_irq_restore
7.3 Node configuration and identification
7.3.1 Node configuration
7.3.1.1 ld_is_ready
7.3.1.2 ld_check_response
7.3.1.3 ld_assign_frame_id_range
7.3.1.4 ld_assign_NAD
7.3.1.5 ld_save_configuration
7.3.1.6 ld_read_configuration
7.3.1.7 ld_set_configuration
7.3.2 ld_conditional_change_NAD
7.3.3 Identification
7.3.3.1 ld_read_by_id
7.3.3.2 ld_read_by_id_callout
7.4 Transport layer
7.4.1 Raw and Cooked API
7.4.2 Initialization
7.4.3 Raw API
7.4.3.1 ld_put_raw
7.4.3.2 ld_get_raw
7.4.3.3 ld_raw_tx_status
7.4.3.4 ld_raw_rx_status
7.4.4 Cooked API
7.4.4.1 ld_send_message
7.4.4.2 ld_receive_message
7.4.4.3 ld_tx_status
7.4.4.4 ld_rx_status
7.5 Examples
7.5.1 Master node example
7.5.2 Slave node example
Node Capability Language Specification
8.1 Introduction
8.1.1 Plug and play workflow
8.1.1.1 LIN cluster Generation
8.1.1.2 LIN cluster design
8.1.1.3 Debugging
8.2 Node capability file definition
8.2.1 Global definition
8.2.1.1 Node capability language version number definition
8.2.2 Node definition
8.2.3 General definition
8.2.3.1 LIN protocol version number definition
8.2.3.2 LIN Product Identification
8.2.3.3 Bit rate
8.2.3.4 Sends wake up signal
8.2.4 Diagnostic definition
8.2.5 Frame definition
8.2.5.1 Frame properties
8.2.5.2 Signal definition
8.2.5.3 Signal encoding type definition
8.2.6 Status management
8.2.7 Free text definition
8.3 Overview of Syntax
8.4 Example file
Configuration Language Specification
9.1 Introduction
9.2 LIN description file definition
9.2.1 Global definition
9.2.1.1 LIN protocol version number definition
9.2.1.2 LIN language version number definition
9.2.1.3 LIN speed definition
9.2.1.4 Channel postfix name definition
9.2.2 Node definition
9.2.2.1 Participating nodes
9.2.2.2 Node attributes
9.2.2.3 Node composition definition
9.2.3 Signal definition
9.2.3.1 Standard signals
9.2.3.2 Diagnostic signals
9.2.3.3 Signal groups
9.2.4 Frame definition
9.2.4.1 Unconditional frames
9.2.4.2 Sporadic frames
9.2.4.3 Event triggered frames
9.2.4.4 Diagnostic frames
9.2.5 Schedule table definition
9.2.6 Additional information
9.2.6.1 Signal encoding type definition
9.2.6.2 Signal representation definition
9.3 Overview of Syntax
9.4 Examples
9.4.1 LIN description file
LIN Specification Package Revision 2.1 November 24, 2006; Page 1 LIN Specification Package Revision 2.1 © LIN Consortium, 2006. This specification as released by the LIN Consortium is intended for the purpose of information only and is provided on an "AS IS" basis only and cannot be the basis for any claims. The LIN Consortium will not be liable for any use of this Specification. The unauthorized use, e.g. copying, displaying or other use of any content from this docu- ment is a violation of the law and intellectual property rights. LIN is a registered Trademark ®. All rights reserved. All distributions are registered. Website: www.lin-subbus.org Contact: Technical-Contact@lin-subbus.org m o c . j 3 6 1 @ 7 2 0 1 3 8 _ x l r o f y p o c d e r e t s g e R i
REVISION HISTORY Date Issue LIN 1.0 LIN 1.1 LIN 1.2 LIN 1.3 LIN 2.0 1999-07-01 2000-03-06 2000-11-17 2002-12-13 2003-09-16 LIN Specification Package Revision 2.1 November 24, 2006; Page 2 Remark Initial Version of the LIN Specification Major Revision Step LIN 2.1 2006-11-24 Clarifications, configuration modified, transport layer enhanced and diagnostics added. Website: www.lin-subbus.org Contact: Technical-Contact@lin-subbus.org m o c . j 3 6 1 @ 7 2 0 1 3 8 _ x l r o f y p o c d e r e t s g e R i
LIN Specification Package Revision 2.1 November 24, 2006; Page 3 TABLE OF CONTENTS Specification Package 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.5.1 1.1.5.2 1.1.5.3 1.1.5.4 1.1.6 1.1.7 1.1.7.1 1.1.7.2 1.1.7.3 1.1.7.4 1.1.8 1.2 LIN ....................................................................................................10 Scope ...........................................................................................10 Features and possibilities .............................................................10 Work flow concept ........................................................................11 Node concept ...............................................................................12 Concept of operation ....................................................................12 Master and slave ..........................................................................12 Frames .........................................................................................13 Data transport...............................................................................13 Schedule table..............................................................................14 Document overview ......................................................................14 History and background................................................................14 Compatibility with LIN 1.3 .............................................................15 Compatibility with LIN 2.0 .............................................................16 Changes between LIN 1.3 and LIN 2.0 ........................................17 Changes between LIN 2.0 and LIN 2.1 ........................................17 References ...................................................................................18 LIN Glossary .....................................................................................19 Protocol Specification 2.1 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.3 2.3.1 2.3.1.1 2.3.1.2 2.3.1.3 2.3.1.4 2.3.1.5 2.3.2 2.3.3 2.3.3.1 2.3.3.2 Introduction .......................................................................................24 Signal Management..........................................................................25 Signal types ..................................................................................25 Signal consistency........................................................................25 Signal packing ..............................................................................25 Signal reception and transmission................................................26 Frame Transfer .................................................................................28 Frame structure ............................................................................28 Break field.....................................................................................29 Sync byte field ..............................................................................29 Protected identifier field ................................................................30 Data ..............................................................................................30 Checksum.....................................................................................31 Frame length ................................................................................31 Frame types..................................................................................32 Unconditional frame......................................................................32 Event triggered frame ...................................................................32 Website: www.lin-subbus.org Contact: Technical-Contact@lin-subbus.org m o c . j 3 6 1 @ 7 2 0 1 3 8 _ x l r o f y p o c d e r e t s g e R i
LIN Specification Package Revision 2.1 November 24, 2006; Page 4 2.3.3.3 2.3.3.4 2.3.3.5 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.5.2 2.5.2.1 2.5.2.2 2.6 2.6.1 2.6.2 2.6.3 2.7 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 Sporadic frame .............................................................................35 Diagnostic frames.........................................................................36 Reserved frames ..........................................................................37 Schedule tables ................................................................................38 Time definitions ............................................................................38 frame Slot .....................................................................................38 Schedule table handling ...............................................................39 Task Behavior Model ........................................................................40 Master task state machine............................................................40 Slave task state machine..............................................................40 Break/sync field sequence detector..............................................40 Frame processor ..........................................................................41 Network Management.......................................................................44 slave communication state diagram .............................................44 Wake up .......................................................................................45 Go to sleep ...................................................................................46 Status Management..........................................................................47 Concept ........................................................................................47 Event triggered frames .................................................................47 Reporting to the cluster ................................................................47 Reporting within own node ...........................................................48 Appendices .......................................................................................49 Table of numerical properties .......................................................49 Table of valid frame identifiers......................................................50 Example of checksum calculation ................................................52 Syntax and mathematical symbols used in this standard.............53 Transport Layer Specification 3.1 3.2 3.2.1 3.2.1.1 3.2.1.2 3.2.1.3 3.2.1.4 3.2.1.5 3.2.1.6 3.2.2 3.2.2.1 3.2.2.2 3.2.3 Introduction .......................................................................................55 Transport layer..................................................................................56 PDU structure ...............................................................................56 Overview.......................................................................................57 NAD ..............................................................................................57 PCI................................................................................................57 LEN...............................................................................................58 SID................................................................................................58 D1 to D6 .......................................................................................58 Communication.............................................................................58 Single Frame Transmission..........................................................59 Multiple Frame Transmission .......................................................59 Error Handling ..............................................................................59 Website: www.lin-subbus.org Contact: Technical-Contact@lin-subbus.org m o c . j 3 6 1 @ 7 2 0 1 3 8 _ x l r o f y p o c d e r e t s g e R i
LIN Specification Package Revision 2.1 November 24, 2006; Page 5 3.2.4 3.2.5 Defined requests ..........................................................................60 timing constraints..........................................................................60 Node configuration and Identification Specification 4.1 4.2 4.2.1 4.2.1.1 4.2.2 4.2.2.1 4.2.3 4.2.3.1 4.2.3.2 4.2.3.3 4.2.3.4 4.2.3.5 4.2.3.6 4.2.4 4.2.5 4.2.5.1 4.2.5.2 4.2.5.3 4.2.5.4 4.2.5.5 4.2.6 4.2.6.1 Introduction .......................................................................................64 Node configuration and identification................................................65 LIN product identification ..............................................................65 Wildcards......................................................................................65 Slave Node model ........................................................................66 Initial NAD.....................................................................................67 PDU structure ...............................................................................68 Overview.......................................................................................69 NAD ..............................................................................................69 PCI................................................................................................69 SID................................................................................................70 RSID .............................................................................................70 D1 to D5 .......................................................................................70 Node configuration and identification ...........................................71 Node configuration services .........................................................71 Assign NAD ..................................................................................71 Conditional change NAD ..............................................................72 Data dump ....................................................................................73 Save Configuration .......................................................................73 Assign frame ID range..................................................................74 Identification .................................................................................75 Read by identifier..........................................................................75 Diagnostic specification 5.1 5.1.1 5.1.2 5.1.3 5.2 5.2.1 5.2.1.1 5.2.1.2 5.2.2 5.2.2.1 5.2.2.2 5.2.3 5.2.3.1 Introduction .......................................................................................78 using the transport layer ...............................................................78 LIN master ....................................................................................79 slave nodes ..................................................................................79 Diagnostic classes ............................................................................80 Diagnostic Class I.........................................................................80 Transport protocol ........................................................................80 Diagnostic services.......................................................................80 Diagnostic Class II........................................................................80 Transport protocol ........................................................................80 Diagnostic services.......................................................................81 Diagnostic Class III.......................................................................81 Addressing....................................................................................81 Website: www.lin-subbus.org Contact: Technical-Contact@lin-subbus.org m o c . j 3 6 1 @ 7 2 0 1 3 8 _ x l r o f y p o c d e r e t s g e R i
LIN Specification Package Revision 2.1 November 24, 2006; Page 6 5.2.3.2 5.2.3.3 5.2.4 5.2.5 5.2.5.1 5.2.5.2 5.2.6 5.3 5.4 5.4.1 5.4.2 5.4.3 5.4.3.1 5.4.3.2 5.4.4 5.4.4.1 5.5 5.6 Transport protocol ........................................................................81 Diagnostic services.......................................................................82 Summary of slave node classes...................................................82 Master node requirements............................................................83 Transport protocol ........................................................................83 Fault management, sensor reading, I/O control ...........................83 User defined diagnostics ..............................................................84 Requirements for Signal based Diagnostics.....................................85 Transport Protocol handling in LIN-master .......................................87 Diagnostic master request schedule ............................................87 Diagnostic slave response schedule ............................................88 Diagnostic schedule execution .....................................................89 Diagnostics Interleaved Mode ......................................................90 Diagnostics Only Mode.................................................................92 Transmission handler requirements .............................................94 Master node transmission handler ...............................................95 Slave node transmission handler....................................................100 Slave diagnostic timing requirements .............................................104 Physical Layer Specification 6.1 6.2 6.3 6.4 6.4.1 6.4.2 6.4.3 6.5 6.5.1 6.5.2 6.5.3 6.5.4 6.5.4.1 6.5.5 6.5.6 6.5.7 6.5.7.1 6.5.7.2 6.5.8 Introduction .....................................................................................107 Physical Layer Compatibility...........................................................108 Bit rate Tolerance ...........................................................................109 Timing Requirements......................................................................111 Bit Timing Requirements ............................................................111 Synchronization Procedure ........................................................111 Bit Sample Timing ......................................................................111 Line Driver/Receiver .......................................................................114 General Configuration ................................................................114 Definition of Supply Voltages for the Physical Interface .............114 Signal Specification ....................................................................116 Electrical DC parameters............................................................117 Electrical AC Parameters ...........................................................119 Line Characteristics ....................................................................121 Performance in non-operation supply voltage range..................122 Performance during fault modes ................................................122 Loss of supply voltage connection or ground connection...........122 Bus wiring short to battery or ground..........................................122 ESD/EMI compliance..................................................................123 Application Program Interface Specification Website: www.lin-subbus.org Contact: Technical-Contact@lin-subbus.org m o c . j 3 6 1 @ 7 2 0 1 3 8 _ x l r o f y p o c d e r e t s g e R i
LIN Specification Package Revision 2.1 November 24, 2006; Page 7 7.1 7.1.0.1 7.1.1 7.1.1.1 7.1.1.2 7.1.1.3 7.2 7.2.1 7.2.1.1 7.2.2 7.2.2.1 7.2.2.2 7.2.2.3 7.2.2.4 7.2.2.5 7.2.3 7.2.3.1 7.2.3.2 7.2.4 7.2.4.1 7.2.4.2 7.2.5 7.2.5.1 7.2.5.2 7.2.5.3 7.2.5.4 7.2.5.5 7.2.5.6 7.2.5.7 7.2.5.8 7.2.6 7.2.6.1 7.2.6.2 7.3 7.3.1 7.3.1.1 7.3.1.2 7.3.1.3 7.3.1.4 7.3.1.5 7.3.1.6 7.3.1.7 Introduction .....................................................................................125 LIN cluster generation ................................................................125 Concept of operation ..................................................................125 LIN core API ...............................................................................125 LIN node configuration and identification API.............................126 LIN transport layer API ...............................................................126 Core API .........................................................................................127 Driver and cluster management .................................................127 l_sys_init.....................................................................................127 Signal interaction ........................................................................127 Signal types ................................................................................128 Scalar signal read.......................................................................128 Scalar signal write ......................................................................128 Byte array read ...........................................................................129 Byte array write...........................................................................129 Notification..................................................................................130 l_flg_tst .......................................................................................130 l_flg_clr .......................................................................................131 Schedule management...............................................................131 l_sch_tick....................................................................................131 l_sch_set ....................................................................................132 Interface management................................................................133 l_ifc_init.......................................................................................133 l_ifc_goto_sleep..........................................................................134 l_ifc_wake_up.............................................................................134 l_ifc_ioctl.....................................................................................135 l_ifc_rx ........................................................................................135 l_ifc_tx ........................................................................................136 l_ifc_aux .....................................................................................137 l_ifc_read_status ........................................................................137 User provided call-outs...............................................................140 l_sys_irq_disable ........................................................................140 l_sys_irq_restore ........................................................................141 Node configuration and identification..............................................142 Node configuration .....................................................................142 ld_is_ready .................................................................................142 ld_check_response.....................................................................143 ld_assign_frame_id_range .........................................................143 ld_assign_NAD...........................................................................144 ld_save_configuration.................................................................144 ld_read_configuration .................................................................145 ld_set_configuration ...................................................................145 Website: www.lin-subbus.org Contact: Technical-Contact@lin-subbus.org m o c . j 3 6 1 @ 7 2 0 1 3 8 _ x l r o f y p o c d e r e t s g e R i
LIN Specification Package Revision 2.1 November 24, 2006; Page 8 7.3.2 7.3.3 7.3.3.1 7.3.3.2 7.4 7.4.1 7.4.2 7.4.3 7.4.3.1 7.4.3.2 7.4.3.3 7.4.3.4 7.4.4 7.4.4.1 7.4.4.2 7.4.4.3 7.4.4.4 7.5 7.5.1 7.5.2 ld_conditional_change_NAD ......................................................146 Identification ...............................................................................147 ld_read_by_id .............................................................................147 ld_read_by_id_callout.................................................................148 Transport layer................................................................................149 Raw and Cooked API .................................................................149 Initialization.................................................................................149 Raw API......................................................................................150 ld_put_raw ..................................................................................150 ld_get_raw ..................................................................................150 ld_raw_tx_status.........................................................................151 ld_raw_rx_status ........................................................................151 Cooked API ................................................................................152 ld_send_message ......................................................................152 ld_receive_message...................................................................153 ld_tx_status ................................................................................154 ld_rx_status ................................................................................154 Examples ........................................................................................156 Master node example .................................................................156 Slave node example ...................................................................158 Node Capability Language Specification 8.1 8.1.1 8.1.1.1 8.1.1.2 8.1.1.3 8.2 8.2.1 8.2.1.1 8.2.2 8.2.3 8.2.3.1 8.2.3.2 8.2.3.3 8.2.3.4 8.2.4 8.2.5 8.2.5.1 8.2.5.2 8.2.5.3 Introduction .....................................................................................162 Plug and play workflow...............................................................162 LIN cluster Generation................................................................162 LIN cluster design.......................................................................163 Debugging ..................................................................................163 Node capability file definition ..........................................................164 Global definition..........................................................................164 Node capability language version number definition ..................164 Node definition............................................................................164 General definition .......................................................................164 LIN protocol version number definition .......................................165 LIN Product Identification ...........................................................165 Bit rate ........................................................................................165 Sends wake up signal.................................................................165 Diagnostic definition ...................................................................165 Frame definition..........................................................................166 Frame properties ........................................................................167 Signal definition ..........................................................................167 Signal encoding type definition...................................................168 Website: www.lin-subbus.org Contact: Technical-Contact@lin-subbus.org m o c . j 3 6 1 @ 7 2 0 1 3 8 _ x l r o f y p o c d e r e t s g e R i
分享到:
收藏