eLooM for STM32 application
v3.3.0
A framework for multitasking low power embedded applications powerd by STM32
|
Define the global error management API. More...
Go to the source code of this file.
Data Structures | |
union | _sys_error_t |
Macros | |
#define | SYS_ERR_EVT_SRC_IAED 0x1U |
Event generated from the IApplicationErrorDelegate. | |
#define | SYS_ERR_EVT_PARAM_CHECK_TASKS 0x1U |
Event parameter: check is tasks are still running. | |
#define | SYS_ERR_EVT_PARAM_EFT 0x2U |
Event parameter: EFT error detected. | |
#define | SYS_ERR_EVT_PARAM_EFT_TIMEOUT 0x3U |
Event parameter: EFT error timeout. | |
#define | SYS_ERR_EVT_PARAM_NOP 0x4U |
Event parameter: EFT IRQ to be ignored. | |
#define | SYS_ERR_MAKE_EVENT(src, params) ((((src) & 0X7U) | (((params)<<3) & 0xF8U) | (0x1U<<31)) & 0x800000FF) |
#define | SYS_IS_ERROR_EVENT(evt) ((evt).xEvent.nEventType == 1U) |
#define | APP_BASE_ERROR_CODE SYS_LAST_ERROR_CODE + ((sys_error_code_t)1) |
< Initial value for the application defined error codes. | |
Typedefs | |
typedef uint16_t | sys_error_code_t |
typedef union _sys_error_t | sys_error_t |
Functions | |
sys_error_code_t | SysPostErrorEvent (SysEvent xEvent) |
void | SysResetAEDCounter (void) |
void | sys_error_handler (void) |
Variables | |
sys_error_t | g_nSysError |
Define the global error management API.
The system uses a single 32 bits global variable to track the last runtime error. This variable stores in the last significant 16 bits (bit [0,15]) the last error occurred in the Low Level API layer. The last error occurred in the Service Layer level is stored in the most significant 16 bits (bit [16, 31]). The application uses the SYS_GET_LAST_ERROR() macro to retrieve the last error.
Copyright (c) 2016 STMicroelectronics. All rights reserved.
This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.
#define SYS_ERR_MAKE_EVENT | ( | src, | |
params | |||
) | ((((src) & 0X7U) | (((params)<<3) & 0xF8U) | (0x1U<<31)) & 0x800000FF) |
Macro to make system error event.
src | [IN] specifies the source of the event |
params | [IN] specifies a parameter. Its value depend on the event source. |
#define SYS_IS_ERROR_EVENT | ( | evt | ) | ((evt).xEvent.nEventType == 1U) |
Macro to check the .nEventType of a system event.
evt | [IN] specifies an event |
typedef uint16_t sys_error_code_t |
Create type name for sys_error_code_t.
typedef union _sys_error_t sys_error_t |
Specifies the format of the global error used by the system to track the last error occurred.
void sys_error_handler | ( | void | ) |
This function is executed in case of error occurrence. If the application is in Debug configuration it inserts a dynamic breakpoint.
sys_error_code_t SysPostErrorEvent | ( | SysEvent | xEvent | ) |
Notify the system about an event related to the error management. This function can be called also from an ISR.
xEvent | [IN] specifies a error event. |
void SysResetAEDCounter | ( | void | ) |
Reset the counter of the AED. Usually an AED use some kind of timeout to check that all managed tasks are working fine. A task should call this method before a critical operation, that is for example a write operation in FLASH or EEPROM, or a long critical section. For convenience the managed task interface has a function IMTResetAEDCounter() that can be used by a task instead of call directly the system function.
|
extern |
This is the global variable that store the last low level and the last service level error code.