DEENESPTFRRUARHIKOZHNL

AUTOSAR Classic LIN

Das LIN-Cluster umfasst Low-Cost-Subbus-Kommunikation für Karosserie- und Komfortfunktionen inklusive Treiber, LinIf-Schedule-Tabellen-Handling, Transceiver-Steuerung und State-Management.

Lin

This function checks if a wakeup has occurred on the addressed LIN channel.

Std_ReturnType Lin_CheckWakeup (uint8 Channel);
Lin_GetStatus function

Service Lin_GetStatus.

Lin_StatusType Lin_GetStatus (uint8 Channel, const uint8* * Lin_SduPtr);

Returns the version information of this module.

void Lin_GetVersionInfo (Std_VersionInfoType* versioninfo);
Lin_GoToSleep function

The service instructs the driver to transmit a go - to - sleep - command on the addressed LIN channel. Only used for LIN master nodes.

Std_ReturnType Lin_GoToSleep (uint8 Channel);

Sets the channel state to LIN_ CH_ SLEEP, enables the wake - up detection and optionally sets the LIN hardware unit to reduced power operation mode (if supported by HW).

Std_ReturnType Lin_GoToSleepInternal (uint8 Channel);
Lin_Init function

Initializes the LIN module.

void Lin_Init (const Lin_ConfigType* Config);
Lin_SendFrame function

Sends a LIN header and a LIN response, if necessary. The direction of the frame response (master response, slave response, slave - to - slave communication) is provided by the Pdu Info Ptr. Only used for LIN master nodes.

Std_ReturnType Lin_SendFrame (uint8 Channel, const Lin_PduType* PduInfoPtr);
Lin_Wakeup function

Generates a wake up pulse and sets the channel state to LIN_ CH_ OPERATIONAL.

Std_ReturnType Lin_Wakeup (uint8 Channel);

Sets the channel state to LIN_ CH_ OPERATIONAL without generating a wake up pulse.

Std_ReturnType Lin_WakeupInternal (uint8 Channel);

This is the type of the external data structure containing the overall initialization data for the LIN driver and the SFR settings affecting the LIN channels. A pointe r to such a structure is provided to the LIN driver initialization routine for configuration of the driver, LIN hardware unit and LIN hardware channels.

This type is used to specify the Checksum model to be used for the LIN Frame.

This type is used to specify the number of SDU data bytes to copy.

Represents all valid protected identifier used by Lin_ Send Frame().

Thi s type is used to specify whether the frame processor is required to transmit the response part of the LIN frame.

This Type is used to provide PID, checksum model, data length and SDU pointer from the LIN Interface to the LIN driver.

This type represents the slave error types that are detected during header reception and response transmission / reception.

LIN operation states for a LIN channel or frame, as returned by the API service Lin_ Get Status().

LinIf

Notifies the change of the response error signal with the new value. Only applicable for LIN slave nodes. AUTOSAR CP R20 - of Document ID : AUTOSAR_ SWS_ LINInterface

void <User_ResponseErrorSignalChanged> (NetworkHandleType Channel, boolean RespErrSigValue);

Indication of a received PDU from a lower layer communication interface module.

void <User_RxIndication> (PduIdType RxPduId, const PduInfoType* PduInfoPtr);

Notifies the reception of a Save Configuration request. Only applicable for LIN slave nodes.

boolean <User_SaveConfigurationRequest> (NetworkHandleType Channel);

Within this API, the upper layer module (called module) shall check whether the available data fits into the b uffer size reported by Pdu Info Ptr - >Sdu Length. If it fits, it shall copy its data into the buffer provided by Pdu Info Ptr - >Sdu Data Ptr and update the length of the actual copied data in Pdu Info Ptr - >Sdu Length. If not, it returns E_ NOT_ OK without ch anging Pdu Info Ptr.

Std_ReturnType <User_TriggerTransmit> (PduIdType TxPduId, PduInfoType* PduInfoPtr);

The lower layer communication interface module confirms the transmission of a PDU, or the failure to transmit a PDU.

