MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
XECC: external error correction code controller

Overview

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

Data Structures

struct  xecc_config_t
 XECC user configuration. More...
 
struct  xecc_single_error_info_t
 XECC single error information, including single error address, ECC code, error data, error bit position and error bit field. More...
 
struct  xecc_multi_error_info_t
 XECC multiple error information, including multiple error address, ECC code, error data and error bit field. More...
 

Enumerations

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...
 

Variables

bool xecc_config_t::enableXECC
 Enable the XECC function. More...
 
bool xecc_config_t::enableWriteECC
 Enable write ECC function. More...
 
bool xecc_config_t::enableReadECC
 Enable read ECC function. More...
 
bool xecc_config_t::enableSwap
 Enable swap function. More...
 
uint32_t xecc_config_t::Region0BaseAddress
 ECC region 0 base address. More...
 
uint32_t xecc_config_t::Region0EndAddress
 ECC region 0 end address. More...
 
uint32_t xecc_config_t::Region1BaseAddress
 ECC region 1 base address. More...
 
uint32_t xecc_config_t::Region1EndAddress
 ECC region 1 end address. More...
 
uint32_t xecc_config_t::Region2BaseAddress
 ECC region 2 base address. More...
 
uint32_t xecc_config_t::Region2EndAddress
 ECC region 2 end address. More...
 
uint32_t xecc_config_t::Region3BaseAddress
 ECC region 3 base address. More...
 
uint32_t xecc_config_t::Region3EndAddress
 ECC region 3 end address. More...
 
uint32_t xecc_single_error_info_t::singleErrorAddress
 Single error address.
 
uint32_t xecc_single_error_info_t::singleErrorData
 Single error read data.
 
uint32_t xecc_single_error_info_t::singleErrorEccCode
 Single error ECC code.
 
uint32_t xecc_single_error_info_t::singleErrorBitPos
 Single error bit postion.
 
uint32_t xecc_single_error_info_t::singleErrorBitField
 Single error bit field.
 
uint32_t xecc_multi_error_info_t::multiErrorAddress
 Multiple error address.
 
uint32_t xecc_multi_error_info_t::multiErrorData
 Multiple error read data.
 
uint32_t xecc_multi_error_info_t::multiErrorEccCode
 Multiple error ECC code.
 
uint32_t xecc_multi_error_info_t::multiErrorBitField
 Single error bit field.
 

Driver version

#define FSL_XECC_DRIVER_VERSION   (MAKE_VERSION(2U, 0U, 0U))
 Driver version 2.0.0. More...
 

Initialization and deinitialization

void XECC_Init (XECC_Type *base, const xecc_config_t *config)
 XECC module initialization function. More...
 
void XECC_Deinit (XECC_Type *base)
 Deinitializes the XECC. More...
 
void XECC_GetDefaultConfig (xecc_config_t *config)
 Sets the XECC configuration structure to default values. More...
 

Status

static uint32_t XECC_GetStatusFlags (XECC_Type *base)
 Gets XECC status flags. More...
 
static void XECC_ClearStatusFlags (XECC_Type *base, uint32_t mask)
 XECC module clear interrupt status. More...
 
static void XECC_EnableInterruptStatus (XECC_Type *base, uint32_t mask)
 XECC module enable interrupt status. More...
 
static void XECC_DisableInterruptStatus (XECC_Type *base, uint32_t mask)
 XECC module disable interrupt status. More...
 

Interrupts

static void XECC_EnableInterrupts (XECC_Type *base, uint32_t mask)
 XECC module enable interrupt. More...
 
static void XECC_DisableInterrupts (XECC_Type *base, uint32_t mask)
 XECC module disable interrupt. More...
 

functional

static void XECC_WriteECCEnable (XECC_Type *base, bool enable)
 XECC module write ECC function enable. More...
 
static void XECC_ReadECCEnable (XECC_Type *base, bool enable)
 XECC module read ECC function enable. More...
 
static void XECC_SwapECCEnable (XECC_Type *base, bool enable)
 XECC module swap data enable. More...
 
status_t XECC_ErrorInjection (XECC_Type *base, uint32_t errordata, uint8_t erroreccdata)
 XECC module error injection. More...
 
void XECC_GetSingleErrorInfo (XECC_Type *base, xecc_single_error_info_t *info)
 XECC module get single error information. More...
 
