Errors

Normative

The error and return codes a conformant LIN driver reports. Development errors are only raised when development error reporting is enabled (see enable_development_error_reporting in Configuration Reference). Governed by CHI-LIN-MUST-16 and CHI-LIN-MUST-17 in Lin — Requirements.

Development errors

When development error reporting is enabled, each API detects the conditions below and raises the listed error via LogM_Report.

Development errors by API

API

Condition

Error id

Lin_Init

Driver not in LIN_DRV_STATE_UNINIT

LIN_DEVERR_INVALID_CH_STATE

Lin_Init

configPtr is not NULL_PTR

LIN_DEVERR_PARAM_POINTER

Lin_Wakeup / Lin_WakeupInternal / Lin_GoToSleepInternal

Driver / channel not initialized

LIN_DEVERR_UNINIT

Lin_Wakeup / Lin_WakeupInternal / Lin_GoToSleepInternal

channelId out of range or inactive

LIN_DEVERR_PARAM_CHANNELID

Lin_Wakeup

Channel not in SLEEP (already OPERATIONAL)

LIN_DEVERR_INVALID_CH_STATE

Development error code group

Development error type

Defines

LIN_DEVERR_UNINIT (1U)

API service used without module initialization

LIN_DEVERR_PARAM_CHANNELID (2U)

API service used with an invalid or inactive channelId parameter

LIN_DEVERR_PARAM_POINTER (3U)

API service called with invalid pointer parameter.

LIN_DEVERR_INVALID_CH_STATE (4U)

Invalid state transition for the current state

Available via: LinIf_DriverTypes.h. Vendor-specific error definitions MUST be provided via Lin.h instead.

Bus errors

Bus errors detected while processing a header or response are reported to the upper layer via LinIf_OnError(channelId, error) with a value of Lin_ErrorType.

Lin_ErrorType values

Error id

Reported when

LIN_ERR_SYNC_FIELD_VALUE

The received sync field is invalid.

LIN_ERR_HEADER_FRAMING

Stop-bit error in the received sync byte or PID byte.

LIN_ERR_PID_PARITY

Invalid PID parity bits (optional, hardware-dependent).

LIN_ERR_MONITORING

Bit error detected during transmission.

LIN_ERR_FRAMING

Stop-bit error in the transmitted or received response.

LIN_ERR_CHECKSUM

Invalid response checksum.

LIN_ERR_NO_RESPONSE

The response is completely missing (optional, hardware-dependent).

LIN_ERR_INCOMPLETE_RESPONSE

The response was only partly received (optional, hardware-dependent).