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_GetStatusLin_GetVersionInfoLin_InitLinIf_GetVersionInfoLinIf_InitLinSM_GetVersionInfoLinSM_InitLinTp_GetVersionInfoLinTp_InitLinTrcv_GetVersionInfoLinTrcv_Init서비스 · Get…
서비스 · Set…
서비스 · Wakeup…
서비스 · Check…
서비스 · Goto…
서비스 · Schedule…
서비스 · 기타
Lin_GoToSleepLin_GoToSleepInternalLin_SendFrameLinIf_EnableBusMirroringLinIf_HeaderIndicationLinIf_LinErrorIndicationLinIf_TransmitLinSM_RequestComModeLinTp_ChangeParameterLinTp_ShutdownLinTp_Transmit콜백
LinIf_RxIndicationLinIf_TxConfirmation콜아웃 및 예상 인터페이스
<User_ResponseErrorSignalChanged><User_RxIndication><User_SaveConfigurationRequest><User_TriggerTransmit><User_TxConfirmation>주기적
LinSM_MainFunction타입
Lin_ConfigTypeLin_FrameCsModelTypeLin_FrameDlTypeLin_FramePidTypeLin_FrameResponseTypeLin_PduTypeLin_SlaveErrorTypeLin_StatusTypeLinIf_ConfigTypeLinIf_SchHandleTypeLinSM_ConfigTypeLinSM_ModeTypeLinTp_ConfigTypeLinTp_ModeLinTrcv_ConfigTypeLinTrcv_TrcvModeTypeLinTrcv_TrcvWakeupModeTypeLinTrcv_TrcvWakeupReasonType함수
<User_ResponseErrorSignalChanged><User_RxIndication><User_SaveConfigurationRequest><User_TriggerTransmit><User_TxConfirmation>Lin_CheckWakeupLin_GetStatusLin_GetVersionInfoLin_GoToSleepLin_GoToSleepInternalLin_InitLin_SendFrameLin_WakeupLin_WakeupInternalLinIf_CheckWakeupLinIf_EnableBusMirroringLinIf_GetConfiguredNADLinIf_GetPIDTableLinIf_GetTrcvModeLinIf_GetTrcvWakeupReasonLinIf_GetVersionInfoLinIf_GotoSleepLinIf_HeaderIndicationLinIf_InitLinIf_LinErrorIndicationLinIf_RxIndicationLinIf_ScheduleRequestLinIf_SetConfiguredNADLinIf_SetPIDTableLinIf_SetTrcvModeLinIf_SetTrcvWakeupModeLinIf_TransmitLinIf_TxConfirmationLinIf_WakeupLinIf_WakeupConfirmationLinSM_GetCurrentComModeLinSM_GetVersionInfoLinSM_GotoSleepConfirmationLinSM_GotoSleepIndicationLinSM_InitLinSM_MainFunctionLinSM_RequestComModeLinSM_ScheduleRequestLinSM_ScheduleRequestConfirmationLinSM_WakeupConfirmationLinTp_ChangeParameterLinTp_GetVersionInfoLinTp_InitLinTp_ShutdownLinTp_TransmitLinTrcv_CheckWakeupLinTrcv_GetBusWuReasonLinTrcv_GetOpModeLinTrcv_GetVersionInfoLinTrcv_InitLinTrcv_SetOpModeLinTrcv_SetWakeupMode타입
Lin_ConfigTypeLin_FrameCsModelTypeLin_FrameDlTypeLin_FramePidTypeLin_FrameResponseTypeLin_PduTypeLin_SlaveErrorTypeLin_StatusTypeLinIf_ConfigTypeLinIf_SchHandleTypeLinSM_ConfigTypeLinSM_ModeTypeLinTp_ConfigTypeLinTp_ModeLinTrcv_ConfigTypeLinTrcv_TrcvModeTypeLinTrcv_TrcvWakeupModeTypeLinTrcv_TrcvWakeupReasonType주제 맵
Lin
17LinIf
35LinSM
12이 릴리스에 대한 요소 데이터가 없습니다
Lin
This function checks if a wakeup has occurred on the addressed LIN channel.
Std_ReturnType Lin_CheckWakeup (uint8 Channel);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);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);Initializes the LIN module.
void Lin_Init (const Lin_ConfigType* Config);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);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);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);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);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);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);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.
클러스터 가이드AI 생성
차량 내 Local Interconnect Network를 통해 센서와 액추에이터의 비용 효율적인 네트워킹을 가능하게 합니다.
차량 내 Local Interconnect Network를 통해 센서와 액추에이터의 비용 효율적인 네트워킹을 가능하게 합니다.
LIN Communication 모듈 클러스터는 LinSM, LinIf, LinTrcv 및 Lin 모듈(SWS COMManager 19쪽)을 통해 LIN 서브버스 시스템의 표준화된 연결을 구현합니다. 마스터에서의 스케줄 기반 프레임 전송뿐만 아니라 슬레이브에서의 반응형 헤더 평가 및 데이터 전달을 제어합니다([SWS_LinIf_91004], [SWS_Lin_00168]). 동시에 이 클러스터는 전체 통신과 슬립 모드 간의 질서 있는 전환 및 response_error 신호를 통한 자율적 오류 처리를 조율합니다([SWS_LinIf_00763]).
LIN Communication 모듈 클러스터는 LIN 프로토콜의 완전한 AUTOSAR 구현을 제공하며 상태 관리자 LinSM, 인터페이스 LinIf(전송 프로토콜 LinTp 포함), 트랜시버 드라이버 LinTrcv 및 MCAL 드라이버 Lin를 포함합니다(SWS COMManager 19쪽). 서브네트워크, 센서 및 액추에이터를 AUTOSAR 통신 매트릭스에 연결하며, 자율적 스케줄 처리를 수행하는 마스터 노드와 순수하게 반응적으로 응답하는 슬레이브 노드를 엄격하게 구분합니다([SWS_LinIf_00197], [SWS_Lin_00272]).
아키텍처 다이어그램: 통신 서비스, 추상화 계층 및 MCAL 간 LIN 클러스터의 계층 아키텍처 및 인터페이스 관계. 출처: SWS COMManager 19쪽, AUTOSAR SWS LINInterface 133쪽.
데이터 전송은 마스터 ECU에서 Lin_SendFrame을 통한 드라이버의 주기적 구동 및 Lin_GetStatus을 통한 후속 상태 폴링을 통해 수행됩니다([SWS_Lin_00168]). 반면 슬레이브에서는 드라이버에서 헤더가 감지되면 동기 콜백 LinIf_HeaderIndication이 호출됩니다([SWS_LinIf_91004]). 인터페이스는 PID를 기반으로 수신, 응답 또는 무시 여부를 결정하고 LinIf_RxIndication 또는 LinIf_TxConfirmation을 통해 완료를 확인합니다([SWS_LinIf_91005], [SWS_LinIf_91006]). 진단 메시지는 통합된 LinTp가 스케줄 테이블의 자동 전환을 통해 처리합니다([SWS_LinIf_00641]).
운영 주기 동안 LinSM은 LINSM_NO_COM과 LINSM_FULL_COM 간의 상태 전이를 조정합니다([SWS_LinSM_00026], [SWS_LinSM_00032]). 웨이크업은 Lin_Wakeup를 통한 버스 펄스를 통해 이루어집니다([SWS_Lin_00169]). 슬립 모드로의 전이는 마스터의 경우 슬립 프레임을 능동적으로 전송함으로써, 슬레이브의 경우 슬립 명령 수신 후 또는 버스 유휴 시 LinIf_GotoSleep, Lin_GoToSleepInternal 및 트랜시버 슬립 제어를 통해 발생합니다([SWS_LinSM_00231], [SWS_LinIf_00757]).
시퀀스 다이어그램: 버스 슬립 신호 이후 LIN 슬레이브가 슬립 상태로 진입할 때의 BSW 모듈 간 상호작용. 출처: [SWS_LinSM_91000], [SWS_LinSM_00231], [SWS_LinIf_00757], AUTOSAR SWS LINStateManager 48쪽.
통신 오류는 슬레이브에서 LinIf_LinErrorIndication을 통해 감지되며 response_error 신호를 통해 마스터에 자율적으로 보고됩니다([SWS_LinIf_91007], [SWS_LinIf_00763]). 채널 간 동기화 영역과 주기적 태스크(LinIf_MainFunction) 및 드라이버 ISR 간의 엄격한 분리를 통해 시스템 안정성을 보장합니다([SWS_LinIf_00384]).
시스템 아키텍처 & 모듈 클러스터의 역할
LIN Communication 모듈 클러스터는 AUTOSAR Classic 베이직 소프트웨어 스택에서 ISO 17987에 따른 Local Interconnect Network(LIN)를 통한 표준화된 통신을 제공합니다. 이는 주로 차량 네트워크에서 센서와 액추에이터를 연결하기 위한 비용 효율적인 서브버스 시스템 역할을 합니다(AUTOSAR FO Features 58쪽). 이 클러스터는 AUTOSAR 아키텍처의 여러 계층에 걸쳐 있습니다: LIN State Manager(LinSM)는 Communication Services 계층에서 동작하고, 통합된 전송 프로토콜(LinTp)을 포함하는 LIN Interface(LinIf)는 Communication Abstraction을 구성하며, LIN Transceiver Driver(LinTrcv)는 ECU Abstraction의 일부이고, LIN Driver(Lin)는 Microcontroller Abstraction Layer(MCAL)의 하드웨어 근접 모듈로 상주합니다(SWS COMManager 19쪽).
아키텍처 관점에서 클러스터는 마스터 노드와 슬레이브 노드를 엄격히 구분합니다. LIN 마스터는 스케줄 테이블을 통해 버스 트래픽을 독자적으로 제어하고 모든 헤더를 생성하는 반면, LIN 슬레이브는 수신된 헤더에 순수하게 반응하여 응답하거나 신호를 평가합니다([SWS_LinIf_00197], [SWS_Lin_00272]). ISO 14229에 따른 진단 및 전송 작업을 위해 LIN Interface는 세그먼트화된 진단 메시지(마스터 요청 프레임 MRF 및 슬레이브 응답 프레임 SRF)를 PduR 및 DCM을 통해 처리하는 TP 기능을 캡슐화합니다([SWS_LinIf_00351], [SWS_LinIf_00629]). 외부적으로 클러스터는 Communication Manager(ComM), Basic Software Mode Manager(BswM), PDU Router(PduR) 및 ECU State Manager(EcuM)와 긴밀하게 상호작용합니다(SWS COMManager 19쪽).
아키텍처 다이어그램: 통신 서비스, 추상화 계층 및 MCAL 간 LIN 클러스터의 계층 아키텍처 및 인터페이스 관계. 출처: SWS COMManager 19쪽, AUTOSAR SWS LINInterface 133쪽.
모듈 간 상호작용 & 인터랙션 경로
클러스터 내 인터랙션 경로는 노드 역할에 따라 근본적으로 다릅니다. LIN 마스터에서 LIN Interface는 주기적 태스크를 통해 활성 스케줄 테이블의 처리를 시작합니다. 처리 시점이 도래한 송신 프레임의 경우, LinIf은 상위 계층의 트리거 전송(Trigger-Transmit) 메커니즘을 통해 페이로드를 가져오고 Lin_SendFrame를 통해 Lin_PduType 구조체를 LIN 드라이버로 전달합니다([SWS_Lin_00232], SWS LINInterface 37쪽). 드라이버는 헤더와 데이터를 넌블로킹 방식으로 전송합니다([SWS_Lin_00027]). 최대 프레임 실행 시간이 경과한 후, LinIf은 Lin_GetStatus을 통해 전송 결과를 확인합니다([SWS_Lin_00168], SWS LINInterface 35쪽). 수신 슬롯의 경우 LinIf은 드라이버가 버퍼에 저장한 데이터를 가져와 상위 계층으로 전달합니다([SWS_Lin_00233]).
LIN 슬레이브에서 데이터 경로는 이벤트 기반으로 실행됩니다: MCAL 드라이버 Lin이 하드웨어에서 유효한 Break, Synch 및 PID 헤더를 감지하면 동기식으로 콜백 LinIf_HeaderIndication을 호출합니다([SWS_Lin_00280], [SWS_LinIf_91004]). 인터페이스는 내부 PID 테이블을 기반으로 보호 식별자(PID)를 확인합니다([SWS_LinIf_00816], [SWS_LinIf_00823]). 송신 프레임인 경우 LinIf은 페이로드를 가져오고, 응답 유형을 LIN_FRAMERESPONSE_TX로 구성하며, 드라이버가 버퍼에서 사용할 수 있도록 데이터를 준비합니다([SWS_Lin_00230]). 프레임이 수신으로 구성된 경우, 드라이버는 전체 바이트 수신 후 LinIf_RxIndication를 통해 성공을 보고하고([SWS_LinIf_91005]), 이후 LinIf이 데이터를 PDU 라우터로 전달합니다. 전송된 슬레이브 응답의 확인은 LinIf_TxConfirmation를 통해 수행됩니다([SWS_LinIf_91006]).
또한 LIN 인터페이스를 통해 트랜시버 제어가 투명하게 캡슐화됩니다: 인터페이스는 LinIf_SetTrcvMode과 같은 모드 요청을 LinTrcv_SetOpMode로 동기식으로 전달합니다([SWS_LinIf_00544], [SWS_LinTrcv_00002]). 전송 프로토콜 트랜잭션 시 LinTp는 BswM_LinTp_RequestMode를 통해 애플리케이션 모드(LINTP_APPLICATIVE_SCHEDULE), 진단 요청(LINTP_DIAG_REQUEST) 및 진단 응답(LINTP_DIAG_RESPONSE) 간 마스터 스케줄 테이블의 목표 전환을 제어합니다([SWS_LinIf_00641], [SWS_LinIf_00642], [SWS_LinIf_00643]).
시퀀스 다이어그램: LIN 슬레이브에서의 헤더 인디케이션, 송신 트리거링 및 수신 확인 시 동적 제어 및 데이터 흐름. 출처: [SWS_Lin_00280], [SWS_LinIf_91004], [SWS_LinIf_91005], AUTOSAR SWS LINInterface 133쪽.
동기화, 재진입성 및 태스크 컨텍스트
모듈 클러스터 내의 실행은 주기적 태스크 컨텍스트와 하드웨어 근접 인터럽트 레벨로 분할됩니다. LIN Interface의 주기적 흐름 제어의 핵심은 스케줄링된 함수 LinIf_MainFunction_<LinIfChannel.ShortName>이며, 이는 구성된 각 LIN 채널에 대해 반드시 개별적으로 인스턴스화됩니다([SWS_LinIf_00384], [SWS_LinIf_00725]). 이 함수는 스케줄 슬롯의 진행, 드라이버에서의 상태 폴링 및 전송 프로토콜의 타임아웃 처리를 담당합니다([SWS_LinIf_00800], SWS LINInterface 119쪽). 이와 병행하여 LinSM_MainFunction는 비동기 채널 및 웨이크업 요청에 대한 카운트다운 및 확인 타이머를 관리합니다([SWS_LinSM_00162], [SWS_LinSM_00159]).
태스크 레벨과 달리 MCAL 모듈 Lin의 드라이버 루틴은 인터럽트 제어 컨트롤러 또는 UART 인터페이스가 존재하는 경우 인터럽트 컨텍스트(ISR)에서 실행됩니다(AUTOSAR CP SWS LINDriver 53쪽). 콜백 LinIf_HeaderIndication, LinIf_RxIndication 및 LinIf_TxConfirmation는 이 ISR 컨텍스트에서 직접 동기적으로 트리거됩니다([SWS_Lin_00280], [SWS_LinIf_91005], [SWS_LinIf_91006]). 이로 인해 LIN Interface에서 크리티컬 섹션(Exclusive Areas)의 엄격한 보호가 필요합니다: LinIf_Transmit, LinIf_GotoSleep, LinIf_ScheduleRequest 또는 LinIf_Wakeup과 같은 제어 호출은 LinIf_MainFunction 또는 ISR 콜백으로부터의 동시 접근에 대해 보호된 상태에서만 내부 채널 구조체를 수정할 수 있습니다(SWS LINInterface 119쪽).
재진입성(Reentrancy)과 관련하여 모듈 LinIf 및 LinSM의 API 함수는 주로 서로 다른 채널 또는 네트워크에 대해서는 재진입 가능하지만 동일한 채널에 대해서는 재진입이 불가능하도록 설계되었습니다([SWS_LinSM_00126], [SWS_LinIf_00201], [SWS_LinIf_00204]). Lin의 드라이버 서비스(예: Lin_Wakeup, Lin_GoToSleepInternal) 역시 마찬가지로 동작하며, 물리 채널별로 엄격하게 동기화되어야 합니다([SWS_Lin_00167], [SWS_Lin_00169]). 다중 바이트 FIFO가 없는 단순 UART 하드웨어의 경우 LIN 드라이버는 바이트를 소프트웨어에 임시 버퍼링하므로([SWS_Lin_00026]), 해석: 높은 버스 부하 시 슬레이브 노드에서 CPU 인터럽트 부하가 증가할 것으로 추정됩니다. 질문 Q-0d07d89d1ade6a01 (열림)
일반적인 수명 주기 및 동작 모드
시스템 시작 동안 BswM은 정해진 체인에 따라 BSW 모듈을 초기화합니다: 먼저 기본 드라이버 Lin_Init 및 LinTrcv_Init가 초기화되고, 이어서 LinIf_Init, LinTp_Init 및 마지막으로 LinSM_Init가 초기화됩니다(ModemanagementGuide 54쪽). LinIf_Init은 모든 마스터 채널의 스케줄을 기본적으로 NULL_SCHEDULE로 설정하고([SWS_LinIf_00233]), 슬레이브의 경우 사전 구성된 NAD 및 PID 테이블을 로드합니다([SWS_LinIf_00767], [SWS_LinIf_00768]). LinSM는 LINSM_NO_COM 상태에서 시작하며, 초기화 시 ComM 또는 BswM로 콜백을 보내지 않습니다([SWS_LinSM_00026], [SWS_LinSM_00166]).
ComM이 LinSM_RequestComMode(COMM_FULL_COMMUNICATION)을 통해 통신 활성화를 요청하면, LinSM는 즉시 LinIf_Wakeup을 트리거하고 모니터링 타이머를 시작합니다([SWS_LinSM_00047], [SWS_LinSM_00100]). LinIf은 Lin_Wakeup을 통해 물리적 웨이크업 펄스를 버스로 전송합니다([SWS_LinIf_00205], [SWS_Lin_00043]). LinIf이 LinSM_WakeupConfirmation(success=TRUE)을 통해 성공적인 웨이크업 절차를 보고하면 상태가 LINSM_FULL_COM로 변경됩니다([SWS_LinSM_00049], [SWS_LinSM_00132]). 이는 ComM_BusSM_ModeIndication을 통해 ComM에, 그리고 BswM_LinSM_CurrentState을 통해 BswM에 신호로 전달됩니다([SWS_LinSM_00033], [SWS_LinSM_00192]). 슬레이브의 경우 마스터가 첫 번째 LIN 헤더를 전송하고 이를 수신해야만 버스가 성공적으로 웨이크업된 것으로 간주됩니다([SWS_LinIf_00761], SWS LINStateManager 28쪽).
슬립 모드로의 종료(Go-to-Sleep)는 크게 다릅니다: 마스터에서 요청 COMM_NO_COMMUNICATION은 LinIf_GotoSleep의 호출로 이어집니다([SWS_LinSM_00036], [SWS_LinSM_10208]). LinIf는 Lin_GoToSleep를 통해 드라이버에 버스로 표준화된 Go-to-Sleep 프레임을 전송하도록 지시합니다([SWS_Lin_00166], [SWS_Lin_00089]). 반면 슬레이브에서는 인터페이스가 Go-to-Sleep 명령을 수신하거나 버스 유휴 타임아웃을 감지하여 LinSM_GotoSleepIndication를 통해 LinSM에 알립니다([SWS_LinSM_91000]). 이에 따라 LinSM은 LinIf_GotoSleep를 동기식으로 호출합니다([SWS_LinSM_00231]). 인터페이스는 Lin_GoToSleepInternal를 통해 드라이버를 로컬에서 LIN_CH_SLEEP 상태로 전환하고([SWS_LinIf_00757], [SWS_Lin_00095]), LinIf_SetTrcvMode(LINTRCV_TRCV_MODE_SLEEP)을 통해 트랜시버를 슬립 상태로 전환합니다([SWS_LinIf_00544], AUTOSAR CP SWS LINInterface 137쪽). 확인 LinSM_GotoSleepConfirmation 이후 LinSM는 최종적으로 LINSM_NO_COM으로 전환됩니다([SWS_LinSM_00046], [SWS_LinSM_00233]).
시퀀스 다이어그램: 버스 슬립 신호 이후 LIN 슬레이브가 슬립 상태로 진입할 때의 BSW 모듈 간 상호작용. 출처: [SWS_LinSM_91000], [SWS_LinSM_00231], [SWS_LinIf_00757], AUTOSAR SWS LINStateManager 48쪽.
오류 처리, DET 추적 및 성능 저하
클러스터는 다단계 오류 감지 및 진단 개념을 갖추고 있습니다. 개발 오류는 Default Error Tracer(Det)를 통해 감지됩니다: 유효하지 않은 채널 또는 네트워크 매개변수는 LIN_E_INVALID_CHANNEL([SWS_Lin_00259]), LINIF_E_NONEXISTENT_CHANNEL([SWS_LinIf_00539]) 또는 LINSM_E_NONEXISTENT_NETWORK([SWS_LinSM_00127])를 보고합니다. 초기화되지 않은 모듈의 호출은 LIN_E_UNINIT, LINIF_E_UNINIT 또는 LINSM_E_UNINIT를 유발합니다([SWS_Lin_00258], [SWS_LinSM_00128]). 유효하지 않은 네트워크 번호와 같은 트랜시버 오류는 DET에 LINTRCV_E_INVALID_LIN_NETWORK를 보고합니다([SWS_LinTrcv_00145]).
작동 중 발생하는 통신 장애는 런타임 오류로 분류됩니다: 인터페이스는 결함이 있는 프레임의 경우 LINIF_E_RESPONSE을, 노드 구성 요청에 대한 응답이 누락된 경우 LINIF_E_NC_NO_RESPONSE을 정의합니다([SWS_LinIf_00729]). 물리적 버스 및 프로토콜 오류(프레이밍 오류, 체크섬 오류, 비트 모니터링 오류)는 슬레이브의 MCAL 드라이버가 Lin_SlaveErrorType 상태와 함께 LinIf_LinErrorIndication을 통해 보고합니다([SWS_LinIf_91007], [SWS_Lin_91140]). 마스터 노드에서 Lin_GetStatus은 LIN_TX_HEADER_ERROR, LIN_TX_ERROR 또는 LIN_RX_ERROR과 같은 상세한 오류 코드를 인터페이스에 제공합니다([SWS_Lin_00168], [SWS_Lin_00233]).
LIN 슬레이브의 핵심 오류 메커니즘은 표준화된 response_error 신호입니다. LIN 인터페이스는 이 1비트 신호를 자율적으로 관리합니다: 전송 오류가 발생하면 LinIf이 해당 비트를 설정하고, 이는 다음 무조건부(Unconditional) 송신 프레임에서 마스터로 전송됩니다([SWS_LinIf_00763], SWS LINInterface 58쪽). 성공적인 프레임 전송 후 LinIf는 해당 플래그를 자동으로 지웁니다([SWS_LinIf_00747]). 진단 채널에서 LinTp은 엄격한 프로토콜 시간 창을 모니터링합니다: N-PDU가 도착하지 않으면 타이머 $N_{As}$ 및 $N_{Cr}$이 트랜잭션을 규정된 대로 중단하고 PDU 라우터에 E_NOT_OK을 보고합니다([SWS_LinIf_00799], [SWS_LinIf_00804], [SWS_LinIf_00806]). PDU 라우터에 버퍼 용량이 부족하면 인터페이스는 수신을 중단하고 마스터의 스케줄 테이블을 애플리케이션 운영으로 다시 전환합니다([SWS_LinIf_00676], [SWS_LinIf_00792]).
이 가이드는 Lin, LinIf, LinSM 및 LinTrcv 모듈의 릴리스 R20-11용 AUTOSAR 사양을 기반으로 합니다. 모든 규범적 근거는 참조된 문서 및 요구사항 항목에서 발췌한 것입니다.
Module im Cluster
LIN Driver (Lin)
Controls hardware LIN controllers on the ECU.
LIN Interface (LinIf)
Abstracts LIN hardware and manages schedule tables and frame transmission.
LIN Network Management (LinNm)
AUTOSAR Classic Communication Services-Modul LIN Network Management (LinNm, Spezifikation: AUTOSAR_SWS_LINNetworkManagement.pdf).
LIN State Manager (LinSM)
Manages state transitions of LIN networks.
LIN Transceiver Driver (LinTrcv)
Controls physical bus transceiver states and wakeup on LIN lines.
gemini-3.8-flash-low· 2026-10-13 · 독일어 원문