void <User_TxConfirmation> (PduIdType TxPduId, Std_ReturnType result);

Will be called when the Ecu M has been notified about a wakeup on a specific LIN channel.

Std_ReturnType LinIf_CheckWakeup (EcuM_WakeupSourceType WakeupSource);

Enables or disables mirroring for a LIN channel.

Std_ReturnType LinIf_EnableBusMirroring (NetworkHandleType Channel, boolean MirroringActive);

Reports the current configured NAD. Only applicable for LIN slave nodes.

Std_ReturnType LinIf_GetConfiguredNAD (NetworkHandleType Channel, uint8* Nad);

Retrieves all assigned PID values. The order is congruent to the LIN frame index. Only applicable for LIN slave nodes.

Std_ReturnType LinIf_GetPIDTable (NetworkHandleType Channel, Lin_FramePidType* PidBuffer, uint8* PidBufferLength);

Returns the actual sta te of a LIN Transceiver Driver.

Std_ReturnType LinIf_GetTrcvMode (NetworkHandleType Channel, LinTrcv_TrcvModeType* TransceiverModePtr);

Returns the reason for the wake up that has been detected by the LIN Transceiver Driver.

Std_ReturnType LinIf_GetTrcvWakeupReason (NetworkHandleType Channel, LinTrcv_TrcvWakeupReasonType* TrcvWuReasonPtr);

Returns the version information of this module.

void LinIf_GetVersionInfo (Std_VersionInfoType* versioninfo);

Initiates a transition into the Sleep Mode on the selected channel.

Std_ReturnType LinIf_GotoSleep (NetworkHandleType Channel);

The LIN Driver will call this function to report a received LIN header. This function is only applicable for LIN slave nodes (available only if the ECU has any LIN slave channel).

Std_ReturnType LinIf_HeaderIndication (NetworkHandleType Channel, Lin_PduType* PduPtr);
LinIf_Init function

Initializes the LIN Interface.

void LinIf_Init (const LinIf_ConfigType* ConfigPtr);

The LIN Driver will call this function to report a detected error event during header or response processing. This function is only applicable for LIN slave nodes (available only if the ECU has any LIN slave channel).

void LinIf_LinErrorIndication (NetworkHandleType Channel, Lin_SlaveErrorType ErrorStatus);

The LIN Driver will call this function to report a successfully received response and provides the reception data to the LIN Interface. This function is only applicable for LIN slave nodes (available only if the ECU has any LIN slave channel).

void LinIf_RxIndication (NetworkHandleType Channel, uint8* Lin_SduPtr);

Requests a schedule table to be executed. Only used for LIN master nodes.

Std_ReturnType LinIf_ScheduleRequest (NetworkHandleType Channel, LinIf_SchHandleType Schedule);

Sets the current configured NAD. Only applicable for LIN slave nodes.

Std_ReturnType LinIf_SetConfiguredNAD (NetworkHandleType Channel, uint8 Nad);

Sets all assigned PID values. The order is congruent to the LIN frame index. Only applicable for LIN slave nodes.

Std_ReturnType LinIf_SetPIDTable (NetworkHandleType Channel, Lin_FramePidType* PidBuffer, uint8 PidBufferLength);

Set the given LIN transceiver to the given mode.

Std_ReturnType LinIf_SetTrcvMode (NetworkHandleType Channel, LinTrcv_TrcvModeType TransceiverMode);

This API enables, disables and cl ears the notification for wakeup events on the addressed network

Std_ReturnType LinIf_SetTrcvWakeupMode (NetworkHandleType Channel, LinTrcv_TrcvWakeupModeType LinTrcvWakeupMode);

Re quests transmission of a PDU.

Std_ReturnType LinIf_Transmit (PduIdType TxPduId, const PduInfoType* PduInfoPtr);

The LIN Driver will call this function to report a successfully transmitted response. This function is only applicable for LIN slave nodes (available only if the ECU has any LIN slave channel).

void LinIf_TxConfirmation (NetworkHandleType Channel);
LinIf_Wakeup function

Initiates the wake up process.

Std_ReturnType LinIf_Wakeup (NetworkHandleType Channel);

