MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
MCM: Miscellaneous Control Module Driver

Read Guidance

This document consists of sections titled with Driver Overview, Data Structures, Enumerations, Functions, etc., each with an overview list and detailed documentation. It is recommended to read the Driver Overview first for it includes a comprehensive description of the peripheral, driver and driver changes. Other sections give detailed information for APIs, enums, macros, etc., for your further reference.

Driver Overview

 MCM Peripheral and Driver Overview
 Content including 1) peripheral features and work logic; 2) driver design logic.
 
 The Driver Change Log
 The current MCM driver version is 2.0.0.
 

Data Structures

struct  mcm_core_fault_attribute_t
 The structure of core fault attributes, contains access type, access size, access direction, etc. More...
 
struct  mcm_resource_protection_config_t
 The structure of the resource protection config, the set value can be used only when the resource protection is enabled, and this value can be changed only when the resource protection is disabled. More...
 

Enumerations

enum  _mcm_status_flags {
  kMCM_CoreFaultErrorInterruptFlag = MCM_CFISR_CFEI_MASK,
  kMCM_CoreFaultErrorDataLostFlag = MCM_CFISR_CFEDL_MASK
}
 The enumeration of status flags, including core fault error interrupt flag and core fault error data lost flag. More...
 
enum  mcm_datapath_width_t {
  kMCM_Datapath32b = 0U,
  kMCM_Datapath64b = 1U
}
 The enumeration of datapath width, including 32 bits and 64 bits. More...
 
enum  mcm_axbs_dma_core_priority_t {
  kMCM_AxbsPriorityCoreHigherThanDMA = 0U,
  kMCM_AxbsPriorityCoreDMARoundRobin
}
 The enumeration of DMA controller priority in the Crossbar switch arbitration scheme. More...
 
enum  mcm_last_fault_access_dir_t {
  kMCM_CoreRead = 0U,
  kMCM_CoreWrite = 1U
}
 The enumeration of last faulted core access direction. More...
 
enum  mcm_last_fault_access_size_t {
  kMCM_Access8b = 0U,
  kMCM_Access16b = 1U,
  kMCM_Access32b = 2U
}
 The enumeration of last faulted core access size. More...
 
enum  mcm_last_fault_access_type_t {
  kMCM_AccessInstruction = 0U,
  kMCM_AccessData = 1U
}
 The enumeration of last faulted core access type. More...
 
enum  mcm_last_fault_access_location_t {
  kMCM_ErrOnInstructionBus = 0U,
  kMCM_ErrOnOperandABus = 1U,
  kMCM_ErrOnOperandBBus = 2U
}
 The enumeration of last captured fault Location. More...
 

Driver version

#define FSL_MCM_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
 MCM driver version. More...
 

Core Information Interfaces

static mcm_datapath_width_t MCM_GetDataPathWidth (MCM_Type *base)
 Indicates if the datapath is 32 or 64 bits wide. More...
 
static uint16_t MCM_GetCrossbarSwitchSlaveConfig (MCM_Type *base)
 Gets crossbar switch (AXBS) slave configuration that indicates the presence/absence of bus slave connections to the device's crossbar switch. More...
 
static uint16_t MCM_GetCrossbarSwitchMasterConfig (MCM_Type *base)
 Gets crossbar switch (AXBS) master configuration that indicates the presence/absence of bus master connections to the device's crossbar switch. More...
 

Flash Controller Related Interfaces

static void MCM_ClearFlashControllerCache (MCM_Type *base)
 Clears Flash Controller Cache, 1 cycle active. More...
 
static void MCM_DisableFlashControllerDataCaching (MCM_Type *base, bool bDisable)
 Disables/Enables flash controller data caching. More...
 
static void MCM_DisableFlashControllerInstructionCaching (MCM_Type *base, bool bDisable)
 Disables/Enables flash controller instruction caching. More...
 
static void MCM_DisableFlashControllerCache (MCM_Type *base, bool bDisable)
 Disables/Enables flash controller cache. More...
 
static void MCM_DisableFlashControllerDataSpeculation (MCM_Type *base, bool bDisable)
 Disables/Enables flash controller data speculation. More...
 