void XECC_GetMultiErrorInfo (XECC_Type *base, xecc_multi_error_info_t *info)
 XECC module get multiple error information. More...
 

Data Structure Documentation

struct xecc_config_t

Data Fields

bool enableXECC
 Enable the XECC function. More...
 
bool enableWriteECC
 Enable write ECC function. More...
 
bool enableReadECC
 Enable read ECC function. More...
 
bool enableSwap
 Enable swap function. More...
 
uint32_t Region0BaseAddress
 ECC region 0 base address. More...
 
uint32_t Region0EndAddress
 ECC region 0 end address. More...
 
uint32_t Region1BaseAddress
 ECC region 1 base address. More...
 
uint32_t Region1EndAddress
 ECC region 1 end address. More...
 
uint32_t Region2BaseAddress
 ECC region 2 base address. More...
 
uint32_t Region2EndAddress
 ECC region 2 end address. More...
 
uint32_t Region3BaseAddress
 ECC region 3 base address. More...
 
uint32_t Region3EndAddress
 ECC region 3 end address. More...
 
struct xecc_single_error_info_t

Data Fields

uint32_t singleErrorAddress
 Single error address.
 
uint32_t singleErrorData
 Single error read data.
 
uint32_t singleErrorEccCode
 Single error ECC code.
 
uint32_t singleErrorBitPos
 Single error bit postion.
 
uint32_t singleErrorBitField
 Single error bit field.
 
struct xecc_multi_error_info_t

Data Fields

uint32_t multiErrorAddress
 Multiple error address.
 
uint32_t multiErrorData
 Multiple error read data.
 
uint32_t multiErrorEccCode
 Multiple error ECC code.
 
uint32_t multiErrorBitField
 Single error bit field.
 

Macro Definition Documentation

#define FSL_XECC_DRIVER_VERSION   (MAKE_VERSION(2U, 0U, 0U))

Enumeration Type Documentation

anonymous enum

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

anonymous enum

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

anonymous enum

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

Function Documentation

void XECC_Init ( XECC_Type *  base,
const xecc_config_t config 
)
Parameters
baseXECC base address.
configpointer to the XECC configuration structure.
void XECC_Deinit ( XECC_Type *  base)
Parameters
baseXECC base address.
void XECC_GetDefaultConfig ( xecc_config_t config)
Parameters
configpointer to the XECC configuration structure.
static uint32_t XECC_GetStatusFlags ( XECC_Type *  base)
inlinestatic
Parameters
baseXECC peripheral base address.
Returns
XECC status flags.
static void XECC_ClearStatusFlags ( XECC_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseXECC base address.
maskstatus to clear from xecc_interrupt_status_t.
static void XECC_EnableInterruptStatus ( XECC_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseXECC base address.
maskstatus to enable from xecc_interrupt_status_enable_t.
static void XECC_DisableInterruptStatus ( XECC_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseXECC base address.
maskstatus to disable from xecc_interrupt_status_enable_t.
static void XECC_EnableInterrupts ( XECC_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseXECC base address.
maskThe interrupts to enable from xecc_interrupt_enable_t.
static void XECC_DisableInterrupts ( XECC_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseXECC base address.
maskThe interrupts to disable from xecc_interrupt_enable_t.
static void XECC_WriteECCEnable ( XECC_Type *  base,
bool  enable 
)
inlinestatic
Parameters
baseXECC base address.
enableenable or disable.
static void XECC_ReadECCEnable ( XECC_Type *  base,
bool  enable 
)
inlinestatic
Parameters
baseXECC base address.
enableenable or disable.
static void XECC_SwapECCEnable ( XECC_Type *  base,
bool  enable 
)
inlinestatic
Parameters
baseXECC base address.
enableenable or disable.
status_t XECC_ErrorInjection ( XECC_Type *  base,
uint32_t  errordata,
uint8_t  erroreccdata 
)
Parameters
baseXECC base address.
errordataerror data.
erroreccdataecc code.
Return values
kStatus_Success.
void XECC_GetSingleErrorInfo ( XECC_Type *  base,
xecc_single_error_info_t info 
)
Parameters
baseXECC base address.
infosingle error information.
void XECC_GetMultiErrorInfo ( XECC_Type *  base,
xecc_multi_error_info_t info 
)
Parameters
baseXECC base address.
infomultiple error information.

Variable Documentation

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