The LIN Driver or LIN Transceiver Driver will call this function to report the wake up source after the successful wakeup detection during Check Wakeup or after power on by bus.

void LinIf_WakeupConfirmation (EcuM_WakeupSourceType WakeupSource);

Request to change a specific transport protocol parameter (e.g. block size).

Std_ReturnType LinTp_ChangeParameter (PduIdType id, TPParameterType parameter, uint16 value);

Returns the version information of this module.

void LinTp_GetVersionInfo (Std_VersionInfoType* versioninfo);
LinTp_Init function

Initializes the LIN Transport Layer.

void LinTp_Init (const LinTp_ConfigType* ConfigPtr);

Shutdowns the LIN TP.

void LinTp_Shutdown (void);

Requests transmission of a PDU.

Std_ReturnType LinTp_Transmit (PduIdType TxPduId, const PduInfoType* PduInfoPtr);

A pointer to an instance of this structure will be used in the initialization of the LIN Interface. The outline of the structure is defined in chapter 10 Configuration Specification.

Index of the schedule table that is selectable and followed by LIN Interface. Value is unique per LIN c hannel/ controller, but not per ECU. The number of schedule tables is limited to 255

This is the base type for the configuration of the LIN Transport Protocol A pointer to an instance of this structure will be used in the initialization of the LIN Transport Protocol. The outline of the structure is defined in chapter 10 Configuration Specification

This type denotes which Schedule table can be requested by LIN TP during diagnostic session

LinSM

Function to query the current communication mode.

Std_ReturnType LinSM_GetCurrentComMode (NetworkHandleType network, ComM_ModeType* mode);

-

void LinSM_GetVersionInfo (Std_VersionInfoType* versioninfo);

The Lin If will call this callback when the go to sleep command is sent successfully or not sent successfully on the network.

void LinSM_GotoSleepConfirmation (NetworkHandleType network, boolean success);

The Lin If will call this callback when the go to sleep command is received on the network or a bus idle timeout occurs. Only applicable for LIN slave nodes.

void LinSM_GotoSleepIndication (NetworkHandleType Channel);
LinSM_Init function

This function initializes the Lin SM.

void LinSM_Init (const LinSM_ConfigType* ConfigPtr);

Periodic function that runs the timers of different request timeouts

void LinSM_MainFunction (void);

Requesting of a communication mode. The mode switch will not be made instant. The Lin SM will notify the caller when mode transition is made.

Std_ReturnType LinSM_RequestComMode (NetworkHandleType network, ComM_ModeType mode);

The upper layer requests a schedule table to be changed on one LIN network.

Std_ReturnType LinSM_ScheduleRequest (NetworkHandleType network, LinIf_SchHandleType schedule);

The Lin If module will call this callback when the new requested schedule table is active.

void LinSM_ScheduleRequestConfirmation (NetworkHandleType network, LinIf_SchHandleType schedule);

The Lin If will call this callback when the wake up signal command is sent not successfully/ successfully on the network.

void LinSM_WakeupConfirmation (NetworkHandleType network, boolean success);

Data structure type for the post - build configuration parameters.

Type used to report the current mode to the Bsw M

LinTrcv

Service LinTrcv_CheckWakeup.

Std_ReturnType LinTrcv_CheckWakeup (uint8 LinNetwork);

This API provides the reason for the wakeup that the LIN transceiver has detected in the parameter "Reason". The ability to dete ct and differentiate the possible wakeup reasons depends strongly on the LIN transceiver hardware.

Std_ReturnType LinTrcv_GetBusWuReason (uint8 LinNetwork, LinTrcv_TrcvWakeupReasonType* Reason);

API detects the actual software state of LIN transceiver driv er.

Std_ReturnType LinTrcv_GetOpMode (uint8 LinNetwork, LinTrcv_TrcvModeType* OpMode);

This service provides the version information of this module through the parameter "versioninfo".

void LinTrcv_GetVersionInfo (Std_VersionInfoType* versioninfo);
LinTrcv_Init function

Initializes the Lin Transceiver Driver module.

