Search code examples
armstm32cortex-mstm32f7

What is the difference between data, instruction, and flash CCM RAM on the STM32


Page 14 of this STM32F7 architecture overview document shows memory addresses for:

  • FLASH-ITCM (unkown size on the F730 I'm using)
  • DTCM-RAM (64KB)
  • ITCM-RAM (16KB)

What is the difference between these? A lot of examples show data going into DTCM. Where are things like a stack or critical function best suited?

Is there any benefit to using the flash ITCM interface over the ART accelerator?


Solution

  • The difference between DTCM and ITCM is which bus they're attached to, the DTCM is on the D bus so used for data, this is the ideal place to store your stack, the ITCM is on the I bus so used for fetching instructions (code), this is a good place to store your critical routines.

    The ART accelerator is between the Flash and the ITCM, so it's not an either or. It's advantageous to use the flash via ITCM for code as that way you do get acceleration whereas through the AHB bus you don't. All the flash is available via either the ITCM interface, or the AHB bus, depending on which address you use; 0x0020 0000 to 0x0027 FFFF is via the ITCM, 0x0800 0000 to 0x0807 FFFF via AHB, both sets of addresses are pointing to the same area of flash.