42static void ReportEndOvervoltageDiag(
void);
43static void ReportEndUndervoltageDiag(
void);
44static void ReportClearVregfailErrors(
void);
45static void ReportClearVregwarnErrors(
void);
46static errCh_t FindSetErrorChannel(
void);
47static void HandleErrorChVregfail(
void);
48static void HandleErrorChBuserr(
void);
49static void HandleErrorChRam2(
void);
50static void HandleErrorChFlash2(
void);
51static void HandleErrorChOpc(
void);
52static void HandleErrorChSplim(
void);
53static void HandleErrorChRam1(
void);
54static void HandleErrorChFlash1(
void);
55static void HandleErrorChVregwarn(
void);
56static void HandleErrorChCdf0(
void);
57static void HandleErrorChCfd1(
void);
58static void HandleErrorChCfm0(
void);
59static void HandleErrorChCfm1(
void);
60static void HandleErrorChSwdt(
void);
61static void HandleErrorChEeprom(
void);
62static void HandleErrorChEvsys0(
void);
63static void HandleErrorChEvsys1(
void);
72 const bool notBusError = (busFlag ==
NO_ERROR);
76 const bool notSplimError = (splimFlag ==
NO_ERROR);
80 const bool notOpcError = (opcFlag ==
NO_ERROR);
82 const bool unkownErrorSource = (notBusError && notSplimError && notOpcError);
83 if (unkownErrorSource)
144#if (DIAG_PERIODIC_VMON == ENABLED)
147 ReportEndOvervoltageDiag();
154 ReportEndUndervoltageDiag();
160 ReportClearVregfailErrors();
161 ReportClearVregwarnErrors();
283 static void (*channelHandler[
ERRCH_MAX])(void)
300 const errCh_t setChannel = FindSetErrorChannel();
306 void (*setChannelHandler)(void) = channelHandler[setChannel];
312static void ReportEndOvervoltageDiag(
void)
319static void ReportEndUndervoltageDiag(
void)
326static void ReportClearVregfailErrors(
void)
338static void ReportClearVregwarnErrors(
void)
362static errCh_t FindSetErrorChannel(
void)
384static void HandleErrorChVregfail(
void)
400static void HandleErrorChBuserr(
void)
426static void HandleErrorChRam2(
void)
442static void HandleErrorChFlash2(
void)
458static void HandleErrorChOpc(
void)
474static void HandleErrorChSplim(
void)
487static void HandleErrorChRam1(
void)
500static void HandleErrorChFlash1(
void)
513static void HandleErrorChVregwarn(
void)
541static void HandleErrorChCdf0(
void)
554static void HandleErrorChCfd1(
void)
567static void HandleErrorChCfm0(
void)
580static void HandleErrorChCfm1(
void)
593static void HandleErrorChSwdt(
void)
615static void HandleErrorChEeprom(
void)
636static void HandleErrorChEvsys0(
void)
649static void HandleErrorChEvsys1(
void)
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.
void MW_ClearCrcPeriodInterrupt(void)
Clears the flag indicating that a CRC scan period is done.
errFlag_t MW_GetClearCrcDoneError(void)
Reads and clears the flag indicating a CRC scan of Flash is done and returns the scan result.
errFlag_t MW_GetClearClockCfd0Error(void)
Reads and clears the flag indicating a clock failure detected by CFD0.
errFlag_t MW_GetClearClockCfm1Error(void)
Reads and clears the flag indicating a clock frequency error measured by CFM1.
void MW_ClearClockCfmDoneFlags(void)
Clears the Clock Frequency Measure Done (CFMDn) flags indicating that a clock frequency measurement i...
errFlag_t MW_GetClearClockCfd1Error(void)
Reads and clears the flag indicating a clock failure detected by CFD1.
errFlag_t MW_GetClearClockCfm0Error(void)
Reads and clears the flag indicating a clock frequency error measured by CFM0.
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_ClearErrorChannel(errCh_t ch)
Clears the specified error channel and confirms that the channel is cleared.
errFlag_t MW_GetErrorChannel(errCh_t ch)
Reads the status of the specified error channel.
errCh_t
Hardware error channels found in the Error Controller.
void T_HandleBadInterrupt(void)
Handles bad interrupt requests that do not have a corresponding ISR for handling it.
void T_HandleErrorChInterrupt(void)
Handles Error Channel interrupts by reporting the sources of the first set Error Channel.
void T_HandleClockInterrupt(void)
Handles Clock interrupts by reporting the Error ID of any detected faults and clearing CFM done flags...
void T_HandleBodInterrupt(void)
Handles Brown-out Detector (BOD) Voltage Level Monitor (VLM) interrupt by reporting the associated Er...
void T_HandleCrcInterrupt(void)
Handles CRC Flash scanning interrupts by clearing the periodic interrupt bit and reporting the Error ...
void T_HandleNmiInterrupt(void)
Handles Non-Maskable Interrupts (NMI) by reporting the Error ID of any detected faults.
void T_HandlePowerInterrupt(void)
Handles power related interrupts by reporting the Error ID of any detected faults.
void T_HandleNvmInterrupt(void)
Handles NVM interrupts by reporting the Error ID of any detected faults.
void T_HandleSwdtInterrupt(void)
Handles SWDT interrupts by reporting the Error ID of any detected faults.
void T_HandleRamInterrupt(void)
Handles RAM interrupts by reporting the Error ID of any detected faults.
errFlag_t MW_GetClearRamParityError(void)
Reads and clears the flag indicating a bus parity error detected in the RAM controller.
errFlag_t MW_GetClearNvmEepromEcc2Error(void)
Reads and clears the flag indicating an ECC multi-bit error in EEPROM.
errFlag_t MW_GetClearNvmFlashEcc1Error(void)
Reads and clears the flag indicating a ECC single-bit error in Flash.
errFlag_t MW_GetClearCpuDataParityError(void)
Reads and clears the flag indicating a data bus parity error in the CPU.
errFlag_t MW_GetClearNvmEccCompError(void)
Reads and clears the flag indicating a ECC comparator error in the NVM controller.
errFlag_t MW_GetClearCpuInstrParityError(void)
Reads and clears the flag indicating a instruction bus parity error in the CPU.
errFlag_t MW_GetClearNvmEepromEcc1Error(void)
Reads and clears the flag indicating an ECC single-bit error in EEPROM.
errFlag_t MW_GetClearNvmParityError(void)
Reads and clears the flag indicating a bus parity error detected in the NVM controller.
errFlag_t MW_GetClearNvmFlashEcc2Error(void)
Reads and clears the flag indicating a ECC multi-bit error in Flash.
errFlag_t MW_GetClearCpuOpcodeError(void)
Reads and clears the flag indicating an illegal opcode error in the CPU.
errFlag_t MW_GetClearRamStackError(void)
Reads and clears the flag indicating a stack pointer limit error in SRAM.
errFlag_t MW_GetClearRamEccCompError(void)
Reads and clears the flag indicating a ECC comparator error in the RAM controller.
errFlag_t MW_GetClearRamEcc1Error(void)
Reads and clears the flag indicating an ECC single-bit error in SRAM.
errFlag_t MW_GetClearBusError(void)
Reads and clears the flag indicating an error in the Bus Matrix.
errFlag_t MW_GetClearRamEcc2Error(void)
Reads and clears the flag indicating an ECC multi-bit error in SRAM.
errFlag_t MW_DiagVmonOverEnd(void)
Completes error injection diagnostic to detect faults in the VMON overvoltage detector.
errFlag_t MW_GetClearVmonOverError(void)
Reads and clears the flag indicating an overvoltage error detected by the Voltage Monitor.
errFlag_t MW_GetClearVmonDiagEntryError(void)
Reads and clears the flag indicating a Diagnostic Mode entry error in the Voltage Monitor.
errFlag_t MW_GetClearVmonDiagExitError(void)
Reads and clears the flag indicating an Diagnostic Mode exit error in the Voltage Monitor.
errFlag_t MW_GetClearVmonUnderError(void)
Reads and clears the flag indicating an undervoltage error detected by the Voltage Monitor.
errFlag_t MW_GetClearVlmError(void)
Reads and clears the flag indicating a supply voltage trigger error detected by the Voltage Level Mon...
errFlag_t MW_DiagVmonUnderEnd(void)
Completes error injection diagnostic to detect faults in the VMON undervoltage detector.
errFlag_t MW_GetClearSleepError(void)
Reads and clears the flag indicating a Sleep Aborted error in the Sleep Controller.
bool MW_IsDiagVmonOverDone(void)
Checks if the VMON overvoltage error injection has been completed.
errFlag_t MW_GetClearVmonSleepEntryError(void)
Reads and clears the flag indicating a sleep mode entry error in the Voltage Monitor.
errFlag_t MW_GetClearVmonInternalError(void)
Reads and clears the flag indicating internal error in the Voltage Monitor.
bool MW_IsDiagVmonUnderDone(void)
Checks if the VMON undervoltage error injection has been completed.
errFlag_t MW_GetClearVmonDisabledError(void)
Reads and clears the flag indicating a disabled Voltage Monitor error.
#define FOREVER
Allows testing of infinite while loops by replacing the definition during testing.
errFlag_t MW_GetSwdtClearError(void)
Reads the error flag indicating a non-clear command received while expecting a clear command in the S...
errFlag_t MW_GetSwdtCounterExpiredError(void)
Reads the error flag indicating that the Synchronous Watchdog counter expired.
errFlag_t MW_GetSwdtPreclearError(void)
Reads the error flag indicating a non-preclear command received while expecting a preclear command in...
void MW_ClearSwdtErrors(void)
Clears all the error flags in the Synchronous Watchdog.
errFlag_t MW_GetSwdtUnexpectedCmdError(void)
Reads the error flag indicating a clear command received in the closed window after a preclear comman...
Implements APIs for the Power Manager Diagnostics.