void LinTrcv_Init (const LinTrcv_ConfigType* ConfigPtr);

The internal state of the LIN transceiver driver is switched to mode given in the parameter Op Mode.

Std_ReturnType LinTrcv_SetOpMode (uint8 LinNetwork, LinTrcv_TrcvModeType OpMode);

This API enables, disables and clears the notification for wakeup events on the addressed network. A vailable via Lin Trcv.h

Std_ReturnType LinTrcv_SetWakeupMode (uint8 LINNetwork, LinTrcv_TrcvWakeupModeType TrcvWakupMode);

Configuration data structure of the Lin Trcv module. AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_LINTransceiverDriver

Operating modes of the LIN Transceiver Driver

Wake up operating modes of the LIN Transceiver Driver.

This type denotes the wake up reason detected by the LIN transceiver in detail.

Cluster guideAI-GENERATED

Enables cost-effective networking of sensors and actuators via the Local Interconnect Network in the vehicle.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 01a9cd8d631b Provenance Open questions (2)
Causal anchor: R20-11 Valid from R20-11 Synthesized for this specification release.
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Enables cost-effective networking of sensors and actuators via the Local Interconnect Network in the vehicle.

The LIN Communication module cluster realizes the standardized connection of LIN sub-bus systems via the modules LinSM, LinIf, LinTrcv, and Lin (SWS COMManager p. 19). It controls the schedule-based transmission of frames on masters as well as reactive header evaluation and data transmission on slaves ([SWS_LinIf_91004], [SWS_Lin_00168]). At the same time, the cluster coordinates the orderly transition between full communication and sleep mode as well as autonomous error handling via the response_error signal ([SWS_LinIf_00763]).

The LIN Communication module cluster provides the complete AUTOSAR implementation of the LIN protocol and comprises the state manager LinSM, the interface LinIf (including the transport protocol LinTp), the transceiver driver LinTrcv, and the MCAL driver Lin (SWS COMManager p. 19). It connects subnetworks, sensors, and actuators to the AUTOSAR communication matrix and strictly distinguishes between master nodes with autonomous schedule processing and purely reactively responding slave nodes ([SWS_LinIf_00197], [SWS_Lin_00272]).

Architecture diagram: Layered architecture and interface relationships of the LIN cluster between communication services, abstraction layer, and MCAL. Sources: SWS COMManager p. 19, AUTOSAR SWS LINInterface p. 133.

Data transmission on master ECUs is performed by periodically triggering the driver via Lin_SendFrame and subsequent status polling via Lin_GetStatus ([SWS_Lin_00168]). On the slave, in contrast, the detection of a header in the driver triggers the synchronous callback LinIf_HeaderIndication ([SWS_LinIf_91004]). The interface decides on reception, response, or ignoring based on the PID and acknowledges completion via LinIf_RxIndication or LinIf_TxConfirmation ([SWS_LinIf_91005], [SWS_LinIf_91006]). Diagnostic messages are handled by the integrated LinTp via automated schedule table switching ([SWS_LinIf_00641]).

During the operating cycle, LinSM coordinates the state transitions between LINSM_NO_COM and LINSM_FULL_COM ([SWS_LinSM_00026], [SWS_LinSM_00032]). Wake-up is performed via a bus pulse via Lin_Wakeup ([SWS_Lin_00169]). The transition to sleep mode is initiated on the master by actively transmitting a sleep frame, on the slave upon reception of the sleep command or upon bus idle via LinIf_GotoSleep, Lin_GoToSleepInternal, and transceiver sleep control ([SWS_LinSM_00231], [SWS_LinIf_00757]).

Go-to-sleep sequence on a LIN slaveComMLinSMLinIfLin DriverLinTrcvBswMLinSM_RequestComMode(COMM_NO_COMMUNICATION)E_OK (Modus vorgemerkt)Use Case: Bus sleep event (sleep frame or bus idle)LinSM_GotoSleepIndication(Channel)LinIf_GotoSleep(Channel)Lin_GoToSleepInternal(Channel)E_OK (LIN_CH_SLEEP aktiv)optTransceiver Driver konfiguriertLinTrcv_SetOpMode(LINTRCV_TRCV_MODE_SLEEP)E_OKLinSM_GotoSleepConfirmation(Channel, success=TRUE)State = LINSM_NO_COMComM_BusSM_ModeIndication(COMM_NO_COMMUNICATION)BswM_LinSM_CurrentState(LINSM_NO_COM)