static void MCM_DisableFlashControllerSpeculation (MCM_Type *base, bool bDisable)
 Disables/Enables flash controller speculation. More...
 
static void MCM_DisableDSP56800EXCoreInstructions (MCM_Type *base, bool bDisable)
 Disables/Enables the instruction support only by DSP56800EX core, the instructions supported only by the DSP56800EX core are the BPSC and 32-bit multiply and MAC instructions. More...
 
static void MCM_DisableCoreReverseCarry (MCM_Type *base, bool bDisable)
 Disables/Enables core reverse carry. More...
 
static void MCM_DisableDSP56800EXNewShadowRegion (MCM_Type *base, bool bDisable)
 Disables/Enables the additional AGU shadow registers on the DSP56800EX core. More...
 
static void MCM_DisableCoreInstructionBuffer (MCM_Type *base, bool bDisable)
 Disables/Enables core instruction buffer. More...
 
static void MCM_DisableFlashMemoryControllerStall (MCM_Type *base, bool bDisable)
 Disables/Enables the flash memory controller's ability to allow flash memory access to initiate when a flash memory command is executing. More...
 

Core and Core-peripheral Bus Error Interfaces

static void MCM_SetAxbsDMAControllerPriority (MCM_Type *base, mcm_axbs_dma_core_priority_t ePriority)
 Sets the priority of the DMA controller in the AXBS crossbar switch arbitration scheme. More...
 
static uint32_t MCM_GetCoreFaultAddr (MCM_Type *base)
 Gets the address of the last core access terminated with an error response. More...
 
void MCM_GetCoreFaultAttribute (MCM_Type *base, mcm_core_fault_attribute_t *psAttribute)
 Gets the processor's attributes of the last faulted core access to the system bus. More...
 
static
mcm_last_fault_access_location_t 
MCM_GetCoreFaultLocation (MCM_Type *base)
 Gets the location of the last captured fault. More...
 
static uint32_t MCM_GetCoreFaultData (MCM_Type *base)
 Gets the data associated with the last faulted processor write data access from the device's internal bus. More...
 
static void MCM_EnableCoreFaultInterrupt (MCM_Type *base, bool bEnable)
 Enables/Disables core fault error interrupt. More...
 
static uint8_t MCM_GetCoreFaultStatusFlags (MCM_Type *base)
 Gets the core fault error status flags, including core fault error interrupt flag and core fault error data lost flag. More...
 
static void MCM_ClearCoreFaultStatusFlags (MCM_Type *base, uint8_t u8StatusFlags)
 Clears the core fault error status flags, including core fault error interrupt flag and core fault error data lost flag. More...
 

Resource Protection Related Inferfaces

static void MCM_EnableResourceProtection (MCM_Type *base, bool bEnable)
 Enables/Disables resource protection. More...
 
static void MCM_LockResourceProtectionRegisters (MCM_Type *base)
 Locks the value of the resource protection related registers, after locked the registers' value can not be changed until a system reset. More...
 
status_t MCM_SetResourceProtectionConfig (MCM_Type *base, const mcm_resource_protection_config_t *psConfig)
 Sets the configuration of resource protection, including flash base address, ram base address, etc. More...
 
static uint32_t MCM_GetResourceProtectionIllegalFaultPC (MCM_Type *base)
 Gets the 21-bit illegal faulting PC that only for a resource protection fault. More...
 
static bool MCM_IsResourceProtectionIllegalFaultValid (MCM_Type *base)
 Indicates whether an resource protection illegal PC fault has occurred. More...
 
static void MCM_ClearResourceProtectionIllegalFaultValid (MCM_Type *base)
 Clears the resource protection illegal fault bit. More...
 
static uint32_t MCM_GetResourceProtectionMisalignedFaultPC (MCM_Type *base)
 Gets the 21-bit misaligned faulting PC that only for a resource protection fault. More...
 
static bool MCM_IsResourceProtectionMisalignedFaultValid (MCM_Type *base)
 Indicates whether an resource protection misaligned PC fault has occurred. More...
 
static void MCM_ClearResourceProtectionMisalignedFaultValid (MCM_Type *base)
 Clears the resource protection misaligned fault bit. More...
 

Data Structure Documentation

struct mcm_core_fault_attribute_t

