TCM: Overview

TCM is an abbreviation for "Tightly Coupled Memory." It is high-speed memory attached directly to the ARM9 core. Because this memory is not connected to the ARM9 bus, it is possible for the ARM9 to perform process using TCM, even in DMA.

There are two types of TCM: Instruction TCM (ITCM) and Data TCM (DTCM). ITCM has 32 KB of space, and DTCM has 16 KB. ITCM can store instructions and data. DTCM can store data, but cannot store instructions.

Enabling and Disabling

ITCM and DTCM can be enabled and disabled with the following functions.

OS_EnableITCM enables ITCM.
OS_DisableITCM disables ITCM.
OS_EnableDTCM enables DTCM.
OS_DisableDTCM disables DTCM.

Mapping

ITCM can be mapped to an address that is a multiple of 32 KB, and DTCM can be mapped to an address that is 16 KB.

These are placed at the following addresses.

TCM Type Size Usage Address
ITCM 32KB Instruction Code / Data 0x01FF8000 - 0x01FFFFFF
DTCM 16KB Data
0x027E0000 to 0x027E3FFF
(for a NITRO ROM) (Note 1)
0x02FE0000 to 0x02FE3FFF
(for a hybrid or limited ROM) (Note 2)


(Note 1) DTCM starts at 0x027E0000 for a NITRO ROM. This is regardless of whether the NITRO ROM is run on NITRO hardware or TWL hardware.

(Note 2) DTCM starts at 0x02FE0000 for a hybrid ROM or a limited ROM. This is obvious when running in TWL mode, but also applies to a hybrid ROM that is running in NITRO mode, regardless of the hardware.

Note that DTCM addresses thus depend upon the ROM type instead of the operating mode.

Functions to Get ITCM Addresses

In ITCM, OS_GetITCMAddress is prepared as a function to get the HW_ITCM constant. The HW_ITCM constant is defined at the default ITCM starting address: 0x01FF8000.

Functions to Get DTCM Addresses

For DTCM, use the OS_GetDTCMAddress function to get the mapped address. The OS_SetDTCMAddress function sets the address. The stack region and each type of hook vector are mapped for the DTCM. The program may become unstable if the mapping locations are changed while the program is running. It is therefore recommended that you avoid making frequent changes with one program.

TCM-Related CP15 Settings

The ITCM and DTCM configurations depend on the configuration of the internal register of co-processor 15 (CP15). TWL-SDK provides functions that directly access this register. ITCM and DTCM both have Set and Get functions that take arguments to be provided to the register (or loaded from the register). However, to use them (particularly the Set functions), you must have a firm understanding of their operating principles.

OS_SetITCMParam sets the ITCM parameters.
OS_GetITCMParam gets the ITCM parameters.
OS_SetDTCMParam sets the DTCM parameters.
OS_GetDTCMParam gets the DTCM parameters.

See Also

An Overview of OS Functions (TCM)

Revision History

2009/04/13 Fixed mistakes in DTCM addresses.
2007/11/28 Added an explanation of TWL mode.
2005/04/13 Changed the default DTCM address.
2004/12/14 Revised issues such as terminology and word endings.
2004/11/09 Initial version.


CONFIDENTIAL