FuSa 8-Bit Libraries Safety Framework
Loading...
Searching...
No Matches
tasks_shared_private.c
Go to the documentation of this file.
1
22
23// Framework Includes
24#include <define_error_flags.h>
25#include <define_error_ids.h>
26#include <error_handler.h>
34
36{
38 {
41
44
45 // The channel can only be cleared after all error sources are cleared
47 EH_HandleError(flag, ERRID_VREGFAIL_CH); // In case the channel was not cleared
48 }
49}
50
52{
54 {
57
58 // Check and report if bus error was due to bus parity error (ECC errors are reported and
59 // cleared separately)
60 if (flag == ERROR)
61 {
64
67 }
68
71
72 // The channel can only be cleared after all error sources are cleared
74 EH_HandleError(flag, ERRID_BUSERR_CH); // In case the channel was not cleared
75 }
76}
77
79{
81 {
84
87
88 // The channel can only be cleared after all error sources are cleared
90 EH_HandleError(flag, ERRID_RAM2_CH); // In case the channel was not cleared
91 }
92}
93
95{
97 {
100
103
104 // The channel can only be cleared after all error sources are cleared
106 EH_HandleError(flag, ERRID_FLASH2_CH); // In case the channel was not cleared
107 }
108}
109
111{
113 {
116
119
120 // The channel can only be cleared after all error sources are cleared
122 EH_HandleError(flag, ERRID_OPC_CH); // In case the channel was not cleared
123 }
124}
125
127{
129 {
131 /* For Error Channels with only one error source,
132 the Channel Error ID is reported to the Error Handler. */
134
135 // The channel can only be cleared after all error sources are cleared
137 EH_HandleError(flag, ERRID_SPLIM_CH); // In case the channel was not cleared
138 }
139}
140
142{
144 {
147
148 // The channel can only be cleared after all error sources are cleared
150 EH_HandleError(flag, ERRID_RAM1_CH); // In case the channel was not cleared
151 }
152}
153
155{
157 {
160
161 // The channel can only be cleared after all error sources are cleared
163 EH_HandleError(flag, ERRID_FLASH1_CH); // In case the channel was not cleared
164 }
165}
166
168{
170 {
173
176
179
182
185
186 flag = MW_GetClearSleepError();
188
189 // The channel can only be cleared after all error sources are cleared
191 EH_HandleError(flag, ERRID_VREGWARN_CH); // In case the channel was not cleared
192 }
193}
194
196{
198 {
201
202 // The channel can only be cleared after all error sources are cleared
204 EH_HandleError(flag, ERRID_CFD0_CH); // In case the channel was not cleared
205 }
206}
207
209{
211 {
214
215 // The channel can only be cleared after all error sources are cleared
217 EH_HandleError(flag, ERRID_CFD1_CH); // In case the channel was not cleared
218 }
219}
220
222{
224 {
227
228 // The channel can only be cleared after all error sources are cleared
230 EH_HandleError(flag, ERRID_CFM0_CH); // In case the channel was not cleared
231 }
232}
233
235{
237 {
240
241 // The channel can only be cleared after all error sources are cleared
243 EH_HandleError(flag, ERRID_CFM1_CH); // In case the channel was not cleared
244 }
245}
246
248{
250 {
253
254 flag = MW_GetSwdtClearError();
256
259
262
263 MW_ClearSwdtErrors(); // The error flags cannot be cleared individually in hardware
264
265 // The channel can only be cleared after all error sources are cleared
267 EH_HandleError(flag, ERRID_SWDT_CH); // In case the channel was not cleared
268 }
269}
270
272{
274 {
277
280
281 // The channel can only be cleared after all error sources are cleared
283 EH_HandleError(flag, ERRID_EEPROM_CH); // In case the channel was not cleared
284 }
285}
286
288{
290 {
291 /*
292 * Clear and report the error channel directly, without attempting to clear the source,
293 * as it is unknown. When the event type is a "pulse", the source will be automatically
294 * cleared unless there is an error. For a "level" event type, it is assumed that the
295 * channel and the source is cleared in the error handler callback.
296 */
299 EH_HandleError(flag, ERRID_EVSYS0_CLEAR); // In case the channel was not cleared
300 }
301}
302
304{
306 {
307 /*
308 * Clear and report the error channel directly, without attempting to clear the source,
309 * as it is unknown. When the event type is a "pulse", the source will be automatically
310 * cleared unless there is an error. For a "level" event type, it is assumed that the
311 * channel and the source is cleared in the error handler callback.
312 */
315 EH_HandleError(flag, ERRID_EVSYS1_CLEAR); // In case the channel was not cleared
316 }
317}
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.
@ NO_ERROR
Defines for IDs associated with specific errors.
@ ERRID_EVSYS1_CLEAR
@ ERRID_FLASH2_COMP
@ ERRID_SWDT_EXP
@ ERRID_EEPROM_ECC1
@ ERRID_CFD1_CH
@ ERRID_SWDT_CH
@ ERRID_BUSERR_PARITYD
@ ERRID_OPC_PARITYI
@ ERRID_VREGFAIL_VUV
@ ERRID_CFM1_CH
@ ERRID_VREGWARN_CH
@ ERRID_SWDT_UC
@ ERRID_VREGWARN_VSLP
@ ERRID_RAM2_COMP
@ ERRID_VREGFAIL_VOV
@ ERRID_VREGWARN_SERR
@ ERRID_BUSERR_CH
@ ERRID_EVSYS0_CLEAR
@ ERRID_FLASH1_CH
@ ERRID_RAM1_CH
@ ERRID_VREGFAIL_CH
@ ERRID_SPLIM_CH
@ ERRID_VREGWARN_VDEXIT
@ ERRID_EEPROM_CH
@ ERRID_SWDT_BADPC
@ ERRID_CFD0_CH
@ ERRID_EVSYS0_CH
@ ERRID_SWDT_BADC
@ ERRID_RAM_PARITY
@ ERRID_VREGWARN_VDENTER
@ ERRID_FLASH2_ECC2
@ ERRID_VREGWARN_VERR
@ ERRID_OPC_OPC
@ ERRID_OPC_CH
@ ERRID_BUSERR_BUSERR
@ ERRID_RAM2_ECC2
@ ERRID_VREGWARN_VDIS
@ ERRID_NVM_PARITY
@ ERRID_FLASH2_CH
@ ERRID_EEPROM_ECC2
@ ERRID_RAM2_CH
@ ERRID_CFM0_CH
@ ERRID_EVSYS1_CH
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.
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_VREGFAIL
@ ERRCH_VREGWARN
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_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_GetClearSleepError(void)
Reads and clears the flag indicating a Sleep Aborted error in the Sleep Controller.
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.
errFlag_t MW_GetClearVmonDisabledError(void)
Reads and clears the flag indicating a disabled Voltage Monitor error.
void ReportClearEepromChannelError(void)
Private function, only exposed for unit testing and should not be called directly.
void ReportClearFlash2ChannelError(void)
Private function, only exposed for unit testing and should not be called directly.
void ReportClearRam2ChannelError(void)
Private function, only exposed for unit testing and should not be called directly.
void ReportClearFlash1ChannelError(void)
Private function, only exposed for unit testing and should not be called directly.
void ReportClearSwdtChannelError(void)
Private function, only exposed for unit testing and should not be called directly.
void ReportClearEvsys1ChannelError(void)
Private function, only exposed for unit testing and should not be called directly.
void ReportClearCfd0ChannelError(void)
Private function, only exposed for unit testing and should not be called directly.
void ReportClearRam1ChannelError(void)
Private function, only exposed for unit testing and should not be called directly.
void ReportClearVregwarnChannelError(void)
Private function, only exposed for unit testing and should not be called directly.
void ReportClearSplimChannelError(void)
Private function, only exposed for unit testing and should not be called directly.
void ReportClearBuserrChannelError(void)
Private function, only exposed for unit testing and should not be called directly.
void ReportClearOpcChannelError(void)
Private function, only exposed for unit testing and should not be called directly.
void ReportClearCfm0ChannelError(void)
Private function, only exposed for unit testing and should not be called directly.
void ReportClearCfd1ChannelError(void)
Private function, only exposed for unit testing and should not be called directly.
void ReportClearVregfailChannelError(void)
Private function, only exposed for unit testing and should not be called directly.
void ReportClearCfm1ChannelError(void)
Private function, only exposed for unit testing and should not be called directly.
void ReportClearEvsys0ChannelError(void)
Private function, only exposed for unit testing and should not be called directly.
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...
Contains private function prototypes for tasks_shared.h.