Sequence diagram: Interaction of BSW modules when a LIN slave enters sleep state following a bus sleep signal. Sources: [SWS_LinSM_91000], [SWS_LinSM_00231], [SWS_LinIf_00757], AUTOSAR SWS LINStateManager p. 48.

Communication errors are detected on slaves via LinIf_LinErrorIndication and reported autonomously to the master in the response_error signal ([SWS_LinIf_91007], [SWS_LinIf_00763]). Cross-channel synchronization areas and strict separation between cyclic tasks (LinIf_MainFunction) and driver ISRs ensure system stability ([SWS_LinIf_00384]).

System Architecture & Role of the Module Cluster

In the AUTOSAR Classic basic software stack, the LIN Communication module cluster provides standardized communication via the Local Interconnect Network (LIN) according to ISO 17987. It primarily acts as a cost-efficient sub-bus system for connecting sensors and actuators in the vehicle network (AUTOSAR FO Features p. 58). The cluster spans multiple layers of the AUTOSAR architecture: The LIN State Manager (LinSM) operates at the Communication Services layer, the LIN Interface (LinIf) including the integrated transport protocol (LinTp) constitutes the Communication Abstraction, the LIN Transceiver Driver (LinTrcv) is part of the ECU Abstraction, and the LIN Driver (Lin) resides as a hardware-oriented module in the Microcontroller Abstraction Layer (MCAL) (SWS COMManager p. 19).

Architecturally, the cluster strictly differentiates between master and slave nodes. A LIN master autonomously controls the bus traffic via schedule tables and generates all headers, whereas LIN slaves respond purely reactively to received headers or evaluate signals ([SWS_LinIf_00197], [SWS_Lin_00272]). For diagnostic and transport tasks according to ISO 14229, the LIN Interface encapsulates the TP functionality, which handles segmented diagnostic messages (Master Request Frame MRF and Slave Response Frame SRF) via PduR and DCM ([SWS_LinIf_00351], [SWS_LinIf_00629]). Externally, the cluster interacts intensively with the Communication Manager (ComM), the Basic Software Mode Manager (BswM), the PDU Router (PduR), and the ECU State Manager (EcuM) (SWS COMManager p. 19).

Architecture diagram: Layered architecture and interface relationships of the LIN cluster between communication services, abstraction layer, and MCAL. Sources: SWS COMManager p. 19, AUTOSAR SWS LINInterface p. 133.

Interplay & Interaction Paths Between the Modules

The interaction paths in the cluster differ fundamentally depending on the node role. In the LIN master, the LIN Interface initiates the processing of the active schedule table via its periodic task. For transmit frames that are due, LinIf fetches the payload via upper-layer trigger-transmit mechanisms and passes the Lin_PduType structure to the LIN driver via Lin_SendFrame ([SWS_Lin_00232], SWS LINInterface p. 37). The driver transmits the header and data in a non-blocking manner ([SWS_Lin_00027]). After the maximum frame transmission time has elapsed, LinIf determines the transmission result via Lin_GetStatus ([SWS_Lin_00168], SWS LINInterface p. 35). For receive slots, LinIf retrieves the data stored in the buffer by the driver and forwards it to the upper layers ([SWS_Lin_00233]).

On a LIN slave, the data path operates event-driven: If the MCAL driver Lin detects a valid break, synch, and PID header on the hardware, it synchronously calls the callback LinIf_HeaderIndication ([SWS_Lin_00280], [SWS_LinIf_91004]). The interface validates the protected identifier (PID) using the internal PID table ([SWS_LinIf_00816], [SWS_LinIf_00823]). If it is a transmit frame, LinIf retrieves the payload, configures the response type to LIN_FRAMERESPONSE_TX, and provides the data to the driver in the buffer ([SWS_Lin_00230]). If the frame is configured as receive, the driver reports success via LinIf_RxIndication ([SWS_LinIf_91005]) after complete byte reception, whereupon LinIf passes the data on to the PDU Router. Confirmations of transmitted slave responses occur via LinIf_TxConfirmation ([SWS_LinIf_91006]).

