SPRUJ17I March 2022 – August 2025 AM2631 , AM2631-Q1 , AM2632 , AM2632-Q1 , AM2634 , AM2634-Q1
The R5F has two tightly-coupled memories (TCMs), ATCM and BTCM. The BTCM is further broken down into two interleaved banks, B0TCM and B1TCM.
TCMs are low-latency, tightly integrated memories for the R5F to use. Either TCM can be used for any combination of instruction and/or data. TCM performance is equal to performance on instructions/data that are in cache. However, TCMs have some additional advantages over cache. TCMs can be loaded with instructions that do not cache well (such as ISRs) or preloaded with code by an external source, before that code is needed, to save cache miss time. TCMs are also a good place for blocks of data for intense processing. They can be loaded (or pre-loaded by an external source) before the data is needed, saving cache miss time. The data can then be directly accessed by an external source, instead of needing to do cache evicts.
As mentioned, TCMs can be accessed (either read or written) by an external source over the TCM VBUSM peripheral interface. This allows instructions or data to be preloaded, or for data to be read out after the R5F has processed it. The VBUSM peripheral has a lower priority to accessing TCMs than the R5F but care must be taken to keep an external source from reading or writing TCM data that the R5F is working on. This handshaking is external to any of the R5FSS hardware.
TCMs are protected by ECC per 32 bits. For this to work, ECC must be enabled before data is written in to the TCMs (either externally or from the R5F). ECC is enabled via the following R5F system control bits: ACTLR.ATCMPCEN, ACTLR.B0TCMPCEN, and ACTLR.B1TCMPCEN, respectively.
Whether or not the TCMs are enabled is controlled by the ENABLE bit in the corresponding ATCM/BTCM region register. The default (reset) value of this bit is determined by the CPUn_INITRAMA and CPUn_INITRAMB bootstrap signals having a default value of 1 in this device. ATCM is configured for a size of 32KB and BTCM is configured for a size of 32KB in this device. Note that the BTCM size is the total of both B0TCM and B1TCM (16KB each). Note also that the ATCM size for CPU0 is 64KB and the BTCM size for CPU0 is 64KB each in Lockstep mode.
If a TCM is not enabled, then it does not appear in the R5F’s memory view, but it can be accessed by an external source. If a TCM is enabled, then its place in the R5F memory map is determined by a combination of bootstrap signal and system register. The base address of ATCM is 0x0000_0000 and the base address of BTCM is 0x0008_0000.
It is possible to preload a TCM with instructions and boot from it. See R5FSS Boot Options for details on TCM booting.