Data Fields

mcm_last_fault_access_type_t eType: 1U
 Indicates the last faulted core access type, please refer to mcm_last_fault_access_type_t. More...
 
uint8_t bitReserved1: 1U
 Reserved 1 bit. More...
 
bool bBufferable: 1U
 Indicates if last faulted core access was bufferable. More...
 
uint8_t bitReserved2: 1U
 Reserved 1 bit. More...
 
mcm_last_fault_access_size_t eSize: 3U
 Indicates last faulted core access size. More...
 
mcm_last_fault_access_dir_t eDirection: 1U
 Indicates the last faulted core access direction. More...
 

Field Documentation

mcm_last_fault_access_type_t mcm_core_fault_attribute_t::eType
uint8_t mcm_core_fault_attribute_t::bitReserved1
bool mcm_core_fault_attribute_t::bBufferable
  • true Last faulted core access is bufferable.
  • false Last faulted core access is non-bufferable.
uint8_t mcm_core_fault_attribute_t::bitReserved2
mcm_last_fault_access_size_t mcm_core_fault_attribute_t::eSize
mcm_last_fault_access_dir_t mcm_core_fault_attribute_t::eDirection
struct mcm_resource_protection_config_t

Data Fields

bool bEnableResourceProtection
 Enable/Disable resource protection. More...
 
uint8_t u8FlashBaseAddress
 Flash base address for user region, supports 4 KB granularity. More...
 
uint8_t u8RamBaseAddress
 Program RAM base address for user region, support 256 byte granularity. More...
 
uint32_t u32BootRomBaseAddress
 Boot ROM base address for user region.
 
uint32_t u32ResourceProtectionOtherSP
 Resource protection other stack pointer. More...
 

Field Documentation

bool mcm_resource_protection_config_t::bEnableResourceProtection
  • true Enable Resource protection.
  • false Disable Resource protection.
uint8_t mcm_resource_protection_config_t::u8FlashBaseAddress
uint8_t mcm_resource_protection_config_t::u8RamBaseAddress
uint32_t mcm_resource_protection_config_t::u32ResourceProtectionOtherSP

Macro Definition Documentation

#define FSL_MCM_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))

Enumeration Type Documentation

Enumerator
kMCM_CoreFaultErrorInterruptFlag 

A bus error has occurred.

kMCM_CoreFaultErrorDataLostFlag 

A bus error has occurred before the previous error condition was cleared.

Enumerator
kMCM_Datapath32b 

Datapath width is 32 bits.

kMCM_Datapath64b 

Datapath width is 64 bits.

Enumerator
kMCM_AxbsPriorityCoreHigherThanDMA 

Fixed-priority arbitration is selected: DSC core has a higher priority than the DMA Controller's priority.

kMCM_AxbsPriorityCoreDMARoundRobin 

Round-robin priority arbitration is selected: DMA Controller and DSC core have equal priority.

Enumerator
kMCM_CoreRead 

Core read access.

kMCM_CoreWrite 

Core write access.

Enumerator
kMCM_Access8b 

Last faulted core access size is 8-bit.

kMCM_Access16b 

Last faulted core access size is 16-bit.

kMCM_Access32b 

Last faulted core access size is 32-bit.

Enumerator
kMCM_AccessInstruction 

Last faulted core access is instruction.

kMCM_AccessData 

Last faulted core access is data.

Enumerator
kMCM_ErrOnInstructionBus 

Error occurred on M0 (instruction bus).

kMCM_ErrOnOperandABus 

Error occurred on M1 (operand A bus).

kMCM_ErrOnOperandBBus 

Error occurred on M2 (operand B bus).

Function Documentation