In addition, transceiver control is transparently encapsulated via the LIN Interface: The interface synchronously forwards mode requests such as LinIf_SetTrcvMode to LinTrcv_SetOpMode ([SWS_LinIf_00544], [SWS_LinTrcv_00002]). During transport protocol transactions, LinTp controls the targeted switching of the master's schedule table between application mode (LINTP_APPLICATIVE_SCHEDULE), diagnostic request (LINTP_DIAG_REQUEST), and diagnostic response (LINTP_DIAG_RESPONSE) via BswM_LinTp_RequestMode ([SWS_LinIf_00641], [SWS_LinIf_00642], [SWS_LinIf_00643]).

LIN-Slave Frame-Verarbeitung (Rx / Tx)LinController UARTLin DriverLinIfPduR LSduRInterrupt (Header empfangen)LinIf_HeaderIndication(Channel, PduPtr)EvaluatePID(PduPtr->Pid)altResponse is transmit data (TX)LSduR_LinIfTriggerTransmit(PduInfoPtr)E_OK (Sendedaten bereitgestellt)PduPtr->Drc = LIN_FRAMERESPONSE_TXE_OK (PduPtr konfiguriert)Transmit Response BytesInterrupt (Tx Complete)LinIf_TxConfirmation(Channel)Response is receive data (RX)PduPtr->Drc = LIN_FRAMERESPONSE_RXE_OK (ready for reception)Interrupt (Rx Complete)LinIf_RxIndication(Channel, SduPtr)LSduR_LinIfRxIndication(Channel, PduInfoPtr)

Sequence diagram: Dynamic control and data flow during header indication, transmit triggering, and reception confirmation on a LIN slave. Sources: [SWS_Lin_00280], [SWS_LinIf_91004], [SWS_LinIf_91005], AUTOSAR SWS LINInterface p. 133.

Synchronization, reentrancy and task contexts

Execution within the module cluster is split across cyclic task contexts and hardware-oriented interrupt levels. The core of the cyclic schedule control in the LIN Interface is the scheduled function LinIf_MainFunction_<LinIfChannel.ShortName>, which must be instantiated separately for each configured LIN channel ([SWS_LinIf_00384], [SWS_LinIf_00725]). It handles the advancement of schedule slots, status polling from the driver, and timeout handling of the transport protocol ([SWS_LinIf_00800], SWS LINInterface p. 119). In parallel, LinSM_MainFunction manages the countdown and confirmation timers for asynchronous channel and wakeup requests ([SWS_LinSM_00162], [SWS_LinSM_00159]).

In contrast to the task level, the driver routines of the MCAL module Lin run in the interrupt context (ISR) when an interrupt-driven controller or a UART interface is present (AUTOSAR CP SWS LINDriver p. 53). The callbacks LinIf_HeaderIndication, LinIf_RxIndication, and LinIf_TxConfirmation are triggered synchronously directly from this ISR context ([SWS_Lin_00280], [SWS_LinIf_91005], [SWS_LinIf_91006]). This requires strict protection of critical sections (Exclusive Areas) in the LIN Interface: Control calls such as LinIf_Transmit, LinIf_GotoSleep, LinIf_ScheduleRequest, or LinIf_Wakeup may only modify internal channel structures while protected against concurrent access from LinIf_MainFunction or ISR callbacks (SWS LINInterface p. 119).

