TCM、ITCM、DTCM

TCM

TCM=Tightly Coupled Memory, is a kind of high-speed cache, which is said to be directly integrated in the CPU chip. DS has two TCMs, ITCM (Instruction TCM) and DTCM (Data TCM).

Notice:

  • 1. In the memory support list, in the memory detailed parameters, SS refers to single-sided memory, and DS refers to double-sided memory. The memory has two sides. According to the total memory capacity and the storage capacity of the memory chip, memory manufacturers will produce double-sided memory and single-sided memory, that is, both sides of the memory have memory chips, or only one side has memory chips. There is a certain difference in compatibility between single-sided and double-sided memory, so it will be listed separately.

  • 2. ITCM is the instruction transmission bus in the cortex core, and DTCM is the data transmission bus in the cortex core. It is the
    channel for transmitting instructions and data between the cpu core and flash and sram.

Because it is a cache, these two memory areas are used as special purposes. For example, some codes with very strict time requirements can be put into ITCM for execution. This can effectively increase the running speed. Certain data that requires frequent access can also be placed in DTCM to save access time.

How to put the code into ITCM? There are two methods. One is to use gcc's unique "attribute label" to assign the specified code to the "ITCM" attribute, and the code will be loaded into ITCM for execution. Another method is to directly change the .c source file to .itcm.c. At this time, the source file will be directly compiled into an object file running in ITCM.

And DTCM is much more convenient. Although both TCMs are mappable, that is, their addresses are not fixed, they are generally mapped to fixed addresses respectively. Now that you have a fixed address, you can easily access it. However, as mentioned earlier, these two memory spaces are for special purposes, so direct access is not recommended. DTCM is more important than ITCM. Because in this memory, there is a very important object-the stack. Local variables and parameters of function calls are passed on the stack. Since the DMA cannot access the TCM, it cannot access the stack. And because local variables are allocated to the stack, DMA cannot transfer local variables.

summary

  • 1. In the memory support list, in the memory detailed parameters, SS refers to single-sided memory, and DS refers to double-sided memory.
      The memory has two sides. According to the total memory capacity and the storage capacity of the memory chip, memory manufacturers will produce double-sided memory and single-sided memory, that is, both sides of the memory have memory chips, or only one side has memory chips.
      There is a certain difference in compatibility between single-sided and double-sided memory, so it will be listed separately.

  • 2. ITCM is the instruction transmission bus in the cortex core, and DTCM is the data transmission bus in the cortex core, which is the channel for transmitting instructions and data between the cpu core and flash and sram. Instruction fetching and execution and data reading and writing are different in performance and management, so they need to be distinguished.

  • ITCM
    ITCM is the abbreviation of Instruction Tightly-Coupled Memory, translated as instruction tightly coupled memory. The so-called tight coupling means that the memory is closely connected to the core and has a very high access speed, while "instruction" means that the memory is dedicated to caching instructions.

  • DTCM is
    the abbreviation of Data Tightly-Coupled Memory, translated as data tightly coupled memory. It is similar to ITCM and has extremely high access speed, but it is specially used to store program data, that is, the storage location of variables in the code.

  • OCRAM
    On-chip RAM, that is, on-chip memory, can be completely understood as the internal SRAM of a traditional MCU. It has no special restrictions like ITCM and DTCM, and can be used to store instructions and data (general purpose).

references

  • https://blog.csdn.net/weibo1230123/article/details/83443326
  • https://www.cnblogs.com/slowby/p/16085481.html

Guess you like

Origin blog.csdn.net/weixin_45264425/article/details/131820469