static mcm_datapath_width_t MCM_GetDataPathWidth ( MCM_Type *  base)
inlinestatic
Parameters
baseMCM base address.
Returns
The device's datapath width, please refer to mcm_datapath_width_t.
static uint16_t MCM_GetCrossbarSwitchSlaveConfig ( MCM_Type *  base)
inlinestatic
Parameters
baseMCM base address.
Returns
Crossbar switch (AXBS) slave configuration, each bit in the return value indicates if there is a corresponding connection to the AXBS slave input port. For example if the result is 0x1, it means a bus slave connection to AXBS input port 0 is present.
static uint16_t MCM_GetCrossbarSwitchMasterConfig ( MCM_Type *  base)
inlinestatic
Parameters
baseMCM base address.
Returns
Crossbar switch (AXBS) master configuration, each bit in the return value indicates if there is a corresponding connection to the AXBS master input port. For example if the result is 0x1, it means a bus master connection to AXBS input port 0 is present.
static void MCM_ClearFlashControllerCache ( MCM_Type *  base)
inlinestatic
Parameters
baseMCM base address.
static void MCM_DisableFlashControllerDataCaching ( MCM_Type *  base,
bool  bDisable 
)
inlinestatic
Parameters
baseMCM peripheral base address.
bDisableUsed to enable/disable flash controller data caching.
  • true Disable flash controller data caching.
  • false Enable flash controller data caching.
static void MCM_DisableFlashControllerInstructionCaching ( MCM_Type *  base,
bool  bDisable 
)
inlinestatic
Parameters
baseMCM peripheral base address.
bDisableUsed to enable/disable flash contoller instruction caching.
  • true Disable flash controller instruction caching.
  • false Enable flash controller instruction caching.
static void MCM_DisableFlashControllerCache ( MCM_Type *  base,
bool  bDisable 
)
inlinestatic
Parameters
baseMCM peripheral base address.
bDisableUsed to enable/disable flash controller cache.
  • true Disable flash controller cache.
  • false Enable flash controller cache.
static void MCM_DisableFlashControllerDataSpeculation ( MCM_Type *  base,
bool  bDisable 
)
inlinestatic
Parameters
baseMCM peripheral base address.
bDisableUsed to enable/disable flash controller data speculation.
  • true Disable flash controller data speculation.
  • false Enable flash controller data speculation.
static void MCM_DisableFlashControllerSpeculation ( MCM_Type *  base,
bool  bDisable 
)
inlinestatic
Parameters
baseMCM peripheral base address.
bDisableUsed to enable/disable flash controller speculation.
  • true Disable flash controller speculation.
  • false Enable flash controller speculation.
static void MCM_DisableDSP56800EXCoreInstructions ( MCM_Type *  base,
bool  bDisable 
)
inlinestatic
Parameters
baseMCM peripheral base address.
bDisableUsed to enable/disable 32-bit multiply and MAC instructions.
  • true BFSC and 32-bit multiply and MAC instructions disabled.
  • false BFSC and 32-bit multiply and MAC instructions enabled.
static void MCM_DisableCoreReverseCarry ( MCM_Type *  base,
bool  bDisable 
)
inlinestatic
Parameters
baseMCM peripheral base address.
bDisableUsed to enable/disable reverse carry.
  • true Disable bit-reverse addressing mode.
  • false Enable bit-reverse addressing mode.
static void MCM_DisableDSP56800EXNewShadowRegion ( MCM_Type *  base,
bool  bDisable 
)
inlinestatic
Parameters
baseMCM peripheral base address.
bDisableUsed to disable/enable the additional AGU shadow register on the DPS core.
  • true Only the AGU shadow registers supported by the DSP56800E core are enabled.
  • false The additional AGU shadow registers on the DSP56800EX core are also enabled.
static void MCM_DisableCoreInstructionBuffer ( MCM_Type *  base,
bool  bDisable 
)
inlinestatic
Parameters
baseMCM peripheral base address.
bDisableUsed to disable/enable core longword instruction buffer.
  • true Disable core longword instruction buffer.
  • false Enable core longword instruction buffer.
static void MCM_DisableFlashMemoryControllerStall ( MCM_Type *  base,
bool  bDisable 
)
inlinestatic
Parameters
baseMCM peripheral base address.
bDisableUsed to disable/enable stall logic.
  • true Stall logic is disabled. While a flash memory command is executing, an attempted flash memory access causes a bus error.
  • false Stall logic is disabled. While a flash memory command is executing, a flash memory access can occur without causing a bus error. The flash memory command completes execution, and then the flash memory access occurs.
