The MCUXpresso SDK provides a driver for the XECC module of MCUXpresso SDK devices.
The XECC module supports Single Error Correction and Double Error Detection(SEC-DED) ECC function to provide reliability for external memory ECC region access.
This example code shows how to correct single error and detect multiple error using the XECC driver.
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/xecc
|
enum | {
kXECC_SingleErrorInterruptEnable = XECC_ERR_SIG_EN_SINGLE_ERR_SIG_EN_MASK,
kXECC_MultiErrorInterruptEnable = XECC_ERR_SIG_EN_MULTI_ERR_SIG_EN_MASK,
kXECC_AllInterruptsEnable
} |
| XECC interrupt configuration structure, , xecc_interrupt_enable_t. More...
|
|
enum | {
kXECC_SingleErrorInterruptStatusEnable,
kXECC_MultiErrorInterruptStatusEnable,
kXECC_AllInterruptsStatusEnable
} |
| XECC interrupt status configuration structure, xecc_interrupt_status_enable_t. More...
|
|
enum | {
kXECC_SingleErrorInterruptFlag,
kXECC_MultiErrorInterruptFlag,
kXECC_AllInterruptsFlag
} |
| XECC status flags, xecc_interrupt_status_t. More...
|
|
struct xecc_single_error_info_t |
struct xecc_multi_error_info_t |
This structure contains the settings for all of the XECC interrupt configurations.
Enumerator |
---|
kXECC_SingleErrorInterruptEnable |
Single bit error interrupt enable.
|
kXECC_MultiErrorInterruptEnable |
Multiple bit error interrupt enable.
|
kXECC_AllInterruptsEnable |
all interrupts enable
|
This structure contains the settings for all of the XECC interrupt status configurations.
Enumerator |
---|
kXECC_SingleErrorInterruptStatusEnable |
Single bit error interrupt status enable.
|
kXECC_MultiErrorInterruptStatusEnable |
Multiple bits error interrupt status enable.
|
kXECC_AllInterruptsStatusEnable |
all interrupts enable
|
This provides constants for the XECC status flags for use in the XECC functions.
Enumerator |
---|
kXECC_SingleErrorInterruptFlag |
Single bit error interrupt happens on read data.
|
kXECC_MultiErrorInterruptFlag |
Multiple bits error interrupt happens on read data.
|
kXECC_AllInterruptsFlag |
all interrupts happens on read data
|
void XECC_Init |
( |
XECC_Type * |
base, |
|
|
const xecc_config_t * |
config |
|
) |
| |
- Parameters
-
base | XECC base address. |
config | pointer to the XECC configuration structure. |
void XECC_Deinit |
( |
XECC_Type * |
base | ) |
|
- Parameters
-
config | pointer to the XECC configuration structure. |
static uint32_t XECC_GetStatusFlags |
( |
XECC_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | XECC peripheral base address. |
- Returns
- XECC status flags.
static void XECC_ClearStatusFlags |
( |
XECC_Type * |
base, |
|
|
uint32_t |
mask |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | XECC base address. |
mask | status to clear from xecc_interrupt_status_t. |
static void XECC_EnableInterruptStatus |
( |
XECC_Type * |
base, |
|
|
uint32_t |
mask |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | XECC base address. |
mask | status to enable from xecc_interrupt_status_enable_t. |
static void XECC_DisableInterruptStatus |
( |
XECC_Type * |
base, |
|
|
uint32_t |
mask |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | XECC base address. |
mask | status to disable from xecc_interrupt_status_enable_t. |
static void XECC_EnableInterrupts |
( |
XECC_Type * |
base, |
|
|
uint32_t |
mask |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | XECC base address. |
mask | The interrupts to enable from xecc_interrupt_enable_t. |
static void XECC_DisableInterrupts |
( |
XECC_Type * |
base, |
|
|
uint32_t |
mask |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | XECC base address. |
mask | The interrupts to disable from xecc_interrupt_enable_t. |
static void XECC_WriteECCEnable |
( |
XECC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | XECC base address. |
enable | enable or disable. |
static void XECC_ReadECCEnable |
( |
XECC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | XECC base address. |
enable | enable or disable. |
static void XECC_SwapECCEnable |
( |
XECC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | XECC base address. |
enable | enable or disable. |
status_t XECC_ErrorInjection |
( |
XECC_Type * |
base, |
|
|
uint32_t |
errordata, |
|
|
uint8_t |
erroreccdata |
|
) |
| |
- Parameters
-
base | XECC base address. |
errordata | error data. |
erroreccdata | ecc code. |
- Return values
-
- Parameters
-
base | XECC base address. |
info | single error information. |
- Parameters
-
base | XECC base address. |
info | multiple error information. |
bool xecc_config_t::enableXECC |
bool xecc_config_t::enableWriteECC |
bool xecc_config_t::enableReadECC |
bool xecc_config_t::enableSwap |
The minimum ECC region range is 4k, so the lower 12 bits of this register must be 0.
uint32_t xecc_config_t::Region0BaseAddress |
uint32_t xecc_config_t::Region0EndAddress |
uint32_t xecc_config_t::Region1BaseAddress |
uint32_t xecc_config_t::Region1EndAddress |
uint32_t xecc_config_t::Region2BaseAddress |
uint32_t xecc_config_t::Region2EndAddress |
uint32_t xecc_config_t::Region3BaseAddress |
uint32_t xecc_config_t::Region3EndAddress |