Errors
Normative
The error and return codes a conformant SPI driver reports. Development errors are only raised
when development error reporting is enabled (see enable_development_error_reporting in
Configuration Reference). Governed by CHI-SPI-MUST-20 and CHI-SPI-MUST-22 (and
CHI-SPI-MUST-18 for runtime errors) in Spi — 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 |
|
|
|
|
|
|
|
|
TX/RX total transfer length inconsistent |
|
|
Channel not in |
|
|
|
|
|
Channel in |
|
|
|
|
|
Channel in |
|
|
|
|
Development error type
Defines
Available via: Spi_DriverTypes.h. Vendor-specific error definitions MUST be provided
via Spi.h instead.
Runtime errors
Runtime errors are reported via LogM_Report with runtime-error level. When
the failure is not tied to a specific chip select, the reported csId is SPI_CS_UNSPECIFIED.
Specifies error types which are logged via LogM_Report with logLevel runtime error.
Defines
-
SPI_RTERR (16U)
Specifies an error has been detected. If user doesn’t need detailed error information.
If user wants to know error detail, then check below vendor specific errors
-
SPI_RTERR (16U)
A vendor MAY expand SPI_RTERR into more detailed SPI_RTERR_<VENDOR_SPECIFIC> codes in
the range [0x10, 0xFF]; those MUST be provided via Spi.h, not Spi_DriverTypes.h.
Available via: Spi_DriverTypes.h.
Chip-select definition
SpiDrv CS definition
Defines
-
SPI_CS_UNSPECIFIED (255U)
Specifies the detected error does not relate to a CS but SPI controller HW or bus common failure. Also, this symbol is used as the default parameter of csId for Spi_StartTransaction in case of Target Mode.
-
SPI_CS_UNSPECIFIED (255U)
Used as the csId a target passes to Spi_StartTransaction and as the csId for a
controller-level error not tied to a chip select. Available via: Spi_DriverTypes.h.