MEMCFG Module¶
The MemCfg module provides an API to configure the device’s Memory Control Module. The functions that are provided fall into three main categories: RAM section configuration, access violation status and interrupts, and memory error status an interrupts. The RAM section configuration functions can initialize RAM, configure access protection settings, and configure section ownership. The access violation and memory error categories contain functions that can return violation and error status and address information as well as configure interrupts that can be generated as a result of these issues.
-
group
memcfg_api
Defines
-
MEMCFG_SECT_TYPE_MASK
0xFF000000U¶
-
MEMCFG_SECT_TYPE_D
0x00000000U¶
-
MEMCFG_SECT_TYPE_LS
0x01000000U¶
-
MEMCFG_SECT_TYPE_GS
0x02000000U¶
-
MEMCFG_SECT_NUM_MASK
0x00FFFFFFU¶
-
MEMCFG_XACCPROTX_M
((uint32_t)MEMCFG_GSXACCPROT0_FETCHPROT_GS0| \
(uint32_t)
MEMCFG_GSXACCPROT0_CPUWRPROT_GS0| \
(uint32_t)
MEMCFG_GSXACCPROT0_HICWRPROT_GS0| \
(uint32_t)
MEMCFG_GSXACCPROT0_DMAWRPROT_GS0)¶
-
MEMCFG_XTEST_M
MEMCFG_DXTEST_TEST_M0_M¶
-
MEMCFG_NMVIOL_MASK
0x0000FFFFU¶
-
MEMCFG_MVIOL_MASK
0x000F0000U¶
-
MEMCFG_MVIOL_SHIFT
16U¶
-
MEMCFG_SECT_M0
0x00000001U¶ M0 RAM.
-
MEMCFG_SECT_M1
0x00000002U¶ M1 RAM.
-
MEMCFG_SECT_DX_ALL
0x00000003U¶ All M and D RAM.
-
MEMCFG_SECT_LS4
0x01000010U¶ LS4 RAM.
-
MEMCFG_SECT_LS5
0x01000020U¶ LS5 RAM.
-
MEMCFG_SECT_LS6
0x01000040U¶ LS6 RAM.
-
MEMCFG_SECT_LS7
0x01000080U¶ LS7 RAM.
-
MEMCFG_SECT_LSX_ALL
0x010000F0U¶ All LS RAM.
-
MEMCFG_SECT_GS0
0x02000001U¶ GS0 RAM.
-
MEMCFG_SECT_GSX_ALL
0x02000001U¶ All GS RAM.
-
MEMCFG_SECT_ALL
0xFFFFFFFFU¶ All configurable RAM.
-
MEMCFG_PROT_ALLOWCPUFETCH
0x00000000U¶ CPU fetch allowed.
-
MEMCFG_PROT_BLOCKCPUFETCH
0x00000001U¶ CPU fetch blocked.
-
MEMCFG_PROT_ALLOWCPUWRITE
0x00000000U¶ CPU write allowed.
-
MEMCFG_PROT_BLOCKCPUWRITE
0x00000002U¶ CPU write blocked.
-
MEMCFG_PROT_ALLOWDMAWRITE
0x00000000U¶ DMA write allowed (GSxRAM)
-
MEMCFG_PROT_BLOCKDMAWRITE
0x00000004U¶ DMA write blocked (GSxRAM)
-
MEMCFG_PROT_ALLOWHICWRITE
0x00000000U¶ HIC write allowed (GSxRAM)
-
MEMCFG_PROT_BLOCKHICWRITE
0x00000008U¶ HIC write blocked (GSxRAM)
-
MEMCFG_NMVIOL_CPUREAD
0x00000001U¶ Non-master CPU read access.
-
MEMCFG_NMVIOL_CPUWRITE
0x00000002U¶ Non-master CPU write access.
-
MEMCFG_NMVIOL_CPUFETCH
0x00000004U¶ Non-master CPU fetch access.
-
MEMCFG_NMVIOL_DMAWRITE
0x00000008U¶ Non-master DMA write access.
-
MEMCFG_NMVIOL_DMAREAD
0x00000400U¶ Non-master DMA read access.
-
MEMCFG_NMVIOL_HICREAD
0x00000800U¶ Non-master HIC read access.
-
MEMCFG_NMVIOL_HICWRITE
0x00001000U¶ Non-master HIC write access.
-
MEMCFG_MVIOL_CPUFETCH
0x00010000U¶ Master CPU fetch access.
-
MEMCFG_MVIOL_CPUWRITE
0x00020000U¶ Master CPU write access.
-
MEMCFG_MVIOL_DMAWRITE
0x00040000U¶ Master DMA write access.
-
MEMCFG_MVIOL_HICWRITE
0x00080000U¶ Master HIC write access.
-
MEMCFG_CERR_CPUREAD
0x0001U¶ Correctable CPU read error.
-
MEMCFG_UCERR_CPUREAD
0x0001U¶ Uncorrectable CPU read error.
-
MEMCFG_UCERR_DMAREAD
0x0002U¶ Uncorrectable DMA read error.
-
MEMCFG_UCERR_HICREAD
0x0020U¶ Uncorrectable HIC read error.
Enums
-
enum
MemCfg_TestMode
¶ Values that can be passed to MemCfg_setTestMode() as the testMode parameter.
Values:
-
enumerator
MEMCFG_TEST_FUNCTIONAL
= 0¶ Functional mode.
-
enumerator
MEMCFG_TEST_WRITE_DATA
= 1¶ Writes allowed to data only.
-
enumerator
MEMCFG_TEST_WRITE_ECC
= 2¶ Writes allowed to ECC only (for DxRAM)
-
enumerator
MEMCFG_TEST_WRITE_PARITY
= 2¶ Writes allowed to parity only (for LSxRAM, GSxRAM, and MSGxRAM)
-
enumerator
Functions
-
void
MemCfg_enableViolationInterrupt
(uint32_t intFlags)¶ Enables individual RAM access violation interrupt sources.
- Return
None.
- Parameters
intFlags
: is a bit mask of the interrupt sources to be enabled. Can be a logical OR any of the following values:MEMCFG_NMVIOL_CPUREAD - Non-master CPU read access
MEMCFG_NMVIOL_CPUWRITE - Non-master CPU write access
MEMCFG_NMVIOL_CPUFETCH - Non-master CPU fetch access
MEMCFG_NMVIOL_DMAWRITE - Non-master DMA write access
MEMCFG_NMVIOL_DMAREAD - Non Master DMA read access
MEMCFG_NMVIOL_HICREAD - Non-master HIC read access
MEMCFG_NMVIOL_HICWRITE - Non-master HIC write access
MEMCFG_MVIOL_CPUFETCH - Master CPU fetch access
MEMCFG_MVIOL_CPUWRITE - Master CPU write access
MEMCFG_MVIOL_DMAWRITE - Master DMA write access
MEMCFG_MVIOL_HICWRITE - Master HIC write access This function enables the indicated RAM access violation interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
-
void
MemCfg_disableViolationInterrupt
(uint32_t intFlags)¶ Disables individual RAM access violation interrupt sources.
This function disables the indicated RAM access violation interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
- Parameters
intFlags
: is a bit mask of the interrupt sources to be disabled. Can be a logical OR any of the following values:MEMCFG_NMVIOL_CPUREAD
MEMCFG_NMVIOL_CPUWRITE
MEMCFG_NMVIOL_CPUFETCH
MEMCFG_NMVIOL_DMAWRITE
MEMCFG_NMVIOL_DMAREAD
MEMCFG_NMVIOL_HICREAD - Non-master HIC read access
MEMCFG_NMVIOL_HICWRITE - Non-master HIC write access
MEMCFG_MVIOL_CPUFETCH
MEMCFG_MVIOL_CPUWRITE
MEMCFG_MVIOL_DMAWRITE
MEMCFG_MVIOL_HICWRITE - Master HIC write access
- Note
Note that only non-master violations may generate interrupts.
- Return
None.
-
uint32_t
MemCfg_getViolationInterruptStatus
(void)¶ Gets the current RAM access violation status.
This function returns the RAM access violation status. This function will return flags for both master and non-master access violations although only the non-master flags have the ability to cause the generation of an interrupt.
- Return
Returns the current violation status, enumerated as a bit field of the values:
MEMCFG_NMVIOL_CPUREAD - Non-master CPU read access
MEMCFG_NMVIOL_CPUWRITE - Non-master CPU write access
MEMCFG_NMVIOL_CPUFETCH - Non-master CPU fetch access
MEMCFG_NMVIOL_DMAWRITE - Non-master DMA write access
MEMCFG_NMVIOL_DMAREAD - Non Master DMA read access
MEMCFG_NMVIOL_HICREAD - Non-master HIC read access
MEMCFG_NMVIOL_HICWRITE - Non-master HIC write access
MEMCFG_MVIOL_CPUFETCH - Master CPU fetch access
MEMCFG_MVIOL_CPUWRITE - Master CPU write access
MEMCFG_MVIOL_DMAWRITE - Master DMA write access
\bMEMCFG_MVIOL_HICWRITE - Master HIC write access
-
void
MemCfg_forceViolationInterrupt
(uint32_t intFlags)¶ Sets the RAM access violation status.
This function sets the RAM access violation status. This function will set flags for both master and non-master access violations, and an interrupt will be generated if it is enabled.
- Parameters
intFlags
: is a bit mask of the access violation flags to be set. Can be a logical OR any of the following values:MEMCFG_NMVIOL_CPUREAD
MEMCFG_NMVIOL_CPUWRITE
MEMCFG_NMVIOL_CPUFETCH
MEMCFG_NMVIOL_DMAWRITE
MEMCFG_NMVIOL_DMAREAD
MEMCFG_NMVIOL_HICREAD
MEMCFG_NMVIOL_HICWRITE
MEMCFG_MVIOL_CPUFETCH
MEMCFG_MVIOL_CPUWRITE
MEMCFG_MVIOL_DMAWRITE
MEMCFG_MVIOL_HICWRITE
- Return
None.
-
void
MemCfg_clearViolationInterruptStatus
(uint32_t intFlags)¶ Clears RAM access violation flags.
- Return
None.
- Parameters
intFlags
: is a bit mask of the access violation flags to be cleared. Can be a logical OR any of the following values:MEMCFG_NMVIOL_CPUREAD
MEMCFG_NMVIOL_CPUWRITE
MEMCFG_NMVIOL_CPUFETCH
MEMCFG_NMVIOL_DMAWRITE
MEMCFG_NMVIOL_DMAREAD
MEMCFG_NMVIOL_HICREAD
MEMCFG_NMVIOL_HICWRITE
MEMCFG_MVIOL_CPUFETCH
MEMCFG_MVIOL_CPUWRITE
MEMCFG_MVIOL_DMAWRITE
MEMCFG_MVIOL_HICWRITE
-
void
MemCfg_setCorrErrorThreshold
(uint32_t threshold)¶ Sets the correctable error threshold value.
This value sets the error-count threshold at which a correctable error interrupt is generated. That is when the error count register reaches the value specified by the
threshold parameter, an interrupt is generated if it is enabled.- Parameters
threshold
: is the correctable error threshold.
- Return
None.
-
uint32_t
MemCfg_getCorrErrorCount
(void)¶ Gets the correctable error count.
- Return
Returns the number of correctable error have occurred.
-
void
MemCfg_enableCorrErrorInterrupt
(uint32_t intFlags)¶ Enables individual RAM correctable error interrupt sources.
This function enables the indicated RAM correctable error interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
- Parameters
intFlags
: is a bit mask of the interrupt sources to be enabled. Can take the value MEMCFG_CERR_CPUREAD only. Other values are reserved.
- Note
Note that only correctable errors may generate interrupts.
- Return
None.
-
void
MemCfg_disableCorrErrorInterrupt
(uint32_t intFlags)¶ Disables individual RAM correctable error interrupt sources.
This function disables the indicated RAM correctable error interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
- Parameters
intFlags
: is a bit mask of the interrupt sources to be disabled. Can take the value MEMCFG_CERR_CPUREAD only. Other values are reserved.
- Note
Note that only correctable errors may generate interrupts.
- Return
None.
-
uint32_t
MemCfg_getCorrErrorInterruptStatus
(void)¶ Gets the current RAM correctable error interrupt status.
- Return
Returns the current error interrupt status. Will return a value of MEMCFG_CERR_CPUREAD if an interrupt has been generated. If not, the function will return 0.
-
void
MemCfg_forceCorrErrorInterrupt
(uint32_t intFlags)¶ Sets the RAM correctable error interrupt status.
This function sets the correctable error interrupt flag.
- Parameters
intFlags
: is a bit mask of the interrupt sources to be set. Can take the value MEMCFG_CERR_CPUREAD only. Other values are reserved.
- Note
Note that only correctable errors may generate interrupts.
- Return
None.
-
void
MemCfg_clearCorrErrorInterruptStatus
(uint32_t intFlags)¶ Clears the RAM correctable error interrupt status.
This function clears the correctable error interrupt flag.
- Parameters
intFlags
: is a bit mask of the interrupt sources to be cleared. Can take the value MEMCFG_CERR_CPUREAD only. Other values are reserved.
- Note
Note that only correctable errors may generate interrupts.
- Return
None.
-
uint32_t
MemCfg_getCorrErrorStatus
(void)¶ Gets the current correctable RAM error status.
- Return
Returns the current error status, enumerated as a bit field of MEMCFG_CERR_CPUREAD
-
uint32_t
MemCfg_getUncorrErrorStatus
(void)¶ Gets the current uncorrectable RAM error status.
- Return
Returns the current error status, enumerated as a bit field of MEMCFG_UCERR_CPUREAD, MEMCFG_UCERR_DMAREAD, MEMCFG_UCERR_HICREAD
-
void
MemCfg_forceCorrErrorStatus
(uint32_t stsFlags)¶ Sets the specified correctable RAM error status flag.
This function sets the specified correctable RAM error status flag.
- Parameters
stsFlags
: is a bit mask of the error sources. This parameter can be any of the following values: MEMCFG_CERR_CPUREAD,
- Return
None.
-
void
MemCfg_forceUncorrErrorStatus
(uint32_t stsFlags)¶ Sets the specified uncorrectable RAM error status flag.
This function sets the specified uncorrectable RAM error status flag.
- Parameters
stsFlags
: is a bit mask of the error sources. This parameter can be any of the following values: MEMCFG_UCERR_CPUREAD, MEMCFG_UCERR_DMAREAD, MEMCFG_UCERR_HICREAD
- Return
None.
-
void
MemCfg_clearCorrErrorStatus
(uint32_t stsFlags)¶ Clears correctable RAM error flags.
This function clears the specified correctable RAM error flags.
- Parameters
stsFlags
: is a bit mask of the status flags to be cleared. This parameter can be any of the MEMCFG_CERR_CPUREAD,
- Return
None.
-
void
MemCfg_clearUncorrErrorStatus
(uint32_t stsFlags)¶ Clears uncorrectable RAM error flags.
This function clears the specified uncorrectable RAM error flags.
- Parameters
stsFlags
: is a bit mask of the status flags to be cleared. This parameter can be any of the MEMCFG_UCERR_CPUREAD, MEMCFG_UCERR_DMAREAD, MEMCFG_UCERR_HICREAD
- Return
None.
-
void
MemCfg_lockConfig
(uint32_t memSections)¶ Locks the writes to the configuration of specified memory sections.
This function locks writes to the access protection, initialization control and test mode configuration of a memory section. This means calling APIs like
MemCfg_setProtection() or MemCfg_initSections() for a locked memory section will have no effect until MemCfg_unlockConfig() is called.- Parameters
memSections
: is the logical OR of the sections to be configured.
The memSections parameter is an OR of one of the following sets of indicators:
MEMCFG_SECT_M0 and MEMCFG_SECT_M1 or MEMCFG_SECT_DX_ALL
MEMCFG_SECT_LS4 through MEMCFG_SECT_LSx or MEMCFG_SECT_LSX_ALL
MEMCFG_SECT_GS0 through MEMCFG_SECT_GSx or MEMCFG_SECT_GSX_ALL
OR use MEMCFG_SECT_ALL to configure all possible sections.
- Return
None.
-
void
MemCfg_unlockConfig
(uint32_t memSections)¶ Unlocks the writes to the configuration of a memory section.
This function unlocks writes to the access protection and master select configuration of a memory section that has been locked using
MemCfg_lockConfig().- Parameters
memSections
: is the logical OR of the sections to be configured.
The memSections parameter is an OR of one of the following sets of indicators:
MEMCFG_SECT_M0 and MEMCFG_SECT_M1 or MEMCFG_SECT_DX_ALL
MEMCFG_SECT_LS4 through MEMCFG_SECT_LSx or MEMCFG_SECT_LSX_ALL
MEMCFG_SECT_GS0 through MEMCFG_SECT_GSx or MEMCFG_SECT_GSX_ALL
OR use MEMCFG_SECT_ALL to configure all possible sections.
- Return
None.
-
void
MemCfg_commitConfig
(uint32_t memSections)¶ Permanently locks writes to the configuration of a memory section.
This function permanently locks writes to the access protection and master select configuration of a memory section. That means calling
MemCfg_setProtection() or MemCfg_setLSRAMMasterSel() for a locked memory section will have no effect. To lock the configuration in a nonpermanent way, use MemCfg_lockConfig().- Parameters
memSections
: is the logical OR of the sections to be configured.
The memSections parameter is an OR of one of the following sets of indicators:
MEMCFG_SECT_M0 and MEMCFG_SECT_M1 or MEMCFG_SECT_DX_ALL
MEMCFG_SECT_LS4 through MEMCFG_SECT_LSx or MEMCFG_SECT_LSX_ALL
MEMCFG_SECT_GS0 through MEMCFG_SECT_GSx or MEMCFG_SECT_GSX_ALL
OR use MEMCFG_SECT_ALL to configure all possible sections.
- Return
None.
-
void
MemCfg_setProtection
(uint32_t memSection, uint32_t protectMode)¶ Sets the access protection mode of a single memory section.
This function sets the access protection mode of a specified memory section. The mode is passed into the
protectMode parameter as the logical OR of the following values:MEMCFG_PROT_ALLOWCPUFETCH or MEMCFG_PROT_BLOCKCPUFETCH - CPU fetch
MEMCFG_PROT_ALLOWCPUWRITE or MEMCFG_PROT_BLOCKCPUWRITE - CPU write
MEMCFG_PROT_ALLOWDMAWRITE or MEMCFG_PROT_BLOCKDMAWRITE - DMA write
MEMCFG_PROT_ALLOWHICWRITE or MEMCFG_PROT_BLOCKHICWRITE - HIC write
- Parameters
memSection
: is the memory section to be configured.protectMode
: is the logical OR of the settings to be applied.
The memSection parameter is one of the following indicators:
MEMCFG_SECT_LS4 through MEMCFG_SECT_LSx
MEMCFG_SECT_GS0 through MEMCFG_SECT_GSx
This function will have no effect if the associated registers have been locked by MemCfg_lockConfig() or MemCfg_commitConfig().
- Return
None.
-
void
MemCfg_setTestMode
(uint32_t memSection, MemCfg_TestMode testMode)¶ Sets the test mode of the specified memory section.
This function sets the test mode configuration of the RAM section. The
testMode parameter can take one of the following values:MEMCFG_TEST_FUNCTIONAL
MEMCFG_TEST_WRITE_DATA
MEMCFG_TEST_WRITE_ECC (DxRAM) or MEMCFG_TEST_WRITE_PARITY (LSx, GSx, or MSGxRAM)
- Parameters
memSection
: is the memory section to be configured.testMode
: is the test mode selected.
The memSection parameter is one of the following indicators:
MEMCFG_SECT_M0 or MEMCFG_SECT_M1
MEMCFG_SECT_LS4 through MEMCFG_SECT_LSx
MEMCFG_SECT_GS0 through MEMCFG_SECT_GSx
- Return
None.
-
void
MemCfg_initSections
(uint32_t ramSections)¶ Starts the initialization the specified RAM sections.
This function starts the initialization of the specified RAM sections. Use
MemCfg_getInitStatus() to check if the initialization is done.- Parameters
ramSections
: is the logical OR of the sections to be initialized.
The ramSections parameter is an OR of one of the following sets of indicators:
MEMCFG_SECT_M0 and MEMCFG_SECT_M1 or MEMCFG_SECT_DX_ALL
MEMCFG_SECT_LS4 through MEMCFG_SECT_LSx or MEMCFG_SECT_LSX_ALL
MEMCFG_SECT_GS0 through MEMCFG_SECT_GSx or MEMCFG_SECT_GSX_ALL
OR use MEMCFG_SECT_ALL to configure all possible sections.
- Return
None.
-
bool
MemCfg_getInitStatus
(uint32_t ramSections)¶ Get the status of initialized RAM sections.
This function gets the initialization status of the RAM sections specified by the
ramSections parameter.- Parameters
ramSections
: is the logical OR of the sections to be checked.
The ramSections parameter is an OR of one of the following sets of indicators:
MEMCFG_SECT_M0 and MEMCFG_SECT_M1 or MEMCFG_SECT_DX_ALL
MEMCFG_SECT_LS4 through MEMCFG_SECT_LSx or MEMCFG_SECT_LSX_ALL
MEMCFG_SECT_GS0 through MEMCFG_SECT_GSx or MEMCFG_SECT_GSX_ALL
OR use MEMCFG_SECT_ALL to get status of all possible sections.
- Note
Use MemCfg_initSections() to start the initialization.
- Return
Returns true if all the sections specified by ramSections have been initialized and false if not.
-
uint32_t
MemCfg_getViolationAddress
(uint32_t intFlag)¶ Get the violation address associated with a intFlag.
- Return
Returns the violation address associated with the intFlag.
- Parameters
intFlag
: is the type of access violation as indicated by ONE of these values:MEMCFG_NMVIOL_CPUREAD
MEMCFG_NMVIOL_CPUWRITE
MEMCFG_NMVIOL_CPUFETCH
MEMCFG_NMVIOL_DMAWRITE
MEMCFG_NMVIOL_CLA1READ
MEMCFG_NMVIOL_CLA1WRITE
MEMCFG_NMVIOL_CLA1FETCH
MEMCFG_MVIOL_CPUFETCH
MEMCFG_MVIOL_CPUWRITE
MEMCFG_MVIOL_DMAWRITE
-
uint32_t
MemCfg_getCorrErrorAddress
(uint32_t stsFlag)¶ Get the correctable error address associated with a stsFlag.
- Return
Returns the error address associated with the stsFlag.
- Parameters
stsFlag
: is the type of error to which the returned address will correspond. Can currently take the value MEMCFG_CERR_CPUREAD only. Other values are reserved.
-
uint32_t
MemCfg_getUncorrErrorAddress
(uint32_t stsFlag)¶ Get the uncorrectable error address associated with a stsFlag.
- Return
Returns the error address associated with the stsFlag.
- Parameters
stsFlag
: is the type of error to which the returned address will correspond. It may be passed one of these values: MEMCFG_UCERR_CPUREAD, MEMCFG_UCERR_DMAREAD, MEMCFG_UCERR_CLA1READ, or MEMCFG_UCERR_ECATMEMREAD values.
-
Many of the functions provided by this API to configure RAM sections’ settings will take a RAM section identifier or an OR of several identifiers as a parameter. These are #defines with names in the format MEMCFG_SECT_X. Take care to read the function description to learn which functions can operate on multiple sections of the same type at a time and which ones can only configure one section at a time. A quick way to check this is to see if the parameter says e ramSection or the plural e ramSections. Some functions may also be able to take a MEMCFG_SECT_ALL value to indicate that all RAM sections should be operated on at the same time. Again, read the function’s detailed description to be sure.
The code for this module is contained in driverlib/memcfg.c, with driverlib/memcfg.h containing the API declarations for use by applications.