Errors

Normative

The error and return codes a conformant MCU driver reports, plus the reset-reason value set. Development errors are only raised when development error reporting is enabled (see enable_development_error_reporting in Configuration Reference). Governed by CHI-MCU-MUST-11, CHI-MCU-MUST-12, and CHI-MCU-MUST-08 (runtime) in Mcu — 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.

Development errors by API

API

Condition

Error id

Mcu_Init

Driver not in MCU_DRV_STATE_UNINIT

MCU_DEVERR_INVALID_STATE

Mcu_Init

configPtr is not NULL_PTR

MCU_DEVERR_PARAM_POINTER

Mcu_InitClock / Mcu_IsClockDistributed / Mcu_GetResetRawValue / Mcu_PerformReset

Driver not in MCU_DRV_STATE_INIT

MCU_DEVERR_INVALID_STATE

Mcu_InitClock

clockId out of configured range

MCU_DEVERR_PARAM_CLOCK

Development error code group

Development error type

Defines

MCU_DEVERR_INVALID_STATE (1U)

API service used in an invalid state

MCU_DEVERR_PARAM_POINTER (2U)

API service called with invalid pointer parameter.

MCU_DEVERR_PARAM_CLOCK (3U)

API service called with invalid clock ID parameter

Available via: Mcu_DriverTypes.h. Vendor-specific error definitions MUST be provided via Mcu.h instead.

Runtime errors

Runtime errors are reported via LogM_Report with runtime-error level.

Runtime error code group

Runtime error type

Defines

MCU_RTERR_CLOCK (1U)

Clock setting failure. Typically detected during Mcu_InitClock, Mcu_PollFunction, and an interrupt if supported.

MCU_RTERR_CLOCK is typically detected during Mcu_InitClock, Mcu_PollFunction, or a supporting interrupt. Available via: Mcu_DriverTypes.h.

Reset reason values

The bit values that make up the uint32 returned by Mcu_GetResetRawValue. A vendor MAY add more, and MUST omit any reason the hardware cannot detect.

Reset reason code group

Reset reason definitions

Defines

MCU_RESET_POWER_ON (1U)

Power on reset.

MCU_RESET_SW (2U)

Reset issued by software.

MCU_RESET_WATCHDOG (3U)

Internal watchdog timer reset.

MCU_RESET_EXT_PIN (4U)

Reset triggered by an external pin input.

Available via: Mcu_DriverTypes.h.