static void MCM_SetAxbsDMAControllerPriority ( MCM_Type *  base,
mcm_axbs_dma_core_priority_t  ePriority 
)
inlinestatic
Parameters
baseMCM base address.
ePriorityThe selected DMA controller priority in Crossbar switch arbitration scheme, please refer to mcm_axbs_dma_core_priority_t.
static uint32_t MCM_GetCoreFaultAddr ( MCM_Type *  base)
inlinestatic
Parameters
baseMCM base address.
Returns
address of the last core access terminated with an error response.
void MCM_GetCoreFaultAttribute ( MCM_Type *  base,
mcm_core_fault_attribute_t psAttribute 
)
Parameters
baseMCM peripheral base address.
psAttributeThe pointer of structure mcm_core_fault_attribute_t.
static mcm_last_fault_access_location_t MCM_GetCoreFaultLocation ( MCM_Type *  base)
inlinestatic
Parameters
baseMCM peripheral base address.
Returns
The location of the last captured fault, please refer to mcm_last_fault_access_location_t.
static uint32_t MCM_GetCoreFaultData ( MCM_Type *  base)
inlinestatic
Parameters
baseMCM base address.
Returns
The data associated with the last faulted processor write data access.
static void MCM_EnableCoreFaultInterrupt ( MCM_Type *  base,
bool  bEnable 
)
inlinestatic
Parameters
baseMCM peripheral base address.
bEnableUsed to enable/disable the core fault error interrupt.
  • true Enables core fault error interrupt, so an error interrupt will be generated to the interrupt controller on a faulted system bus cycle.
  • false Disables core fault error interrupt, so an error interrupt will not be generated to the interrupt controller on a faulted system bus cycle.
static uint8_t MCM_GetCoreFaultStatusFlags ( MCM_Type *  base)
inlinestatic
Parameters
baseMCM peripheral base address.
Returns
The current status flags, should be the OR'ed value of _mcm_status_flags.
static void MCM_ClearCoreFaultStatusFlags ( MCM_Type *  base,
uint8_t  u8StatusFlags 
)
inlinestatic
Parameters
baseMCM peripheral base address.
u8StatusFlagsThe status flags to be cleared, should be the OR'ed value of _mcm_status_flags.
static void MCM_EnableResourceProtection ( MCM_Type *  base,
bool  bEnable 
)
inlinestatic
Parameters
baseMCM peripheral base address.
bEnableUsed to enable/disable memory resource protection.
  • true Enable memory resource protection.
  • false Disable memory resource protection.
static void MCM_LockResourceProtectionRegisters ( MCM_Type *  base)
inlinestatic
Parameters
baseMCM peripheral base address.
status_t MCM_SetResourceProtectionConfig ( MCM_Type *  base,
const mcm_resource_protection_config_t psConfig 
)
Parameters
baseMCM peripheral base address.
psConfigThe pointer of structure mcm_resource_protection_config_t.
Return values
kStatus_SuccessSucceed to setting resource protection related options.
kStatus_FailFail to set resource protection related options.
static uint32_t MCM_GetResourceProtectionIllegalFaultPC ( MCM_Type *  base)
inlinestatic
Parameters
baseMCM peripheral base address.
Returns
The resource protection illegal faulting PC.
static bool MCM_IsResourceProtectionIllegalFaultValid ( MCM_Type *  base)
inlinestatic
Parameters
baseMCM peripheral base address.
Return values
trueThe resource protection illegal PC fault has occurred.
falseThe resource protection illegal PC fault has not occurred.
static void MCM_ClearResourceProtectionIllegalFaultValid ( MCM_Type *  base)
inlinestatic
Parameters
baseMCM peripheral base address.
static uint32_t MCM_GetResourceProtectionMisalignedFaultPC ( MCM_Type *  base)
inlinestatic
Parameters
baseMCM peripheral base address.
Returns
The resource protection misaligned faulting PC.
static bool MCM_IsResourceProtectionMisalignedFaultValid ( MCM_Type *  base)
inlinestatic
Parameters
baseMCM peripheral base address.
Return values
trueThe resource protection misaligned PC fault has occurred.
falseThe resource protection misaligned PC fault has not occurred.
static void MCM_ClearResourceProtectionMisalignedFaultValid ( MCM_Type *  base)
inlinestatic
Parameters
baseMCM peripheral base address.