This section covers the functionality of the LIN Stack middleware layer in S32 SDK.
LIN Stack is a Middleware package that supports the LIN 2.1 and above, LIN2.1 and J2602 specifications.
In LIN Stack, LIN 2.1 covers all LIN 2.1, LIN 2.2 and LIN 2.2A specifications, as the changes following LIN 2.1 are only spelling corrections and clarifications.
LIN Stack:
The layered architecture of the LIN Stack is shown on Figure 1. Such architecture aims maximum reusability of common code base for LIN2.1 and J2602 specifications for S32 Freescale automotive MCU portfolio.
The core API layer of LIN2.1/ J2602 handles initialization, processing and signal based interaction between applications and LIN Core.
The LIN2.1 TL (Transport Layer) provides methods for diagnostic services.
The low level layer offers methods for handling signal transmission between user applications and hardware such as interface initialization and deinitialization, frame header sending, response receiving, etc. The low level layer is builded on top of LIN Driver which is builded on top of LPUART HAL layer in the current release.
Node Configuration Tool:
To generate configuration files, users can use the Node Configuration Tool that is LIN Stack PEX component which allows to parse existed LDF files and reflect their contents to LIN Stack component GUI, to create new LDF files, to configure LIN cluster definitions and Node definitions. Using LIN Stack PEX component, users can easily generate the node configuration files (lin_cfg.h and lin_cfg.c) that are needed for LIN Stack to work properly.
Figure 2. Shows the diagram of configuration data flow.
The LDF files describe complete LIN cluster definition including Master/slave mode definition, signals, frames, schedules, timing, etc.
Modules | |
Diagnostic services | |
Diagnostic services defines methods to implement diagnostic data transfer between a master node connected with a diagnostic tester and the slave nodes. | |
LIN Core API | |
The LIN core API handles initialization, processing and a signal based interaction between the application and the LIN core. Refer to chapter 7, LIN 2.2A specification. | |
Low level API | |
Low level layer consists of functions that call LIN driver API. | |
Transport layer API | |
Transport layer stands between the application layer and the core API layer. | |