Errors
Normative
The error and return codes a conformant UART driver reports. Development errors are only raised
when development error reporting is enabled (see enable_development_error_reporting in
Configuration Reference). Governed by CHI-UART-MUST-20 and CHI-UART-MUST-22 (and
CHI-UART-MUST-17 / CHI-UART-SHOULD-02 for runtime errors) in Uart — 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 |
|
|
|
|
All channel APIs |
|
|
|
Channel not initialized |
|
|
|
|
|
Channel not |
|
|
|
|
|
|
|
|
Channel not |
|
Development error type
Defines
Available via: Uart_DriverTypes.h. Vendor-specific error definitions MUST be provided
via Uart.h instead.
Runtime errors
Runtime errors are reported via LogM_Report with runtime-error level. A
caller that does not need the detail can test the UART_RTERR_TX / UART_RTERR_RX group bits.
Specifies error types which are logged via LogM_Report with log level runtime error.
Defines
-
UART_RTERR_TX (16U)
Specifies a TX error has been detected. The callback notifies one of the <VENDOR_SPECIFIC> error type. If user does not need error detail, then use this value as ((event & UART_RTERR_TX) != 0)
-
UART_RTERR_RX (32U)
Specifies a RX error has been detected. The callback notifies one of the <VENDOR_SPECIFIC> error type. If user does not need error detail, then use this value as ((event & UART_RTERR_RX) != 0)
-
UART_RTERR_RX_OVERFLOW (33U)
The HW buffer becomes overflow.
-
UART_RTERR_TX (16U)
A vendor MAY expand these into detailed codes: UART_RTERR_TX_<VENDOR_SPECIFIC> in
[0x10, 0x1F] and UART_RTERR_RX_<VENDOR_SPECIFIC> in [0x22, 0x2F]; those MUST be
provided via Uart.h, not Uart_DriverTypes.h. A HW buffer overflow is reported as
UART_RTERR_RX_OVERFLOW. Available via: Uart_DriverTypes.h.
Note
TX-error reporting is a SHOULD (CHI-UART-SHOULD-02) — only where the hardware detects and reports a TX error. RX-error reporting (including overflow) is mandatory (CHI-UART-MUST-17).