43static bool IsPersistentValsUnreliable(
void);
44static bool IsPersistentFlagsUnreliable(
void);
46static resetReason_t ConvertToResetReason(uint8_t resetReasonVal);
47static errId_t ConvertToErrId(uint8_t resetErrorIdVal);
48static void ReportPreStartupErrors(
bool isSafeIoFault,
bool isCpuCompFault,
bool isWdtExpFault,
59 const bool isFlagsUnreliable = IsPersistentFlagsUnreliable();
64 if (isFlagsUnreliable)
70 ReportPreStartupErrors(isSafeIoFault, isCpuCompFault, isWdtExpFault, isSwdtExpFault);
187 const bool isRstReasonUnreliable = IsPersistentValsUnreliable();
192 if (isRstReasonUnreliable)
198 resetInfo.
reason = ConvertToResetReason(resetReasonVal);
203 resetInfo.
id = ConvertToErrId(resetErrorIdVal);
212static bool IsPersistentValsUnreliable(
void)
216 const errInjectReset_t errInjReason = ConvertToErrInjReason(errInjReasonVal);
221 return (isFsmStateCorrupted || isValsCorrupted);
225static bool IsPersistentFlagsUnreliable(
void)
235 const bool isValsUnreliable = IsPersistentValsUnreliable();
238 return (isValsUnreliable || isFlagsCorrupted);
257static resetReason_t ConvertToResetReason(uint8_t resetReasonVal)
271static errId_t ConvertToErrId(uint8_t resetErrorIdVal)
285static void ReportPreStartupErrors(
bool isSafeIoFault,
bool isCpuCompFault,
bool isWdtExpFault,
Defines error flag type for indicating detected errors in Middleware services.
errFlag_t
Defines the error flag used by Middleware services to indicate error detection.
Defines for IDs associated with specific errors.
errId_t
Defines unique Error IDs for reporting system errors to EH_HandleError.
Defines type for storing the reason of a device reset caused by an error injection.
errInjectReset_t
Defines possible reasons for a device reset due to an error injection.
void EH_HandleError(errFlag_t flag, errId_t id)
Handles error based on configured Error ID criticality if the error flag is set.
errFlag_t MW_DisableForceFloat(void)
Disables forced floating (tri-stating) of all I/O pins.
void MW_StartHeartbeat(void)
Starts the Heartbeat output signal.
errFlag_t MW_EnableGlobalInterrupts(void)
Enables global interrupts on the device.
void MW_ClearPersistentVals(void)
Clears all stored persistent values in GPR.
bool MW_GetPersistentFlag(persistentFlag_t flagType)
Reads two redundant bits for each boolean flags in General Purpose Registers (GPR) that is stored for...
bool MW_IsPersistentFlagsCorrupt(void)
Compares two redundant bits for each boolean flags in General Purpose Registers (GPR) and checks if a...
void MW_ClearPersistentFlags(void)
Clears all stored persistent flags in GPR.
uint8_t MW_GetPersistentVal(persistentVal_t valueType)
Reads a value in General Purpose Registers (GPR) that is stored for preserving data between resets.
bool MW_IsPersistentValsCorrupt(void)
Checks if any of the stored persistent values are corrupted.
errFlag_t MW_DiagVmonUnderBegin(void)
Starts error injection diagnostic to detect faults in the VMON undervoltage detector.
errFlag_t MW_DiagVmonOverEnd(void)
Completes error injection diagnostic to detect faults in the VMON overvoltage detector.
errFlag_t MW_DiagVmonUnderEnd(void)
Completes error injection diagnostic to detect faults in the VMON undervoltage detector.
bool MW_IsDiagVmonOverDone(void)
Checks if the VMON overvoltage error injection has been completed.
errFlag_t MW_DiagVmonOverBegin(void)
Starts error injection diagnostic to detect faults in the VMON overvoltage detector.
bool MW_IsDiagVmonUnderDone(void)
Checks if the VMON undervoltage error injection has been completed.
resetReason_t
Type defines for all possible reset sources.
errFlag_t InitPower(void)
Private function, only exposed for unit testing and should not be called directly.
void T_RunStartupDiagnostics(void)
Runs all enabled startup diagnostics and reports any detected faults to the Error Handler.
void RunStartupDiagParity(void)
Private function, only exposed for unit testing and should not be called directly.
void T_HandlePreStartupErrors(void)
Retrieves and validates stored Pre-startup error flags from persistent memory and reports them to the...
void RunStartupDiagErrorCh(void)
Private function, only exposed for unit testing and should not be called directly.
errFlag_t InitClocks(void)
Private function, only exposed for unit testing and should not be called directly.
errFlag_t InitInterrupts(void)
Private function, only exposed for unit testing and should not be called directly.
void T_StartMissionMode(void)
Transitions the device from Safe State into Mission Mode.
errFlag_t InitWatchdogs(void)
Private function, only exposed for unit testing and should not be called directly.
errFlag_t InitErrorController(void)
Private function, only exposed for unit testing and should not be called directly.
void T_HandleResetReason(void)
Retrieves and validates stored reset info from persistent memory and issues configurable callback for...
void RunStartupDiagEcc(void)
Private function, only exposed for unit testing and should not be called directly.
void RunStartupDiagClock(void)
Private function, only exposed for unit testing and should not be called directly.
void T_InitSafetySystem(void)
Initializes the Safety System according to Assumptions of Use and user configurations.
errFlag_t InitMemories(void)
Private function, only exposed for unit testing and should not be called directly.
#define STRICT_SAFE_STATE
Configures whether to use a strict Safe State to Mission Mode transition in TM_PreStartup and TM_Star...
#define HEARTBEAT_OUTPUT
Enables the heartbeat output signal on an I/O pin before entering Mission Mode.
#define WWDT_OPEN_WINDOW
Configures the Windowed Watchdog Timer (WWDT) Open Window duration in Mission Mode.
#define WWDT_CLOSED_WINDOW
Configures the Windowed Watchdog Timer (WWDT) closed window duration in Mission Mode.
const rstCallback_t resetReasonCallback
Configures the user-configurable callback function used for application specific reset handling in T_...
#define ENABLED
Used to enable optional Task features through macro configurations.
errFlag_t MW_SetWdtTimeout(wdtTimeout_t window, wdtTimeout_t period)
Configures and enables the Watchdog Timer in either Normal or Window mode.
Implements APIs for the Power Manager Diagnostics.
Defines a data structure for storing information about a device reset.
Contains private function prototypes for tasks_startup.h.