Regarding reentrancy, the API functions of modules LinIf and LinSM are predominantly designed to be reentrant for different channels or networks, but non-reentrant for the same channel ([SWS_LinSM_00126], [SWS_LinIf_00201], [SWS_LinIf_00204]). The driver services in Lin (e.g. Lin_Wakeup, Lin_GoToSleepInternal) behave similarly and must be strictly synchronized per physical channel ([SWS_Lin_00167], [SWS_Lin_00169]). With simple UART hardware lacking a multi-byte FIFO, the LIN driver buffers bytes temporarily in software ([SWS_Lin_00026]), which, Interpretation: is likely to lead to increased CPU interrupt load on slave nodes under high bus load. Question Q-0d07d89d1ade6a01 (open)

Typical lifecycles and operating modes

During system startup, BswM initializes the BSW modules in a defined chain: First, the basic drivers Lin_Init and LinTrcv_Init are initialized, followed by LinIf_Init, LinTp_Init, and finally LinSM_Init (ModemanagementGuide p. 54). LinIf_Init defaults the schedule of all master channels to NULL_SCHEDULE ([SWS_LinIf_00233]) and, on slaves, loads the preconfigured NAD and PID tables ([SWS_LinIf_00767], [SWS_LinIf_00768]). LinSM starts in state LINSM_NO_COM without issuing callbacks to ComM or BswM during initialization ([SWS_LinSM_00026], [SWS_LinSM_00166]).

If ComM requests communication release via LinSM_RequestComMode(COMM_FULL_COMMUNICATION), LinSM directly triggers LinIf_Wakeup and starts a monitoring timer ([SWS_LinSM_00047], [SWS_LinSM_00100]). LinIf transmits the physical wakeup pulse onto the bus via Lin_Wakeup ([SWS_LinIf_00205], [SWS_Lin_00043]). If LinIf reports successful wakeup via LinSM_WakeupConfirmation(success=TRUE), the state transitions to LINSM_FULL_COM ([SWS_LinSM_00049], [SWS_LinSM_00132]). This is signaled to ComM via ComM_BusSM_ModeIndication and to BswM via BswM_LinSM_CurrentState ([SWS_LinSM_00033], [SWS_LinSM_00192]). On slaves, the bus is only considered successfully woken up once the master sends the first LIN header and it is received ([SWS_LinIf_00761], SWS LINStateManager p. 28).

Shutting down into sleep mode (Go-to-Sleep) differs substantially: On a master, request COMM_NO_COMMUNICATION leads to a call to LinIf_GotoSleep ([SWS_LinSM_00036], [SWS_LinSM_10208]). LinIf instructs the driver via Lin_GoToSleep to transmit a standardized Go-to-Sleep frame on the bus ([SWS_Lin_00166], [SWS_Lin_00089]). On a slave, by contrast, the interface receives the Go-to-Sleep command or detects a bus-idle timeout and informs LinSM via LinSM_GotoSleepIndication ([SWS_LinSM_91000]). LinSM then synchronously calls LinIf_GotoSleep ([SWS_LinSM_00231]). The interface switches the driver locally to state LIN_CH_SLEEP via Lin_GoToSleepInternal ([SWS_LinIf_00757], [SWS_Lin_00095]) and puts the transceiver into sleep mode via LinIf_SetTrcvMode(LINTRCV_TRCV_MODE_SLEEP) ([SWS_LinIf_00544], AUTOSAR CP SWS LINInterface p. 137). After the confirmation LinSM_GotoSleepConfirmation, LinSM finally transitions to LINSM_NO_COM ([SWS_LinSM_00046], [SWS_LinSM_00233]).

Go-to-sleep sequence on a LIN slaveComMLinSMLinIfLin DriverLinTrcvBswMLinSM_RequestComMode(COMM_NO_COMMUNICATION)E_OK (Modus vorgemerkt)Use Case: Bus sleep event (sleep frame or bus idle)LinSM_GotoSleepIndication(Channel)LinIf_GotoSleep(Channel)Lin_GoToSleepInternal(Channel)E_OK (LIN_CH_SLEEP aktiv)optTransceiver Driver konfiguriertLinTrcv_SetOpMode(LINTRCV_TRCV_MODE_SLEEP)E_OKLinSM_GotoSleepConfirmation(Channel, success=TRUE)State = LINSM_NO_COMComM_BusSM_ModeIndication(COMM_NO_COMMUNICATION)BswM_LinSM_CurrentState(LINSM_NO_COM)

