Errors
Normative
The error and return codes a conformant I2C driver reports. Development errors are only raised
when development error reporting is enabled (see enable_development_error_reporting in
Configuration Reference). Governed by CHI-I2C-MUST-20 and CHI-I2C-MUST-22 in
I2c — Requirements.
Development errors
When development error reporting is enabled, each API detects the conditions below and raises the listed error via LogM_Report with development-error level.
API |
Condition |
Error id |
|---|---|---|
|
Driver not in |
|
|
|
|
|
Driver not initialized |
|
|
|
|
|
Null data pointer |
|
|
Invalid data length |
|
|
Called in an invalid channel state |
|
|
Direction opposite to the controller’s request |
|
Development error type
Defines
-
I2C_DEVERR_INVALID_DIRECTION (6U)
Target Mode only. I2c_StartTxTransaction/I2c_StartRxTransaction is called opposite direction of Controller Node request.
-
I2C_DEVERR_INVALID_DIRECTION (6U)
Available via: I2c_DriverTypes.h. Vendor-specific error definitions MUST be provided
via I2c.h instead.
Runtime errors
Runtime errors are reported via LogM_Report with runtime-error level.
Error id |
Reported when |
|---|---|
|
A bus failure is detected (e.g. SCL stuck low). |
|
The controller loses arbitration (e.g. SDA stuck low). |
Specifies error types which are logged via LogM_Report with log level runtime error.
Available via: I2c_DriverTypes.h.
Transfer errors
Errors detected during a transfer are reported to the integration code via the
I2c_Callout_OnError(channelId, error) callout with a value of
I2c_ErrorType.
Error id |
Reported when |
|---|---|
|
The addressed device (or a data byte) was not acknowledged. |