# TCM (Overview)

## Description

TCM is an abbreviation for "Tightly Coupled Memory." It is high-speed memory attached directly to the ARM9 core. Since 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 kilobytes of space, while DTCM has 16 kilobytes. ITCM can store instructions and data. DTCM can store data, but cannot store instructions.

Mapping

ITCM can be mapped to an address that is a multiple of 32 KB, while DTCM can be mapped to an address that is 16 KB. In the NitroSDK, ITCM is mapped at `0x01FF8000 - 0x01FFFFFF`, while DTCM is mapped at `0x027E0000 - 0x027E3FFF`. These positions can be altered under specific conditions, but if it is not necessary to do so, it is recommended that development be performed with the configuration as-is.

Enabling and Disabling

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

`OS_EnableITCM()`
`OS_DisableITCM()`
`OS_EnableDTCM()`
`OS_DisableDTCM()`

Obtaining and Configuring the DTCM Addresses

For DTCM, `OS_GetDTCMAddress()` can be used to get the mapped address. `OS_SetDTCMAddress()` sets the address. However, if DTCM changes the mapping location during program operation after stack region and each hook vector has been mapped, it is possible that the program will become unstable. It is therefore recommended that you avoid making frequent changes with one program.

ITCM has no Set or Get functions. The constant `HW_ITCM` is normally defined at the ITCM starting address `0x01FF8000`.

TCM–Related CP15 Settings

The ITCM and DTCM configurations depend on the configuration of the internal register of co-processor 15 (`CP15`). The NitroSDK provides an API that directly accesses this register. Set and Get functions are included for the parameters to be provided to the register (or loaded into the register) separately for ITCM and DTCM. However, in order to use them (particularly the Set functions), their operating principles must be understood.

`OS_SetITCMParam()`
`OS_GetITCMParam()`
`OS_SetDTCMParam()`
`OS_GetDTCMParam()`

## See Also

`An Overview of OS Functions (TCM)
`

## Revision History

04/13/2005 Changed DTCM default addresses
12/14/2004 Revised wording
11/09/2004 Initial version