The MCUXpresso SDK provides a driver for the FLEXRAM module of MCUXpresso SDK devices.
The FLEXRAM module intergrates the ITCM, DTCM, and OCRAM controllers, and supports parameterized RAM array and RAM array portioning.
This example code shows how to allocate RAM using the FLEXRAM driver.
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/flexram.
|
struct | flexram_ocram_ecc_single_error_info_t |
| FLEXRAM ocram ecc single error information, including single error information, error address, error data. More...
|
|
struct | flexram_ocram_ecc_multi_error_info_t |
| FLEXRAM ocram ecc multiple error information, including multiple error information, error address, error data. More...
|
|
struct | flexram_itcm_ecc_single_error_info_t |
| FLEXRAM itcm ecc single error information, including single error information, error address, error data. More...
|
|
struct | flexram_itcm_ecc_multi_error_info_t |
| FLEXRAM itcm ecc multiple error information, including multiple error information, error address, error data. More...
|
|
struct | flexram_dtcm_ecc_single_error_info_t |
| FLEXRAM dtcm ecc single error information, including single error information, error address, error data. More...
|
|
struct | flexram_dtcm_ecc_multi_error_info_t |
| FLEXRAM dtcm ecc multiple error information, including multiple error information, error address, error data. More...
|
|
|
enum | {
kFLEXRAM_Read = 0U,
kFLEXRAM_Write = 1U
} |
| Flexram write/read selection. More...
|
|
enum | {
kFLEXRAM_OCRAMAccessError = FLEXRAM_INT_STATUS_OCRAM_ERR_STATUS_MASK,
kFLEXRAM_DTCMAccessError = FLEXRAM_INT_STATUS_DTCM_ERR_STATUS_MASK,
kFLEXRAM_ITCMAccessError = FLEXRAM_INT_STATUS_ITCM_ERR_STATUS_MASK,
kFLEXRAM_OCRAMMagicAddrMatch = FLEXRAM_INT_STATUS_OCRAM_MAM_STATUS_MASK,
kFLEXRAM_DTCMMagicAddrMatch = FLEXRAM_INT_STATUS_DTCM_MAM_STATUS_MASK,
kFLEXRAM_ITCMMagicAddrMatch = FLEXRAM_INT_STATUS_ITCM_MAM_STATUS_MASK
} |
| Interrupt status flag mask. More...
|
|
enum | flexram_tcm_access_mode_t {
kFLEXRAM_TCMAccessFastMode = 0U,
kFLEXRAM_TCMAccessWaitMode = 1U
} |
| FLEXRAM TCM access mode. More...
|
|
enum | {
kFLEXRAM_TCMSize32KB = 32 * 1024U,
kFLEXRAM_TCMSize64KB = 64 * 1024U,
kFLEXRAM_TCMSize128KB = 128 * 1024U,
kFLEXRAM_TCMSize256KB = 256 * 1024U,
kFLEXRAM_TCMSize512KB = 512 * 1024U
} |
| FLEXRAM TCM support size. More...
|
|
|
static void | FLEXRAM_SetTCMReadAccessMode (FLEXRAM_Type *base, flexram_tcm_access_mode_t mode) |
| FLEXRAM module sets TCM read access mode. More...
|
|
static void | FLEXRAM_SetTCMWriteAccessMode (FLEXRAM_Type *base, flexram_tcm_access_mode_t mode) |
| FLEXRAM module set TCM write access mode. More...
|
|
static void | FLEXRAM_EnableForceRamClockOn (FLEXRAM_Type *base, bool enable) |
| FLEXRAM module force ram clock on. More...
|
|
static void | FLEXRAM_SetOCRAMMagicAddr (FLEXRAM_Type *base, uint16_t magicAddr, uint32_t rwSel) |
| FLEXRAM OCRAM magic addr configuration. More...
|
|
static void | FLEXRAM_SetDTCMMagicAddr (FLEXRAM_Type *base, uint16_t magicAddr, uint32_t rwSel) |
| FLEXRAM DTCM magic addr configuration. More...
|
|
static void | FLEXRAM_SetITCMMagicAddr (FLEXRAM_Type *base, uint16_t magicAddr, uint32_t rwSel) |
| FLEXRAM ITCM magic addr configuration. More...
|
|
void | FLEXRAM_EnableECC (FLEXRAM_Type *base, bool OcramECCEnable, bool TcmECCEnable) |
| FLEXRAM get ocram ecc single error information. More...
|
|
void | FLEXRAM_GetOcramSingleErroInfo (FLEXRAM_Type *base, flexram_ocram_ecc_single_error_info_t *info) |
| FLEXRAM get ocram ecc single error information. More...
|
|
void | FLEXRAM_GetOcramMultiErroInfo (FLEXRAM_Type *base, flexram_ocram_ecc_multi_error_info_t *info) |
| FLEXRAM get ocram ecc multiple error information. More...
|
|
void | FLEXRAM_GetItcmSingleErroInfo (FLEXRAM_Type *base, flexram_itcm_ecc_single_error_info_t *info) |
| FLEXRAM get itcm ecc single error information. More...
|
|
void | FLEXRAM_GetItcmMultiErroInfo (FLEXRAM_Type *base, flexram_itcm_ecc_multi_error_info_t *info) |
| FLEXRAM get itcm ecc multiple error information. More...
|
|
void | FLEXRAM_GetDtcmSingleErroInfo (FLEXRAM_Type *base, flexram_dtcm_ecc_single_error_info_t *info, uint8_t bank) |
| FLEXRAM get d0tcm ecc single error information. More...
|
|
void | FLEXRAM_GetDtcmMultiErroInfo (FLEXRAM_Type *base, flexram_dtcm_ecc_multi_error_info_t *info, uint8_t bank) |
| FLEXRAM get d0tcm ecc multiple error information. More...
|
|
struct flexram_ocram_ecc_single_error_info_t |
uint32_t flexram_ocram_ecc_single_error_info_t::OcramSingleErrorInfo |
struct flexram_ocram_ecc_multi_error_info_t |
uint32_t flexram_ocram_ecc_multi_error_info_t::OcramMultiErrorInfo |
struct flexram_itcm_ecc_single_error_info_t |
uint32_t flexram_itcm_ecc_single_error_info_t::ItcmSingleErrorInfo |
struct flexram_itcm_ecc_multi_error_info_t |
uint32_t flexram_itcm_ecc_multi_error_info_t::ItcmMultiErrorInfo |
struct flexram_dtcm_ecc_single_error_info_t |
uint32_t flexram_dtcm_ecc_single_error_info_t::DtcmSingleErrorInfo |
struct flexram_dtcm_ecc_multi_error_info_t |
uint32_t flexram_dtcm_ecc_multi_error_info_t::DtcmMultiErrorInfo |
#define FSL_FLEXRAM_DRIVER_VERSION (MAKE_VERSION(2U, 1U, 0U)) |
#define FLEXRAM_ECC_ERROR_DETAILED_INFO 0U /* Define to zero means get raw ECC error information, which needs parse it by user. */ |
Enumerator |
---|
kFLEXRAM_Read |
read
|
kFLEXRAM_Write |
write
|
Enumerator |
---|
kFLEXRAM_OCRAMAccessError |
OCRAM accesses unallocated address.
|
kFLEXRAM_DTCMAccessError |
DTCM accesses unallocated address.
|
kFLEXRAM_ITCMAccessError |
ITCM accesses unallocated address.
|
kFLEXRAM_OCRAMMagicAddrMatch |
OCRAM magic address match.
|
kFLEXRAM_DTCMMagicAddrMatch |
DTCM magic address match.
|
kFLEXRAM_ITCMMagicAddrMatch |
ITCM magic address match.
|
Fast access mode expected to be finished in 1-cycle; Wait access mode expected to be finished in 2-cycle. Wait access mode is a feature of the flexram and it should be used when the CPU clock is too fast to finish TCM access in 1-cycle. Normally, fast mode is the default mode, the efficiency of the TCM access will better.
Enumerator |
---|
kFLEXRAM_TCMAccessFastMode |
fast access mode
|
kFLEXRAM_TCMAccessWaitMode |
wait access mode
|
Enumerator |
---|
kFLEXRAM_TCMSize32KB |
TCM total size be 32KB.
|
kFLEXRAM_TCMSize64KB |
TCM total size be 64KB.
|
kFLEXRAM_TCMSize128KB |
TCM total size be 128KB.
|
kFLEXRAM_TCMSize256KB |
TCM total size be 256KB.
|
kFLEXRAM_TCMSize512KB |
TCM total size be 512KB.
|
void FLEXRAM_Init |
( |
FLEXRAM_Type * |
base | ) |
|
- Parameters
-
base | FLEXRAM base address. |
static uint32_t FLEXRAM_GetInterruptStatus |
( |
FLEXRAM_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | FLEXRAM base address. |
static void FLEXRAM_ClearInterruptStatus |
( |
FLEXRAM_Type * |
base, |
|
|
uint32_t |
status |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | FLEXRAM base address. |
status | Status to be cleared. |
static void FLEXRAM_EnableInterruptStatus |
( |
FLEXRAM_Type * |
base, |
|
|
uint32_t |
status |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | FLEXRAM base address. |
status | Status to be enabled. |
static void FLEXRAM_DisableInterruptStatus |
( |
FLEXRAM_Type * |
base, |
|
|
uint32_t |
status |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | FLEXRAM base address. |
status | Status to be disabled. |
static void FLEXRAM_EnableInterruptSignal |
( |
FLEXRAM_Type * |
base, |
|
|
uint32_t |
status |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | FLEXRAM base address. |
status | Status interrupt to be enabled. |
static void FLEXRAM_DisableInterruptSignal |
( |
FLEXRAM_Type * |
base, |
|
|
uint32_t |
status |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | FLEXRAM base address. |
status | Status interrupt to be disabled. |
- Parameters
-
base | FLEXRAM base address. |
mode | Access mode. |
- Parameters
-
base | FLEXRAM base address. |
mode | Access mode. |
static void FLEXRAM_EnableForceRamClockOn |
( |
FLEXRAM_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | FLEXRAM base address. |
enable | Enable or disable clock force on. |
static void FLEXRAM_SetOCRAMMagicAddr |
( |
FLEXRAM_Type * |
base, |
|
|
uint16_t |
magicAddr, |
|
|
uint32_t |
rwSel |
|
) |
| |
|
inlinestatic |
When read/write access hit magic address, it will generate interrupt.
- Parameters
-
base | FLEXRAM base address. |
magicAddr | Magic address, the actual address bits [18:3] is corresponding to the register field [16:1]. |
rwSel | Read/write selection. 0 for read access while 1 for write access. |
static void FLEXRAM_SetDTCMMagicAddr |
( |
FLEXRAM_Type * |
base, |
|
|
uint16_t |
magicAddr, |
|
|
uint32_t |
rwSel |
|
) |
| |
|
inlinestatic |
When read/write access hits magic address, it will generate interrupt.
- Parameters
-
base | FLEXRAM base address. |
magicAddr | Magic address, the actual address bits [18:3] is corresponding to the register field [16:1]. |
rwSel | Read/write selection. 0 for read access while 1 write access. |
static void FLEXRAM_SetITCMMagicAddr |
( |
FLEXRAM_Type * |
base, |
|
|
uint16_t |
magicAddr, |
|
|
uint32_t |
rwSel |
|
) |
| |
|
inlinestatic |
When read/write access hits magic address, it will generate interrupt.
- Parameters
-
base | FLEXRAM base address. |
magicAddr | Magic address, the actual address bits [18:3] is corresponding to the register field [16:1]. |
rwSel | Read/write selection. 0 for read access while 1 for write access. |
void FLEXRAM_EnableECC |
( |
FLEXRAM_Type * |
base, |
|
|
bool |
OcramECCEnable, |
|
|
bool |
TcmECCEnable |
|
) |
| |
- Parameters
-
base | FLEXRAM base address. |
OcramECCEnable | ocram ecc enablement. |
TcmECCEnable | tcm(itcm/d0tcm/d1tcm) ecc enablement. |
- Parameters
-
base | FLEXRAM base address. |
info | ecc error information. |
- Parameters
-
base | FLEXRAM base address. |
info | ecc error information. |
- Parameters
-
base | FLEXRAM base address. |
info | ecc error information. |
- Parameters
-
base | FLEXRAM base address. |
info | ecc error information. |
- Parameters
-
base | FLEXRAM base address. |
info | ecc error information. |
bank | DTCM bank, 0 is D0TCM, 1 is D1TCM. |
- Parameters
-
base | FLEXRAM base address. |
bank | ecc error information. |
bank | DTCM bank, 0 is D0TCM, 1 is D1TCM. |