# 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_TYPE_MSG` 0x03000000U
  `MEMCFG_SECT_TYPE_ROM` 0x04000000U
  `MEMCFG_SECT_TYPE_PERIMEM` 0x05000000U
  `MEMCFG_SECT_NUM_MASK` 0x00FFFFFFU
  `MEMCFG_XACCPROTX_M` ((uint32_t)MEMCFG_GSXACCPROT0_FETCHPROT_GS0

  | \

  (uint32_t)

  MEMCFG_GSXACCPROT0_CPUWRPROT_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_TESTLOCK_KEY` 0xA5A50000U
  `MEMCFG_SECT_M0` 0x00000001U

    M0 RAM.

  `MEMCFG_SECT_M1` 0x00000002U

    M1 RAM.

  `MEMCFG_SECT_D0` 0x00000004U

    D0 RAM.

  `MEMCFG_SECT_D1` 0x00000008U

    D1 RAM.

  `MEMCFG_SECT_D2` 0x00000010U

    D2 RAM.

  `MEMCFG_SECT_D3` 0x00000020U

    D3 RAM.

  `MEMCFG_SECT_D4` 0x00000040U

    D4 RAM.

  `MEMCFG_SECT_D5` 0x00000080U

    D5 RAM.

  `MEMCFG_SECT_DX_ALL` 0x000000FFU

    All M and D RAM.

  `MEMCFG_SECT_PIEVECT` 0x00000100U

    PIEVECT RAM.

  `MEMCFG_SECT_LS0` 0x01000001U

    LS0 RAM.

  `MEMCFG_SECT_LS1` 0x01000002U

    LS1 RAM.

  `MEMCFG_SECT_LS2` 0x01000004U

    LS2 RAM.

  `MEMCFG_SECT_LS3` 0x01000008U

    LS3 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_LS8` 0x01000100U

    LS8 RAM.

  `MEMCFG_SECT_LS9` 0x01000200U

    LS9 RAM.

  `MEMCFG_SECT_LSX_ALL` 0x010003FFU

    All LS RAM.

  `MEMCFG_SECT_GS0` 0x02000001U

    GS0 RAM.

  `MEMCFG_SECT_GS1` 0x02000002U

    GS1 RAM.

  `MEMCFG_SECT_GS2` 0x02000004U

    GS2 RAM.

  `MEMCFG_SECT_GS3` 0x02000008U

    GS3 RAM.

  `MEMCFG_SECT_GS4` 0x02000010U

    GS4 RAM.

  `MEMCFG_SECT_GSX_ALL` 0x0200001FU

    All GS RAM.

  `MEMCFG_SECT_MSGCPUTOCPU0` 0x03000001U

    CPU-to-CPU message RAM0.

  `MEMCFG_SECT_MSGCPUTOCLA1` 0x03000002U

    CPU-to-CLA1 message RAM.

  `MEMCFG_SECT_MSGCLA1TOCPU` 0x03000004U

    CLA1-to-CPU message RAM.

  `MEMCFG_SECT_MSGCLA1TODMA` 0x03000020U

    CLA1-to-DMA message RAM.

  `MEMCFG_SECT_MSGDMATOCLA1` 0x03000040U

    DMA-to-CLA1 message RAM.

  `MEMCFG_SECT_MSGCPUTOCPU1` 0x03000080U

    CPU-to-CPU message RAM1.

  `MEMCFG_SECT_MSGX_ALL` 0x030000E7U

    All message RAM.

  `MEMCFG_SECT_ROMBOOT` 0x04000001U

    BOOT ROM.

  `MEMCFG_SECT_ROMSECURE` 0x04000002U

    Secure ROM.

  `MEMCFG_SECT_ROMCLADATA` 0x04000004U

    CLA Data ROM.

  `MEMCFG_SECT_ROM_ALL` 0x04000007U

    All ROMs.

  `MEMCFG_SECT_PERIMEM_ETHERCAT` 0x05000020U

    Ethercat memory.

  `MEMCFG_SECT_PERIMEM_ALL` 0x05000020U

    All peripheral memories.

  `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_NMVIOL_CPUREAD` 0x00000001U

    Non-controller CPU read access.

  `MEMCFG_NMVIOL_CPUWRITE` 0x00000002U

    Non-controller CPU write access.

  `MEMCFG_NMVIOL_CPUFETCH` 0x00000004U

    Non-controller CPU fetch access.

  `MEMCFG_NMVIOL_DMAWRITE` 0x00000008U

    Non-controller DMA write access.

  `MEMCFG_NMVIOL_CLA1READ` 0x00000010U

    Non-controller CLA1 read access.

  `MEMCFG_NMVIOL_CLA1WRITE` 0x00000020U

    Non-controller CLA1 write access.

  `MEMCFG_NMVIOL_CLA1FETCH` 0x00000040U

    Non-controller CLA1 fetch access.

  `MEMCFG_NMVIOL_DMAREAD` 0x00000400U

    Non-controller DMA read access.

  `MEMCFG_MVIOL_CPUFETCH` 0x00010000U

    Controller CPU fetch access.

  `MEMCFG_MVIOL_CPUWRITE` 0x00020000U

    Controller CPU write access.

  `MEMCFG_MVIOL_DMAWRITE` 0x00040000U

    Controller DMA write access.

  `MEMCFG_CERR_CPUREAD` 0x0001U

    Correctable CPU read error.

  `MEMCFG_CERR_DMAREAD` 0x0002U

    Correctable DMA read error.

  `MEMCFG_CERR_CLA1READ` 0x0004U

    Correctable CLA1 read error.

  `MEMCFG_UCERR_CPUREAD` 0x0001U

    Uncorrectable CPU read error.

  `MEMCFG_UCERR_DMAREAD` 0x0002U

    Uncorrectable DMA read error.

  `MEMCFG_UCERR_CLA1READ` 0x0004U

    Uncorrectable CLA1 read error.

  `MEMCFG_UCERR_ECATMEMREAD` 0x0010U

    Uncorrectable ECAT RAM read error.

  `MEMCFG_DIAGERR_UNCORR` 0x00000002U

    Uncorr error in diag/test mode.

  `MEMCFG_DIAGERR_CORR` 0x00000001U

    Corr error in diag/test mode.

  Enums

  enum `MemCfg_CLAMemoryType`

    Values that can be passed to MemCfg_setCLAMemType() as the claMemType parameter.

    Values:

    enumerator `MEMCFG_CLA_MEM_DATA`

      Section is CLA data memory.

    enumerator `MEMCFG_CLA_MEM_PROGRAM`

      Section is CLA program memory.

  enum `MemCfg_LSRAMControllerSel`

    Values that can be passed to MemCfg_setLSRAMControllerSel() as the controllerSel parameter.

    Values:

    enumerator `MEMCFG_LSRAMCONTROLLER_CPU_ONLY`

      CPU is the owner of the section.

    enumerator `MEMCFG_LSRAMCONTROLLER_CPU_CLA1`

      CPU and CLA1 share this section.

  enum `MemCfg_GSRAMControllerSel`

    Values that can be passed to MemCfg_setGSRAMControllerSel() as the controllerSel parameter.

    Values:

    enumerator `MEMCFG_GSRAMCONTROLLER_CPU1`

      CPU1 is controller of the section.

    enumerator `MEMCFG_GSRAMCONTROLLER_CPU2`

      CPU2 is controller of the section.

  enum `MemCfg_TestMode`

    Values that can be passed to MemCfg_setTestMode() as the testMode parameter.

    Values:

    enumerator `MEMCFG_TEST_FUNCTIONAL` = 0

      Functional mode. Test mode is disabled.

    enumerator `MEMCFG_TEST_WRITE_DATA` = 1

      Writes allowed to data only.

    enumerator `MEMCFG_TEST_WRITE_ECC` = 2

      Writes allowed to ECC only (for DxRAM/MxRAM )

    enumerator `MEMCFG_TEST_WRITE_PARITY` = 2

      Writes allowed to Parity only (for LSxRAM, GSxRAM, and MSGxRAM)

    enumerator `MEMCFG_TEST_FUNC_DIAG` = 3

      Diagnostic mode, similar to functional mode but NMI is not generated.

  Functions

  void `MemCfg_setCLAMemType`(uint32_t ramSections, MemCfg_CLAMemoryType claMemType)

    Sets the CLA memory type of the specified RAM section.

    This function sets the CLA memory type configuration of the RAM section. If the

    claMemType parameter is MEMCFG_CLA_MEM_DATA, the RAM section will be configured as CLA data memory. If MEMCFG_CLA_MEM_PROGRAM, the RAM section will be configured as CLA program memory.
    Parameters

      - `ramSections`: is the logical OR of the sections to be configured.

      - `claMemType`: indicates data memory or program memory.

    The ramSections parameter is an OR of the following indicators: MEMCFG_SECT_LS0 through MEMCFG_SECT_LSx.

    Note

      This API only applies to LSx RAM and has no effect if the CLA isn’t controller of the memory section.

    See

      MemCfg_setLSRAControllerSel()

    Return

      None.

  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-controller CPU read access

        - MEMCFG_NMVIOL_CPUWRITE - Non-controller CPU write access

        - MEMCFG_NMVIOL_CPUFETCH - Non-controller CPU fetch access

        - MEMCFG_NMVIOL_DMAWRITE - Non-controller DMA write access

        - MEMCFG_NMVIOL_CLA1READ - Non-controller CLA1 read access

        - MEMCFG_NMVIOL_CLA1WRITE - Non-controller CLA1 write access

        - MEMCFG_NMVIOL_CLA1FETCH - Non-controller CLA1 fetch access

        - MEMCFG_NMVIOL_DMAREAD - Non-controller DMA read access

        - MEMCFG_MVIOL_CPUFETCH - Controller CPU fetch access

        - MEMCFG_MVIOL_CPUWRITE - Controller CPU write access

        - MEMCFG_MVIOL_DMAWRITE - Controller DMA 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 - Non-controller CPU read access

        - MEMCFG_NMVIOL_CPUWRITE - Non-controller CPU write access

        - MEMCFG_NMVIOL_CPUFETCH - Non-controller CPU fetch access

        - MEMCFG_NMVIOL_DMAWRITE - Non-controller DMA write access

        - MEMCFG_NMVIOL_CLA1READ - Non-controller CLA1 read access

        - MEMCFG_NMVIOL_CLA1WRITE - Non-controller CLA1 write access

        - MEMCFG_NMVIOL_CLA1FETCH - Non-controller CLA1 fetch access

        - MEMCFG_NMVIOL_DMAREAD - Non-controller DMA read access

        - MEMCFG_MVIOL_CPUFETCH - Controller CPU fetch access

        - MEMCFG_MVIOL_CPUWRITE - Controller CPU write access

        - MEMCFG_MVIOL_DMAWRITE - Controller DMA write access

    Note

      Note that only non-controller 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 controller and non-controller access violations although only the non-controller 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-controller CPU read access

      - MEMCFG_NMVIOL_CPUWRITE - Non-controller CPU write access

      - MEMCFG_NMVIOL_CPUFETCH - Non-controller CPU fetch access

      - MEMCFG_NMVIOL_DMAWRITE - Non-controller DMA write access

      - MEMCFG_NMVIOL_CLA1READ - Non-controller CLA1 read access

      - MEMCFG_NMVIOL_CLA1WRITE - Non-controller CLA1 write access

      - MEMCFG_NMVIOL_CLA1FETCH - Non-controller CLA1 fetch access

      - MEMCFG_NMVIOL_DMAREAD - Non-controller DMA read access

      - MEMCFG_MVIOL_CPUFETCH - Controller CPU fetch access

      - MEMCFG_MVIOL_CPUWRITE - Controller CPU write access

      - MEMCFG_MVIOL_DMAWRITE - Controller DMA 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 controller and non-controller 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 - Non-controller CPU read access

        - MEMCFG_NMVIOL_CPUWRITE - Non-controller CPU write access

        - MEMCFG_NMVIOL_CPUFETCH - Non-controller CPU fetch access

        - MEMCFG_NMVIOL_DMAWRITE - Non-controller DMA write access

        - MEMCFG_NMVIOL_CLA1READ - Non-controller CLA1 read access

        - MEMCFG_NMVIOL_CLA1WRITE - Non-controller CLA1 write access

        - MEMCFG_NMVIOL_CLA1FETCH - Non-controller CLA1 fetch access

        - MEMCFG_NMVIOL_DMAREAD - Non-controller DMA read access

        - MEMCFG_MVIOL_CPUFETCH - Controller CPU fetch access

        - MEMCFG_MVIOL_CPUWRITE - Controller CPU write access

        - MEMCFG_MVIOL_DMAWRITE - Controller DMA write access

    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 - Non-controller CPU read access

        - MEMCFG_NMVIOL_CPUWRITE - Non-controller CPU write access

        - MEMCFG_NMVIOL_CPUFETCH - Non-controller CPU fetch access

        - MEMCFG_NMVIOL_DMAWRITE - Non-controller DMA write access

        - MEMCFG_NMVIOL_CLA1READ - Non-controller CLA1 read access

        - MEMCFG_NMVIOL_CLA1WRITE - Non-controller CLA1 write access

        - MEMCFG_NMVIOL_CLA1FETCH - Non-controller CLA1 fetch access

        - MEMCFG_NMVIOL_DMAREAD - Non-controller DMA read access

        - MEMCFG_MVIOL_CPUFETCH - Controller CPU fetch access

        - MEMCFG_MVIOL_CPUWRITE - Controller CPU write access

        - MEMCFG_MVIOL_DMAWRITE - Controller DMA write access

  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, MEMCFG_CERR_DMAREAD, or MEMCFG_CERR_CLA1READ

  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_CLA1READ, or MEMCFG_UCERR_ECATMEMREAD.

  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, MEMCFG_CERR_DMAREAD, or MEMCFG_CERR_CLA1READ

    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_CLA1READ, or MEMCFG_UCERR_ECATMEMREAD.

    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 following : MEMCFG_CERR_CPUREAD, MEMCFG_CERR_DMAREAD, or MEMCFG_CERR_CLA1READ

    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 following : MEMCFG_UCERR_CPUREAD, MEMCFG_UCERR_DMAREAD, MEMCFG_UCERR_CLA1READ, or MEMCFG_UCERR_ECATMEMREAD.

    Return

      None.

  uint32_t `MemCfg_getDiagErrorStatus`(void)

    Gets the diagnostics corr/uncorr memory error status in test mode.

    Return

      Returns the diagnostics error status in test mode. It can return following values: MEMCFG_DIAGERR_UNCORR, and/or MEMCFG_DIAGERR_CORR.

  void `MemCfg_clearDiagErrorStatus`(uint32_t stsFlags)

    Clears the diagnostics corr/uncorr memory error status.

    This function clears the specified diagnostics corr/uncorr RAM/ROM memory error flags in test mode. The param

    stsFlags can be any of the following values: MEMCFG_DIAGERR_UNCORR, and/or MEMCFG_DIAGERR_CORR.
    Parameters

      - `stsFlags`: is a bit mask of the status flags to be cleared.

    Return

      None.

  uint32_t `MemCfg_getDiagErrorAddress`(void)

    Gets address location of diagnostics corr/uncorr memory read/write error.

    Return

      Return address location of diagnostics corr/uncorr memory error error in test mode.

  void `MemCfg_enableROMWaitState`(void)

    Enables ROM wait state.

    This function enables the ROM wait state. This mean CPU accesses to ROM are 1-wait.

    Return

      None.

  void `MemCfg_disableROMWaitState`(void)

    Disables ROM wait state.

    This function enables the ROM wait state. This mean CPU accesses to ROM are 0-wait.

    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 and controller select configuration of a memory section.That means calling

    MemCfg_setProtection() or MemCfg_setLSRAMControllerSel() 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_D0 through MEMCFG_SECT_D5 or MEMCFG_SECT_DX_ALL

    - MEMCFG_SECT_LS0 through MEMCFG_SECT_LSx or MEMCFG_SECT_LSX_ALL

    - MEMCFG_SECT_GS0 through MEMCFG_SECT_GSx or MEMCFG_SECT_GSX_ALL

    - MEMCFG_SECT_MSGCPUTOCPU0, MEMCFG_SECT_MSGCPUTOCLA1, MEMCFG_SECT_MSGCLA1TOCPU, MEMCFG_SECT_MSGCLA1TODMA, MEMCFG_SECT_MSGDMATOCLA1, MEMCFG_SECT_MSGCPUTOCPU1, or use MEMCFG_SECT_MSGX_ALL to configure all possible message RAM sections.

    - 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 controller 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_D0 through MEMCFG_SECT_D5 or MEMCFG_SECT_DX_ALL

    - MEMCFG_SECT_LS0 through MEMCFG_SECT_LSx or MEMCFG_SECT_LSX_ALL

    - MEMCFG_SECT_GS0 through MEMCFG_SECT_GSx or MEMCFG_SECT_GSX_ALL

    - MEMCFG_SECT_MSGCPUTOCPU0, MEMCFG_SECT_MSGCPUTOCLA1, MEMCFG_SECT_MSGCLA1TOCPU, MEMCFG_SECT_MSGCLA1TODMA, MEMCFG_SECT_MSGDMATOCLA1, MEMCFG_SECT_MSGCPUTOCPU1, or use MEMCFG_SECT_MSGX_ALL to configure all possible message RAM sections.

    - 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 controller select configuration of a memory section. That means calling

    MemCfg_setProtection() or MemCfg_setLSRAMControllerSel() 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_D0 through MEMCFG_SECT_D5 or MEMCFG_SECT_DX_ALL

    - MEMCFG_SECT_LS0 through MEMCFG_SECT_LSx or MEMCFG_SECT_LSX_ALL

    - MEMCFG_SECT_GS0 through MEMCFG_SECT_GSx or MEMCFG_SECT_GSX_ALL

    - MEMCFG_SECT_MSGCPUTOCPU0, MEMCFG_SECT_MSGCPUTOCLA1, MEMCFG_SECT_MSGCLA1TOCPU, MEMCFG_SECT_MSGCLA1TODMA, MEMCFG_SECT_MSGDMATOCLA1, MEMCFG_SECT_MSGCPUTOCPU1, or use MEMCFG_SECT_MSGX_ALL to configure all possible message RAM sections.

    - 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

    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_M0 or MEMCFG_SECT_M1

    - MEMCFG_SECT_D0 through MEMCFG_SECT_Dx

    - MEMCFG_SECT_LS0 through MEMCFG_SECT_LSx

    - MEMCFG_SECT_GS0 through MEMCFG_SECT_GSx

    - MEMCFG_SECT_MSGCPUTOCPU0 or MEMCFG_SECT_MSGCPUTOCPU1

    This function will have no effect if the associated registers have been locked by MemCfg_lockConfig() or MemCfg_commitConfig() or if the memory is configured as CLA program memory.

    Return

      None.

  void `MemCfg_setLSRAMControllerSel`(uint32_t ramSection, MemCfg_LSRAMControllerSel controllerSel)

    Sets the controller of the specified LSxRAM section.

    This function sets the controller select configuration of the LSxRAM section. If the

    controllerSel parameter is MEMCFG_LSRAMCONTROLLER_CPU_ONLY, the LSxRAM section passed into the ramSection parameter will be dedicated to the CPU. If MEMCFG_LSRAMCONTROLLER_CPU_CLA1, the memory section will be shared between the CPU and the CLA.
    Parameters

      - `ramSection`: is the LSxRAM section to be configured.

      - `controllerSel`: is the sharing selection.

    The ramSection parameter should be a value from MEMCFG_SECT_LS0 through MEMCFG_SECT_LSx.

    This function will have no effect if the associated registers have been locked by MemCfg_lockConfig() or MemCfg_commitConfig().

    Note

      This API only applies to LSxRAM.

    Return

      None.

  void `MemCfg_setGSRAMControllerSel`(uint32_t ramSections, MemCfg_GSRAMControllerSel controllerSel)

    Sets the controller of the specified GSxRAM section.

    This function sets the controller select configuration of the GSxRAM section.If the

    controllerSel parameter is MEMCFG_GSRAMCONTROLLER_CPU1, the GSRAM sections passed into the ramSections parameter will be dedicated to CPU1. If MEMCFG_GSRAMCONTROLLER_CPU2, the memory section will be dedicated to CPU2.
    Parameters

      - `ramSections`: is the logical OR of the sections to be configured.

      - `controllerSel`: is the sharing selection.

    The ramSections parameter should be a logical OR of values from 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().

    Note

      This API only applies to GSxRAM.

    Return

      None.

  void `MemCfg_lockTestConfig`(uint32_t memSections)

    Locks the writes to the test mode configuration of specified memory sections.

    This function locks writes to the test mode configuration of a RAM section. That means calling

    MemCfg_setTestMode() for a locked RAM section will have no effect until MemCfg_unlockTestConfig() 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, MEMCFG_SECT_M1, MEMCFG_SECT_D0, MEMCFG_SECT_D1 or use MEMCFG_SECT_DX_ALL

    - MEMCFG_SECT_LS0 through MEMCFG_SECT_LSx or use MEMCFG_SECT_LSX_ALL to configure all possible LSRAM sections.

    - MEMCFG_SECT_GS0 through MEMCFG_SECT_GSx or use MEMCFG_SECT_GSX_ALL to configure all possible GSRAM sections.

    - MEMCFG_SECT_MSGCPUTOCLA1, MEMCFG_SECT_MSGCLA1TOCPU, MEMCFG_SECT_MSGCLA1TODMA, MEMCFG_SECT_MSGDMATOCLA1, MEMCFG_SECT_MSGCPUTOCPU0, MEMCFG_SECT_MSGCPUTOCPU1, , or use MEMCFG_SECT_MSGX_ALL

    - MEMCFG_SECT_ROMBOOT, MEMCFG_SECT_ROMSECURE, MEMCFG_SECT_ROMCLADATA or MEMCFG_SECT_ROM_ALL to configure all possible ROM sections.

    - MEMCFG_SECT_PERIMEM_ETHERCAT or MEMCFG_SECT_PERIMEM_ALL to configure all possible peal memories.ripher

    - OR use MEMCFG_SECT_ALL to configure all possible sections.

    Return

      None.

  void `MemCfg_unlockTestConfig`(uint32_t memSections)

    Unlocks the writes to the test mode configuration of specified memory sections.

    This function unlocks writes to the test mode configuration of a RAM section that has been locked using

    MemCfg_lockTestConfig().
    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, MEMCFG_SECT_M1, MEMCFG_SECT_D0, MEMCFG_SECT_D1 or use MEMCFG_SECT_DX_ALL

    - MEMCFG_SECT_LS0 through MEMCFG_SECT_LSx or use MEMCFG_SECT_LSX_ALL to configure all possible LSRAM sections.

    - MEMCFG_SECT_GS0 through MEMCFG_SECT_GSx or use MEMCFG_SECT_GSX_ALL to configure all possible GSRAM sections.

    - MEMCFG_SECT_MSGCPUTOCLA1, MEMCFG_SECT_MSGCLA1TOCPU, MEMCFG_SECT_MSGCLA1TODMA, MEMCFG_SECT_MSGDMATOCLA1, MEMCFG_SECT_MSGCPUTOCPU0, MEMCFG_SECT_MSGCPUTOCPU1, , or use MEMCFG_SECT_MSGX_ALL

    - MEMCFG_SECT_ROMBOOT, MEMCFG_SECT_ROMSECURE, MEMCFG_SECT_ROMCLADATA or MEMCFG_SECT_ROM_ALL to configure all possible ROM sections.

    - MEMCFG_SECT_PERIMEM_ETHERCAT or MEMCFG_SECT_PERIMEM_ALL to configure all possible peripheral memories.

    - OR use MEMCFG_SECT_ALL to configure all possible sections.

    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

    - MEMCFG_TEST_WRITE_PARITY

    - MEMCFG_TEST_FUNC_DIAG

    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, MEMCFG_SECT_M1

    - MEMCFG_SECT_D0, MEMCFG_SECT_D1

    - MEMCFG_SECT_LS0 through MEMCFG_SECT_LSx

    - MEMCFG_SECT_GS0 through MEMCFG_SECT_GSx

    - MEMCFG_SECT_MSGCPUTOCLA1, MEMCFG_SECT_MSGCLA1TOCPU, MEMCFG_SECT_MSGCLA1TODMA, MEMCFG_SECT_MSGDMATOCLA1, MEMCFG_SECT_MSGCPUTOCPU0, MEMCFG_SECT_MSGCPUTOCPU1,

    - MEMCFG_SECT_ROMBOOT, MEMCFG_SECT_ROMSECURE, MEMCFG_SECT_ROMCLADATA

    - MEMCFG_SECT_PERIMEM_ETHERCAT

    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, MEMCFG_SECT_M1, MEMCFG_SECT_D0, MEMCFG_SECT_D1, or MEMCFG_SECT_DX_ALL

    - MEMCFG_SECT_LS0 through MEMCFG_SECT_LSx, or MEMCFG_SECT_LSX_ALL

    - MEMCFG_SECT_GS0 through MEMCFG_SECT_GSx, or MEMCFG_SECT_GSX_ALL

    - MEMCFG_SECT_MSGCPUTOCLA1, MEMCFG_SECT_MSGCLA1TOCPU, MEMCFG_SECT_MSGCLA1TODMA, MEMCFG_SECT_MSGDMATOCLA1, MEMCFG_SECT_MSGCPUTOCPU0, MEMCFG_SECT_MSGCPUTOCPU1, or MEMCFG_SECT_MSGX_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, MEMCFG_SECT_M1, MEMCFG_SECT_D0, MEMCFG_SECT_D1, or MEMCFG_SECT_DX_ALL

    - MEMCFG_SECT_LS0 through MEMCFG_SECT_LSx, or MEMCFG_SECT_LSX_ALL

    - MEMCFG_SECT_GS0 through MEMCFG_SECT_GSx, or MEMCFG_SECT_GSX_ALL

    - MEMCFG_SECT_MSGCPUTOCLA1, MEMCFG_SECT_MSGCLA1TOCPU, MEMCFG_SECT_MSGCLA1TODMA, MEMCFG_SECT_MSGDMATOCLA1, MEMCFG_SECT_MSGCPUTOCPU0, MEMCFG_SECT_MSGCPUTOCPU1, or MEMCFG_SECT_MSGX_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 - Non-controller CPU read access

        - MEMCFG_NMVIOL_CPUWRITE - Non-controller CPU write access

        - MEMCFG_NMVIOL_CPUFETCH - Non-controller CPU fetch access

        - MEMCFG_NMVIOL_DMAWRITE - Non-controller DMA write access

        - MEMCFG_NMVIOL_CLA1READ - Non-controller CLA1 read access

        - MEMCFG_NMVIOL_CLA1WRITE - Non-controller CLA1 write access

        - MEMCFG_NMVIOL_CLA1FETCH - Non-controller CLA1 fetch access

        - MEMCFG_NMVIOL_DMAREAD - Non-controller DMA read access

        - MEMCFG_MVIOL_CPUFETCH - Controller CPU fetch access

        - MEMCFG_MVIOL_CPUWRITE - Controller CPU write access

        - MEMCFG_MVIOL_DMAWRITE - Controller DMA write access

  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. It can take following values: MEMCFG_CERR_CPUREAD, MEMCFG_CERR_CLA1READ, MEMCFG_CERR_DMAREAD.

  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.

  void `MemCfg_forceMemError`(uint32_t memSections)

    Forces parity error in the selected memory.

    This function forces the parity error in the memories specified by the

    memSections parameter.
    Parameters

      - `memSections`: is the logical OR of the sections to be tested.

    The memSections parameter is an OR of one of the following sets of indicators:

    - MEMCFG_SECT_ROMBOOT, MEMCFG_SECT_ROMSECURE , MEMCFG_SECT_ROMCLADATA, MEMCFG_SECT_ROM_ALL.

    - MEMCFG_SECT_PERIMEM_ETHERCAT, or MEMCFG_SECT_PERIMEM_ALL

    - OR use MEMCFG_SECT_ALL to force parity error in all possible memory sections.

    Return

      None.

  void `MemCfg_enablePeriMemTestMode`(uint32_t memSections)

    Enables test mode for selected peripheral memories.

    This function enables test mode for selected peripheral memories specified by the

    memTypes parameter.
    Parameters

      - `memSections`: is the logical OR of the type of peripheral memories to be tested.

    The memTypes parameter is an OR of one of the following sets of indicators:

    - MEMCFG_SECT_PERIMEM_ETHERCAT, or MEMCFG_SECT_PERIMEM_ALL

    Return

      None.

  void `MemCfg_disablePeriMemTestMode`(uint32_t memSections)

    Disables the test mode for selected peripheral memories.

    This function disables test mode for selected peripheral memories specified by the

    memSections parameter.
    Parameters

      - `memSections`: is the logical OR of the type of peripheral memories to be tested.

    The memTypes parameter is an OR of one of the following sets of indicators:

    - MEMCFG_SECT_PERIMEM_ETHERCAT, or MEMCFG_SECT_PERIMEM_ALL

    Return

      None.

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.