ESM
The Error Signaling Module (ESM) aggregates safety-related events and/or errors resulting from diagnostics from throughout the device into one location that can be monitored internally or externally. It allows designation of events as high priority or low priority interrupts, and also directly manipulate an I/O error pin to signal an external hardware (e.g. external monitor) that an error has occurred. Using the Error Signaling Module allows a single place in the SoC to manage these events, take corrective action, and clear error pin signaling external hardware if appropriate corrective action is taken. An external controller can monitor the error pin and is able to reset the device or keep the system in a safe, known state.
There can be multiple ESM instances on a device, and each one can support multiple error events that come from the various IP blocks in the device. Detailed information regarding the error events supported can be found in the device-specific TRM.
SDL provides the application with an interface to the ESM. Using SDL ESM, the application can initialize the ESM and listen for the desired error events from the device as well as configure the priority and error pin signaling of the events. As part of initialization of the ESM by the application, the application registers a callback for being notified of the error events. This is called by the SDL’s ESM Handler. SDL provides APIs for initializing and configuring the ESM for detecting the HW errors. The application can use the APIs to configure the ESM interrupts and priorities. Also, configuration of the error pin reporting is supported. SDL also provides the ability for the application to manipulate the error pin.
Features Supported
The SDL provides support for the ESM through:
ESM Configuration API
ESM Handler for error handling and notification
ESM nError Pin manipulation API
ESM static register/written config readback APIs
The following can be configured in ESM per instance for each supported event:
Enable of interrupt for the event
Interrupt priority for the event
Enable nErrorPin assertion for the event
The ESM Handler is responsible for handling the errors at runtime and notifying the application via registered callback. The registered callback will run in interrupt context.
SysConfig Features
None
Features NOT Supported
None
Important Usage Guidelines
None
Example Usage
The following shows an example of SDL ESM API usage by the application to set up the ESM to monitor for specific safety events.
In this example, the application configures the ESM for a particular ESM Instance. If there are multiple ESM instances on a device, then all instances for which the application wishes to listen for error events need to be configured. In this example we will configure only one of the ESM Instances
First, we need to decide which event(s) we want to enable, at what priority, and what error pin behavior is desired. To do this, we can reference the |PART_SOC_TRM| to find the ESM error events for each ESM instance. In this example, let’s say that we have reviewed the TRM, and we have decided that we want to
monitor ESM events 10, 11, and 16 for a particular instance
configure event 10 and 11 to be of High priority and to signal on the error pin
configure event 16 to be Low priority and not to signal on the error pin
Include the below file to access the APIs
#include <sdl/sdl_esm.h>
We will set up our ESM config like this:
SDL_ESM_config esmInitConfig =
{
.esmErrorConfig = {0u, 8u}, /* Self test error config - error event to use for self test */
.enableBitmap = {0x00010c00u, 0x00000000u, 0x00000000u},
/**< Enable events 10, 11 and 16. All other events disabled. */
.priorityBitmap = {0x00000c00u, 0x00000000u, 0x00000000u},
/**< Events 10 and 11 high priority, event 16 low priority */
.errorpinBitmap = {0x00000c00u, 0x00000000u, 0x00000000u},
/**< Events 10 and 11 signal the error pin, event 16 does not */
};
Additionally, application should define the callback function through which it will receive ESM notifications, for example:
int32_t SDL_ESM_applicationCallbackFunction(SDL_ESM_Inst esmInst,
SDL_ESM_IntType esmIntrType,
uint32_t grpChannel,
uint32_t index,
uint32_t intSrc,
void *arg)
{
int32_t retVal = SDL_PASS;
DebugP_log("\n ESM Call back function called : instType 0x%x, intType 0x%x, " \
"grpChannel 0x%x, index 0x%x, intSrc 0x%x \n",
esmInst, esmIntrType, grpChannel, index, intSrc);
DebugP_log(" Take action \n");
/* Any additional application specific actions can be added here */
return retVal;
}
Now we can call the SDL_ESM_init API:
:::{only} SOC_AM64X
SDL_ESM_InstType instance = MCU_ESM0;
:::
:::{only} SOC_AM62X or SOC_AM62AX or SOC_AM62PX or SOC_AM62DX or SOC_AM275X
SDL_ESM_InstType instance = WKUP_ESM0;
:::
ret = SDL_ESM_init(instance, &esmInitConfig, SDL_ESM_applicationCallbackFunction,ptr);
if (ret != SDL_PASS)
{
// handle error
}
When error events occur, the Application’s registered callback will be invoked and the application can take action as needed.
If an error pin is asserted due to an error event, the application can additionally decide to clear the error pin:
SDL_ESM_clrNError(instance);
Note that the pin will remain active for the minimum time interval even after being cleared. Once the minimum time interval expires, the clear will take affect.
The application can also force the error pin active:
SDL_ESM_setNError(instance);
The SDL ESM also provides APIs to assist in implementing diagnostics related to static config register readback and readback of written config. In order to verify the written config, after calling SDL_ESM_init, SDL_ESM_verifyConfig may be called:
ret = SDL_ESM_verifyConfig(instance, esmInitConfig);
if (ret != SDL_PASS)
{
// verification failed
}
In order to readback the static config:
ret = SDL_ESM_getStaticRegisters(instance, &staticRegs);
API Reference
Header file contains enumerations, structure definitions and function declarations for SDL Error Signaling Module interface.
The SDL ESM enumerations include:
SDL ESM interrupt types
SDL ESM interrupt sources
SDL ESM Watchdog Timer IDs
The SDL ESM function macros include:
Application provided callback function type for ECC/CCM specific ESM events
The SDL ESM data structures include:
Structure of the ECC error sources which map to the ESM interrupt sources
Structure of the ESM error configuration
Structure of the initial ESM configuration
The SDL ESM APIs include:
API to initialize the SDL ESM
APIs to set/reset nERROR pin
API to get nERROR pin status
API to insert an ESM error
API to execute self test of ESM module
APIs to register handler for ECC/CCM with ESM
APIs to handle ESM high priority/low prioirty/config interrupts
API to get ESM Interrupt Number corresponding to the input ESM interrupt type
Application provided external callback function for ESM handling
ESM ECC Error source type
-
SDL_ESM_ECC_PARAM_MCU_CPU0_SEC_ERROR
MCU CPU0 detected 1-bit ECC error source.
-
SDL_ESM_ECC_PARAM_MCU_CPU0_DED_ERROR
MCU CPU0 detected 2-bit ECC error source.
-
SDL_ESM_ECC_PARAM_MCU_CPU1_SEC_ERROR
MCU CPU1 detected 1-bit ECC error source.
-
SDL_ESM_ECC_PARAM_MCU_CPU1_DED_ERROR
MCU CPU1 detected 2-bit ECC error source.
-
SDL_ESM_ECC_PARAM_MCU_CBASS_SEC_ERROR
MCU CBASS detected 1-bit ECC error source.
-
SDL_ESM_ECC_PARAM_MCU_CBASS_DED_ERROR
MCU CBASS detected 2-bit ECC error source.
-
typedef uint32_t sdlEsmEccErrorSource_t
Source of the ECC error which maps to the ESM interrupt source.
Defines
-
SDL_ESM_INTNUMBER_INVALID
Invalid interrupt number.
-
SDL_ESM_INST_INVALID
Invalid Esm Instance.
-
SDL_ESM_ERRORADDR_INVALID
Address field: Error Address invalid.
-
SDL_ESM_ERRORRAMID_INVALID
Address field: Error RAM ID invalid.
-
SDL_ESM_ERRORBITOFFSET_INVALID
Address field: Error Bit Error Offset invalid.
-
SDL_ESM_ERRORBITGROUP_INVALID
Address field: Error Bit Error Group invalid.
-
SDL_ESM_MAX_EVENT_MAP_NUM_WORDS
Maximum number of EVENT words.
-
SDL_ESM_ECC_PARAM_MAIN_MSMC_AGGR0_SEC_ERROR
Main MSMC ECC AGGR0 detected 1-bit ECC error source.
-
SDL_ESM_ECC_PARAM_MAIN_MSMC_AGGR0_DED_ERROR
Main MSMC ECC AGGR0 detected 2-bit ECC error source.
-
SDL_ESM_ECC_PARAM_MAIN_A72_AGGR0_SEC_ERROR
Main A72 ECC AGGR0 detected 1-bit ECC error source.
-
SDL_ESM_ECC_PARAM_MAIN_A72_AGGR0_DED_ERROR
Main A72 ECC AGGR0 detected 2-bit ECC error source.
Typedefs
-
typedef int32_t SDL_Result
-
typedef int32_t (*SDL_ESM_applicationCallback)(SDL_ESM_Inst instance, SDL_ESM_IntType intrType, uint32_t grpChannel, uint32_t index, uint32_t intSrc, void *arg)
Enums
Functions
-
void SDL_ESM_hiInterruptHandler(void *arg)
Esm Hi Interrupt Handler for MCU Esm Instance.
============================================================================
- Parameters:
arg – argument for handler
-
void SDL_ESM_loInterruptHandler(void *arg)
Esm Lo Interrupt Handler for MCU Esm Instance.
============================================================================
- Parameters:
arg – argument for handler
-
void SDL_ESM_configInterruptHandler(void *arg)
Esm Config Interrupt Handler for MCU Instance.
============================================================================
- Parameters:
arg – argument for handler
-
int32_t SDL_ESM_getIntNumber(SDL_ESM_Inst esmInstType, SDL_ESM_IntType esmIntType)
Esm get Interrupt Number corresponding to the input interrupt type.
============================================================================
- Parameters:
esmInstType – Instance of ESM
esmIntType – ESM Interrupt type
- Returns:
Interrupt Number or SDL_ESM_INTNUMBER_INVALID error
-
struct SDL_ESM_ErrorConfig_t
- #include <sdl_esm.h>
ESM error configuration.
-
struct SDL_ESM_config
- #include <sdl_esm.h>
ESM init configuration.
Public Members
-
SDL_ESM_ErrorConfig_t esmErrorConfig
Error event to be used for self test
-
uint32_t enableBitmap[SDL_ESM_MAX_EVENT_MAP_NUM_WORDS]
ESM Event bitmap
-
uint32_t priorityBitmap[SDL_ESM_MAX_EVENT_MAP_NUM_WORDS]
ESM Event Priority bitmap
-
uint32_t errorpinBitmap[SDL_ESM_MAX_EVENT_MAP_NUM_WORDS]
ESM bitmap for driving error pin: When selected error event occurs the error output pin will be asserted It is the application responsibility to reset the error if the system did not crash or lockup
-
uint32_t pinmininterval
-
SDL_ESM_ErrorConfig_t esmErrorConfig
This file contains the prototypes of the APIs present in the device abstraction layer file of ESM. This also contains some related macros.
ESM Operation Mode type
-
ESM_OPERATION_MODE_NORMAL
Configure ESM operation mode to normal mode
-
ESM_OPERATION_MODE_ERROR_FORCE
Configure ESM operation mode to error force mode
-
typedef uint32_t esmOperationMode_t
ESM Operation Mode type.
ESM Error Output Mode type
-
SDL_ESM_LVL_PINOUT
Configure ESM error output mode to LEVEL output
-
SDL_ESM_PWM_PINOUT
Configure ESM error output mode to PWM output
-
typedef uint32_t esmErrOutMode_t
ESM Error Output Mode type.
ESM Interrupt Type to select level for interrupt.
-
ESM_INTR_TYPE_CONFIG_ERROR
Configure interrupt to high level interrupt
-
ESM_INTR_TYPE_LOW_PRIO_ERROR
Configure interrupt to high level interrupt
-
ESM_INTR_TYPE_HIGH_PRIO_ERROR
Configure interrupt to low level interrupt
-
typedef uint32_t esmIntrType_t
ESM Interrupt Priority Levels
-
ESM_INTR_PRIORITY_LEVEL_LOW
Configure interrupt to low level interrupt
-
ESM_INTR_PRIORITY_LEVEL_HIGH
Configure interrupt to high level interrupt
-
typedef uint32_t esmIntrPriorityLvl_t
Defines
-
ESM_NUMBER_OF_GROUP_REGS
ESM Operation Mode type.
Functions
-
int32_t SDL_ESM_setMode(uint32_t baseAddr, esmOperationMode_t mode)
This API is used to configure operation mode of ESM module.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; esmOperationMode_t mode = ESM_OPERATION_MODE_ERROR_FORCE; int32_t sdlRet; sdlRet = SDL_ESM_setMode (baseAddr, mode);
- Parameters:
baseAddr – Base Address of the ESM Registers.
mode – Channel number for which reset is to be done. Refer enum esmOperationMode_t.
- Returns:
SDL_PASS - API success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_getPinMode(uint32_t baseAddr, esmOperationMode_t *pMode)
This API is used to read operation mode of ESM module.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; esmOperationMode_t mode; uint32_t sdlRet; sdlRet = SDL_ESM_getPinMode (baseAddr, &mode);
- Parameters:
baseAddr – Base Address of the ESM Registers.
pMode – pointer to variable to hold ESM operation Mode. Refer enum esmOperationMode_t.
- Returns:
SDL_PASS - API success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_getErrorOutMode(uint32_t baseAddr, esmOperationMode_t *pMode)
This API is used to read Error Out mode (LVL or PWM) of ESM module.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; esmOperationMode_t mode; uint32_t sdlRet; sdlRet = SDL_ESM_getErrorOutMode (baseAddr, &mode);
- Parameters:
baseAddr – Base Address of the ESM Registers.
pMode – pointer to variable to hold ESM ErrorOut Mode. Refer enum esmErrOutMode_t.
- Returns:
SDL_PASS - API success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_setInfluenceOnErrPin(uint32_t baseAddr, uint32_t intrSrc, bool enable)
This API is used to set the influence of interrupt on nERROR pin.
Note: the intrSrc check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t intrSrc = SDL_ESM1_INTR_MCU0_CPU0_ECC_CORRECTED_LEVEL; int32_t sdlRet; sdlRet = SDL_ESM_setInfluenceOnErrPin (baseAddr, intrSrc, TRUE);
- Parameters:
baseAddr – Base Address of the ESM Registers.
intrSrc – Interrupt source which will influence nERROR pin.
enable – true: Enables influence on nERROR pin if it is TRUE. false:Disables influence on nERROR pin if it is FALSE.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_getInfluenceOnErrPin(uint32_t baseAddr, uint32_t intrSrc, uint32_t *pInfluence)
This API is used to get the influence of interrupt on nERROR pin.
Note: the intrSrc check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t intrSrc = SDL_ESM1_INTR_MCU0_CPU0_ECC_CORRECTED_LEVEL; uint32_t influence; int32_t sdlRet; sdlRet = SDL_ESM_getInfluenceOnErrPin (baseAddr, intrSrc, &influence);
- Parameters:
baseAddr – Base Address of the ESM Registers.
intrSrc – Interrupt source which will influence nERROR pin.
pInfluence – pointer to read the influence value 1: enabled 0: disabled
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_setErrPinLowTimePreload(uint32_t baseAddr, uint32_t lowTime)
This API is used to configure the low time counter pre-load value.
This is the value that will be pre-loaded in to the counter field of the ESM_PIN_CNTR register whenever the ESM enters the ESM_ERROR state from ESM_IDLE. The default value is determined based on the ESM clock frequency, so that there is a minimum low time of 100 micro seconds. This field is only reset by a Power-On-Reset (not warm reset). A global soft reset will set this field to 0h.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t pinCntrPre = 100; int32_t sdlRet; sdlRet = SDL_ESM_setErrPinLowTimePreload (baseAddr, pinCntrPre);
- Parameters:
baseAddr – Base Address of the ESM Registers.
lowTime – Time to be configured as LTCP.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_PWML_setErrPinLowTimePreload(uint32_t baseAddr, uint32_t lowTime)
This API is used to configure the low time counter pre-load value for PWM error.
This is the value that will be loaded in to the counter field of the Error Pin PWM low Counter Value Register whenever the error output pin toggles low.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t pinCntrPre = 100; int32_t sdlRet; sdlRet = SDL_ESM_PWML_setErrPinLowTimePreload(baseAddr, pinCntrPre);
- Parameters:
baseAddr – Base Address of the ESM Registers.
lowTime – Time to be configured as LTCP.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_PWMH_setErrPinHighTimePreload(uint32_t baseAddr, uint32_t highTime)
This API is used to configure the high time counter pre-load value for PWM error.
This is the value that will be loaded in to the counter field of the Error Pin PWM High Counter Value Register whenever the error output pin toggles high.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t pinCntrPre = 100; int32_t sdlRet; sdlRet = SDL_ESM_PWMH_setErrPinHighTimePreload(baseAddr, pinCntrPre);
- Parameters:
baseAddr – Base Address of the ESM Registers.
highTime – Time to be configured as HTCP.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_getErrPinLowTimePreload(uint32_t baseAddr, uint32_t *pLowTime)
This API is used to read the low time counter pre-load value.
This is the value that will be pre-loaded in to the counter field of the ESM_PIN_CNTR register whenever the ESM enters the ESM_ERROR state from ESM_IDLE. The default value is determined based on the ESM clock frequency, so that there is a minimum low time of 100 micro seconds. This field is only reset by a Power-On-Reset (not warm reset). A global soft reset will set this field to 0h.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t inCntrPre; int32_t sdlRet; sdlRet = SDL_ESM_getErrPinLowTimePreload (baseAddr, &inCntrPre);
- Parameters:
baseAddr – Base Address of the ESM Registers.
pLowTime – pointer to Time to be read as LTCP.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_PWML_getErrPinLowTimePreload(uint32_t baseAddr, uint32_t *pPinPWMLCntrPre)
This API is used to read the low time counter pre-load value for PWM error.
This is the value that will be loaded in to the counter field of the Error Pin PWM Low Counter Value Register whenever the error output pin toggles low.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t inCntrPre; int32_t sdlRet; sdlRet = SDL_ESM_PWML_getErrPinLowTimePreload(baseAddr, &inCntrPre);
- Parameters:
baseAddr – Base Address of the ESM Registers.
pPinPWMLCntrPre – pointer to Time to be read as LTCP.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_PWMH_getErrPinHighTimePreload(uint32_t baseAddr, uint32_t *pPinPWMHCntrPre)
This API is used to read the High time counter pre-load value for PWM error.
This is the value that will be loaded in to the counter field of the Error Pin PWM High Counter Value Register whenever the error output pin toggles high.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t inCntrPre; int32_t sdlRet; sdlRet = SDL_ESM_PWMH_getErrPinHighTimePreload(baseAddr, inCntrPre);
- Parameters:
baseAddr – Base Address of the ESM Registers.
pPinPWMHCntrPre – pointer to Time to be read as HTCP.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_getCurrErrPinLowTimeCnt(uint32_t baseAddr, uint32_t *pPinCntrPre)
This API is used to get the current value of low time counter.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t pinCntrPre; int32_t sdlRet; sdlRet = SDL_ESM_getCurrErrPinLowTimeCnt (baseAddr, &pinCntrPre);
- Parameters:
baseAddr – Base Address of the ESM Registers.
pPinCntrPre – pointer to Counter value Current low time count.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_PWML_getCurrErrPinLowTimeCnt(uint32_t baseAddr, uint32_t *pLowPWMLTime)
This API is used to get the current value of low time counter for PWM error.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t pinCntrPre; int32_t sdlRet; sdlRet = SDL_ESM_PWML_getCurrErrPinLowTimeCnt(baseAddr, &pinCntrPre);
- Parameters:
baseAddr – Base Address of the ESM Registers.
pLowPWMLTime – pointer to Counter value Current low time count for PWM error.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_PWMH_getCurrErrPinHighTimeCnt(uint32_t baseAddr, uint32_t *pHighPWMHTime)
This API is used to get the current value of high time counter for PWM error.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t pinCntrPre; int32_t sdlRet; sdlRet = SDL_ESM_PWMH_getCurrErrPinHighTimeCnt(baseAddr, &pinCntrPre);
- Parameters:
baseAddr – Base Address of the ESM Registers.
pHighPWMHTime – pointer to Counter value Current high time count for PWM error.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_getErrPinStatus(uint32_t baseAddr, uint32_t *pStatus)
This API is used to get the current status of nERROR pin.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t status; uint32_t sdlRet; sdlRet = SDL_ESM_getErrPinStatus (baseAddr, &status);
- Parameters:
baseAddr – Base Address of the ESM Registers.
pStatus – pointer to Current nERROR pin status.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_resetErrPin(uint32_t baseAddr)
This API is used to reset the nERROR pin.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; int32_t sdlRet; sdlRet = SDL_ESM_resetErrPin (baseAddr);
Note
This will set the nERROR pin to high.
- Parameters:
baseAddr – Base Address of the ESM Registers.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_isEnableCfgIntr(uint32_t baseAddr, uint32_t group, uint32_t *pEnStatus)
This API is used check if the configuration interrupt for a group is enabled/disabled.
Note: the group check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t status, group = 0u; int32_t sdlRet; sdlRet = SDL_ESM_isEnableCfgIntr (baseAddr, group, &status);
- Parameters:
baseAddr – Base Address of the ESM Registers.
group – Group number for which to check if the interrupt is enabled.
pEnStatus – Pointer to status of interrupt enable variable
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_isEnableIntr(uint32_t baseAddr, uint32_t intrSrc, uint32_t *pEnStatus)
This API is used check if interrupt is enabled/disabled.
Note: the intrSrc check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t status, intrNum = 0u; int32_t sdlRet; sdlRet = SDL_ESM_isEnableIntr (baseAddr, intrNum, &status);
- Parameters:
baseAddr – Base Address of the ESM Registers.
intrSrc – Interrupt to enable.
pEnStatus – Pointer to status of interrupt enable variable
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_disableCfgIntr(uint32_t baseAddr, uint32_t group)
This API is used to disable the configuration interrupt.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t intrNum = 0u; int32_t sdlRet; sdlRet = SDL_ESM_disableCfgIntr (baseAddr, group);
- Parameters:
baseAddr – Base Address of the ESM Registers.
group – Group Interrupt Number to diable
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
None
- Post:
None
-
int32_t SDL_ESM_enableCfgIntr(uint32_t baseAddr, uint32_t group)
This API is used to enable the configuration interrupt.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t group = 0u; int32_t status; status = SDL_ESM_enableCfgIntr (baseAddr, group);
- Parameters:
baseAddr – Base Address of the ESM Registers.
group – Group for which to enable configuration interrupt.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_enableIntr(uint32_t baseAddr, uint32_t intrNum)
This API is used to enable interrupt.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t intrNum = 0u; int32_t status; status = SDL_ESM_enableIntr (baseAddr, intrNum);
- Parameters:
baseAddr – Base Address of the ESM Registers.
intrNum – Interrupt to enable.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_disableIntr(uint32_t baseAddr, uint32_t intrNum)
This API is used to disable interrupt.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t intrNum = 0u; int32_t sdlRet; sdlRet = SDL_ESM_setInfluenceOnErrPin (baseAddr, intrNum);
- Parameters:
baseAddr – Base Address of the ESM Registers.
intrNum – Interrupt to disable.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
None
- Post:
None
-
int32_t SDL_ESM_setIntrPriorityLvl(uint32_t baseAddr, uint32_t intrSrc, esmIntrPriorityLvl_t intrPriorityLvl)
This API is used to set interrupt level.
Note: the intrSrc check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t intrSrc = SDL_ESM1_INTR_MCU0_CPU0_ECC_CORRECTED_LEVEL; esmIntrPriorityLvl_t pri = ESM_INTR_PRIORITY_LEVEL_HIGH; int32_t sdlRet; sdlRet = SDL_ESM_setIntrPriorityLvl (baseAddr, intrSrc, pri);
- Parameters:
baseAddr – Base Address of the ESM Registers.
intrSrc – Interrupt to set the level.
intrPriorityLvl – Interrupt level to set. Refer enum esmIntrPriorityLvl_t.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_getIntrPriorityLvl(uint32_t baseAddr, uint32_t intrSrc, esmIntrPriorityLvl_t *pIntrPriorityLvl)
This API is used to get interrupt level.
Note: the intrSrc check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t intrSrc = SDL_ESM1_INTR_MCU0_CPU0_ECC_CORRECTED_LEVEL; esmIntrPriorityLvl_t pri; int32_t sdlRet; sdlRet = SDL_ESM_getIntrPriorityLvl (baseAddr, intrSrc, &pri);
- Parameters:
baseAddr – Base Address of the ESM Registers.
intrSrc – Interrupt to set the level.
pIntrPriorityLvl – Pointer to Interrupt level to get. Refer enum esmIntrPriorityLvl_t.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_getCfgIntrStatus(uint32_t baseAddr, uint32_t group, uint32_t *pStatus)
This API is used to get the configuration interrupt status for a group.
Note: the group check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t status, group = 0u; int32_t sdlRet; sdlRet = SDL_ESM_getCfgIntrStatus (baseAddr, group, &status);
- Parameters:
baseAddr – Base Address of the ESM Registers.
group – Group for which status to return.
pStatus – pointer to interrupt status
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_getIntrStatus(uint32_t baseAddr, uint32_t intrSrc, uint32_t *pStatus)
This API is used to get the interrupt status.
Note: the intrSrc check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t status, intrSrc = SDL_ESM1_INTR_MCU0_CPU0_ECC_CORRECTED_LEVEL; int32_t sdlRet; sdlRet = SDL_ESM_getIntrStatus (baseAddr, intrSrc, &status);
- Parameters:
baseAddr – Base Address of the ESM Registers.
intrSrc – Interrupt for which status to return.
pStatus – pointer to interrupt status
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_setCfgIntrStatusRAW(uint32_t baseAddr, uint32_t group)
This API is used to set the configuration interrupt RAW status for a group.
Note: the group check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t group = 0u; int32_t sdlRet; sdlRet = SDL_ESM_setCfgIntrStatusRAW (baseAddr, group);
- Parameters:
baseAddr – Base Address of the ESM Registers.
group – Group for which status to return.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_setIntrStatusRAW(uint32_t baseAddr, uint32_t intrSrc)
This API is used to set the interrupt RAW status.
Note: the intrSrc check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t intrSrc = SDL_ESM1_INTR_MCU0_CPU0_ECC_CORRECTED_LEVEL; int32_t sdlRet; sdlRet = SDL_ESM_setIntrStatusRAW (baseAddr, intrSrc);
- Parameters:
baseAddr – Base Address of the ESM Registers.
intrSrc – Interrupt for which status to return.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_getIntrStatusRAW(uint32_t baseAddr, uint32_t intrSrc, uint32_t *pStatus)
This API is used to get the interrupt RAW status.
Note: the intrSrc check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t intrSrc = SDL_ESM1_INTR_MCU0_CPU0_ECC_CORRECTED_LEVEL; uitn32_t status; int32_t sdlRet; sdlRet = SDL_ESM_getIntrStatusRAW (baseAddr, intrSrc, &status);
- Parameters:
baseAddr – Base Address of the ESM Registers.
intrSrc – Interrupt for which status to return.
pStatus – pointer to Interrupt status.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_getGroupIntrStatus(uint32_t baseAddr, esmIntrPriorityLvl_t intrPrioType, esmGroupIntrStatus_t *pIntrstatus)
This API is used to get the interrupt/error status for a group. This will also return highest pending interrupt for pulse as well as for level interrupts.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; esmIntrPriorityLvl priType = ESM_INTR_PRIORITY_LEVEL_HIGH; esmGroupIntrStatus_t groupIntrStatus; int32_t sdlRet; sdlRet = SDL_ESM_getGroupIntrStatus (baseAddr, priType, &groupIntrStatus);
- Parameters:
baseAddr – Base Address of the ESM Registers.
intrPrioType – Group for which status to return. Refer enum esmIntrPriorityLvl_t.
pIntrstatus – pointer to Interrupt status. Refer struct esmGroupIntrStatus_t.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_clearCfgIntrStatus(uint32_t baseAddr, uint32_t group)
This API is used to clear the configuration interrupt status.
Note: the group check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t group = 0u; int32_t sdlRet; sdlRet = SDL_ESM_clearCfgIntrStatus (baseAddr, group);
- Parameters:
baseAddr – Base Address of the ESM Registers.
group – Group for which to clear the configuration interrupt to clear status.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_clearIntrStatus(uint32_t baseAddr, uint32_t intrSrc)
This API is used to clear the interrupt status.
Note: the intrSrc check is only at the IP level max and not done at instance level, so it is expected to be done at higher layer.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t intrSrc = SDL_ESM1_INTR_MCU0_CPU0_ECC_CORRECTED_LEVEL; int32_t sdlRet; sdlRet = SDL_ESM_clearIntrStatus (baseAddr, intrSrc);
- Parameters:
baseAddr – Base Address of the ESM Registers.
intrSrc – Interrupt to clear status.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_writeEOI(uint32_t baseAddr, esmIntrType_t intrType)
This API is used to write EOI.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; esmIntrType_t intrType = ESM_INTR_TYPE_HIGH_PRIO_ERROR; int32_t sdlRet; sdlRet = SDL_ESM_writeEOI (baseAddr, intrType);
- Parameters:
baseAddr – Base Address of the ESM Registers.
intrType – Type of interrupt for which to write EOI. Refer enum esmIntrType_t.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_getRevisionId(uint32_t baseAddr, esmRevisionId_t *pRevId)
This API is used get the ESM revision ID.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; esmRevisionId_t revId; int32_t sdlRet; sdlRet = ESMGetRevisionId (baseAddr, &revId);
- Parameters:
baseAddr – Base Address of the ESM Registers.
pRevId – Pointer to Revision ID of ESM module.. Refer struct esmRevisionId_t.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_getInfo(uint32_t baseAddr, esmInfo_t *pInfo)
This API is used read the ESM information register.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; esmInfo_t esmInfo; int32_t sdlRet; sdlRet = ESMGetInfo (baseAddr, &esmInfo);
- Parameters:
baseAddr – Base Address of the ESM Registers.
pInfo – pointer to variable that Contains information register contents of ESM module.. Refer struct esmInfo_t.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
None
- Post:
None
-
int32_t SDL_ESM_getGlobalIntrEnabledStatus(uint32_t baseAddr, uint32_t *pStatus)
This API is used read the ESM information register.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t enStatus; int32_t sdlRet; sdlRet = ESMGetGlobalIntrEnabledStatus (baseAddr, &enStatus);
- Parameters:
baseAddr – Base Address of the ESM Registers.
pStatus – pointer to is global Interrupt enabled status 0h: all interrupts are enabled Fh: all interrupts are disabled -others: interrupts are in invalid state.Software should never write these values. If these values are ever read, they indicate that an error has occurred. In this state, all interrupts are enabled (biased to false enable).
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
None
- Post:
None
-
int32_t SDL_ESM_enableGlobalIntr(uint32_t baseAddr)
This API is used to enable Global control of interrupt.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; int32_t sdlRet; sdlRet = ESMEnableGlobalIntr (baseAddr);
- Parameters:
baseAddr – Base Address of the ESM Registers.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_disableGlobalIntr(uint32_t baseAddr)
This API is used to disable Global control of interrupt.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t sdlRet; sdlRet = ESMDisableGlobalIntr (baseAddr);
- Parameters:
baseAddr – Base Address of the ESM Registers.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
ESM module is reset and initialized for desired operation
- Post:
None
-
int32_t SDL_ESM_reset(uint32_t baseAddr)
This API is used to reset ESM module. Reset is used to reset all enables and raw status bits.
Example
uint32_t baseAddr = SDL_MCU_ESM0_CFG_BASE; uint32_t sdlRet; sdlRet = ESMReset (baseAddr);
- Parameters:
baseAddr – Base Address of the ESM Registers.
- Returns:
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments
- Pre:
None
- Post:
None
-
struct esmRevisionId_t
- #include <esm.h>
Structure for accessing Revision ID of ESM module.
-
struct esmInfo_t
- #include <esm.h>
Structure for accessing information register of ESM module.
-
struct esmGroupIntrStatus_t
- #include <esm.h>
Structure to access the status of interrupts belonging to a High or Low priority interrupt.
Public Members
-
uint32_t highestPendPlsIntNum
Indicates what is the highest priority High Priority interrupt caused by a pulse number.
-
uint32_t highestPendLvlIntNum
Indicates what is the highest priority High Priority interrupt caused by a level number.
-
uint32_t grpIntrStatus
Indicates which Event Groups have one or more interrupts pending. This register is bit oriented where bit 0 is for Event Group 0, bit 1 is for Event Group 1, etc… (bit N is for Event Group N).
-
uint32_t highestPendPlsIntNum
-
struct SDL_esmRegs_ERR_GRP_STATIC
- #include <esm.h>
ESM Error Group static registers list.
-
struct SDL_ESM_staticRegs
- #include <esm.h>
ESM static registers list.
Public Members
-
SDL_esmRegs_ERR_GRP_STATIC ERR_GRP[ESM_NUMBER_OF_GROUP_REGS]
-
uint32_t PID
-
uint32_t INFO
-
uint32_t EN
-
uint32_t ERR_EN_SET
-
uint32_t ERR_EN_CLR
-
uint32_t LOW_PRI
-
uint32_t HI_PRI
-
uint32_t LOW
-
uint32_t HI
-
uint32_t PIN_CTRL
-
uint32_t PIN_CNTR_PRE
-
uint32_t PWMH_PIN_CNTR_PRE
-
uint32_t PWML_PIN_CNTR_PRE
-
SDL_esmRegs_ERR_GRP_STATIC ERR_GRP[ESM_NUMBER_OF_GROUP_REGS]