![]() |
FuSa 8-Bit Libraries Safety Framework
|
Contains API prototypes for the Error Handler. More...
Topics | |
| Error Handler Config | |
| Declares configurations for the Error Handler. | |
Files | |
| file | error_handler.c |
| Implements APIs the Error Handler. | |
| file | error_handler_actions.c |
| Implements APIs for Error Handler Actions. | |
| file | error_handler_actions.h |
| Contains API prototypes for Error Handler Actions. | |
| file | error_handler_callbacks.c |
| Implements APIs for Error Handler Callbacks. | |
| file | error_handler_callbacks.h |
| Contains API prototypes for Error Handler callback examples. | |
Functions | |
| void | EH_HandleError (errFlag_t flag, errId_t id) |
| Handles error based on configured Error ID criticality if the error flag is set. | |
| void | EH_ProcessNotificationLog (void) |
| Processes all Error IDs in the log by calling the configured handler callback. | |
| void | EH_InitiateSafeState (errId_t id) |
| Transitions the system into a Safe State and resets the device. | |
| void | EH_PushNotificationLog (errId_t id) |
| Pushes Error ID to the Notification Error Log for later handling. | |
| errId_t | EH_PopNotificationLog (void) |
| Pops the last Error ID from the Notification Error Log for error handling. | |
| void | EH_NonCriticalErrorExampleCallback (errId_t id) |
| Demonstrates an implementation of a 'NON_CRITICAL' Error Handler callback function. | |
| void | EH_NotificationErrorExampleCallback (errId_t id) |
| Demonstrates an implementation of a 'NOTIFICATION' Error Handler callback function. | |
Contains API prototypes for the Error Handler.
The Error Handler is responsible for providing a configurable and centralized error handling mechanism for both hardware and software error flags. Unique Error IDs are reported by Tasks and handled according to their configured criticality levels.
Handles error based on configured Error ID criticality if the error flag is set.
This function evaluates the error flag and returns without further action if set to NO_ERROR. For ERROR, the appropriate error handling action is executed based on the configured Error ID criticality in the errorIdCritLut :
CRITICAL errors are immediately handled by calling EH_InitiateSafeState, where the Error ID will be stored to be handled after a system reset.
NON_CRITICAL errors are immediately handled by calling the application specific error handler callback configured in nonCriticalErrorCallback, where the Error ID is passed for handling according to application requirements.
NOTIFICATION errors are handled later by calling EH_PushNotificationLog, where the Error ID is put into a notification error log that is processed when calling EH_ProcessNotificationLog. The number of errId_t in the log is limited by the NOTIFICATION_LOG_SIZE configuration.
IGNORE errors are not handled.
| flag | The error flag indicating whether an error requires handling. |
| id | The Error ID corresponding to the error that occurred. |
Definition at line 35 of file error_handler.c.
| void EH_InitiateSafeState | ( | errId_t | id | ) |
Transitions the system into a Safe State and resets the device.
This function immediately enters a Safe State by first disabling global interrupts and force floating all I/O pins. It then stores the reported Error ID in persistent memory so that the reset reason can be handled after the device reset. Finally, it enters an infinite loop where it tries to issue a software reset, disable the Error Controller heartbeat signal and re-attempt to float I/O pins in case it failed. This loop will continue until a successful device reset occurs, either through the software reset, an external reset, Error Controller reset or the Watchdog Timer expiring.
| id | The reported Error ID indicating the reset reason to store in persistent memory. |
Definition at line 39 of file error_handler_actions.c.
| void EH_NonCriticalErrorExampleCallback | ( | errId_t | id | ) |
Demonstrates an implementation of a 'NON_CRITICAL' Error Handler callback function.
| id | Error ID for cause of NON_CRITICAL error. |
Definition at line 26 of file error_handler_callbacks.c.
| void EH_NotificationErrorExampleCallback | ( | errId_t | id | ) |
Demonstrates an implementation of a 'NOTIFICATION' Error Handler callback function.
| id | Error ID for cause of NOTIFICATION error. |
Definition at line 32 of file error_handler_callbacks.c.
| errId_t EH_PopNotificationLog | ( | void | ) |
Pops the last Error ID from the Notification Error Log for error handling.
The function returns the Error ID from the Notification Error Log unless it is empty, then ERRID_NONE is returned. The Notification Error Log is implemented as a stack using the Last-In-First-Out (LIFO) principle. This means that the error that is popped from the log is the last error that was pushed to the log when calling EH_PushNotificationLog. Once the error is popped from the log it is removed from the stack.
| ERRID_NONE | The Error ID that indicates an empty Notification Error Log. |
| ERRID_ERRID_VAL | The Error ID returned when an invalid ID is popped from the log. |
Definition at line 68 of file error_handler_actions.c.
| void EH_ProcessNotificationLog | ( | void | ) |
Processes all Error IDs in the log by calling the configured handler callback.
The Notification Error Log is populated by EH_HandleError for later processing when handling errId_t with criticality NOTIFICATION. This Task needs to be called to do the handling of the errors at a later time.
The Error IDs in the Notification Error Log are processed by calling EH_PopNotificationLog to retrieve the logged errId_t and issuing the configured notificationErrorCallback. The last Error ID added to the log is the first to be processed (LIFO). Error IDs are removed from the log when they are processed and the processing ends when there are no more IDs in the log.
Definition at line 101 of file error_handler.c.
| void EH_PushNotificationLog | ( | errId_t | id | ) |
Pushes Error ID to the Notification Error Log for later handling.
This function adds an Error ID to the Notification Error Log unless it is full. If the log is full, the Error ID is discarded. The Notification Error Log is implemented as a stack using the Last-In-First-Out (LIFO) principle. This means that the last error that is pushed to the log is the first error that is popped from the log when calling EH_PopNotificationLog.
| id | The Error ID to report to the Notification Error Log. |
Definition at line 58 of file error_handler_actions.c.