Sequence diagram: Interaction of BSW modules when a LIN slave enters sleep state following a bus sleep signal. Sources: [SWS_LinSM_91000], [SWS_LinSM_00231], [SWS_LinIf_00757], AUTOSAR SWS LINStateManager p. 48.

Error Handling, DET Tracing, and Degradation

The cluster features a multi-level error detection and diagnostic concept. Development errors are recorded via the Default Error Tracer (Det): Invalid channel or network parameters are reported by LIN_E_INVALID_CHANNEL ([SWS_Lin_00259]), LINIF_E_NONEXISTENT_CHANNEL ([SWS_LinIf_00539]), and LINSM_E_NONEXISTENT_NETWORK ([SWS_LinSM_00127]), respectively. Calls to uninitialized modules result in LIN_E_UNINIT, LINIF_E_UNINIT, or LINSM_E_UNINIT ([SWS_Lin_00258], [SWS_LinSM_00128]). Transceiver errors such as invalid network numbers are reported to DET by LINTRCV_E_INVALID_LIN_NETWORK ([SWS_LinTrcv_00145]).

Communication faults occurring during runtime are classified as runtime errors: The interface defines LINIF_E_RESPONSE for erroneous frames and LINIF_E_NC_NO_RESPONSE for missing responses to node configuration requests ([SWS_LinIf_00729]). Physical bus and protocol errors (framing errors, checksum errors, bit monitoring errors) are reported by the MCAL driver on the slave via LinIf_LinErrorIndication with status Lin_SlaveErrorType ([SWS_LinIf_91007], [SWS_Lin_91140]). On master nodes, Lin_GetStatus provides detailed error codes such as LIN_TX_HEADER_ERROR, LIN_TX_ERROR, or LIN_RX_ERROR to the interface ([SWS_Lin_00168], [SWS_Lin_00233]).

A central error mechanism for LIN slaves is the standardized response_error signal. The LIN Interface manages this 1-bit signal autonomously: If a transmission error occurs, LinIf sets the bit, which is transmitted to the master in the next unconditional transmit frame ([SWS_LinIf_00763], SWS LINInterface p. 58). After successful frame transmission, LinIf clears the flag automatically ([SWS_LinIf_00747]). On the diagnostic channel, LinTp monitors strict protocol time windows: If N-PDUs fail to arrive, the timers $N_{As}$ and $N_{Cr}$ abort the transaction in a defined manner and report E_NOT_OK to the PDU Router ([SWS_LinIf_00799], [SWS_LinIf_00804], [SWS_LinIf_00806]). If buffer capacity is lacking at the PDU Router, the interface aborts acceptance and switches the master's schedule table back to application operation ([SWS_LinIf_00676], [SWS_LinIf_00792]).

This guide is based on the AUTOSAR specifications for release R20-11 of the modules Lin, LinIf, LinSM, and LinTrcv. All normative references originate from the referenced documents and requirement entries.

Module im Cluster

LIN Driver (Lin)

Controls hardware LIN controllers on the ECU.

BSW ID 82 17 APIs (9 Funktionen, 8 Typen) #include "Lin.h"

LIN Interface (LinIf)

Abstracts LIN hardware and manages schedule tables and frame transmission.

BSW ID 62 35 APIs (31 Funktionen, 4 Typen) #include "LinIf.h"

LIN Network Management (LinNm)

AUTOSAR Classic Communication Services-Modul LIN Network Management (LinNm, Spezifikation: AUTOSAR_SWS_LINNetworkManagement.pdf).

BSW ID 63 Keine C-API · 0 Records #include "LinNm.h"

LIN State Manager (LinSM)

Manages state transitions of LIN networks.

BSW ID 141 12 APIs (10 Funktionen, 2 Typen) #include "LinSM.h"

LIN Transceiver Driver (LinTrcv)

Controls physical bus transceiver states and wakeup on LIN lines.

BSW ID 64 11 APIs (7 Funktionen, 4 Typen) #include "LinTrcv.h"