링커 스크립트를 보면 아래와 같이 메모리가 희한하게 많다.
| /* Memories definition */ MEMORY { RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512K BOOT (rx) : ORIGIN = 0x08000000, LENGTH = 128K DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K } |
아무래도 M7 에는 TCM 으로 바로 붙어 있어서 가장 빠르게 접근이 될 거고
M4의 경우 AHB 를 거쳐야 해서 M7의 TCM 보다는 접근 속도가 느릴듯 하다.
D1 domain 에는 Cortex-M7에 붙어있는 ITCM 64K / DTCM 128K(TCM - Tightly Coupled Memory)
D2 domain 에는 Cortex-M4에 가까운 SRAM1 128K(I-bus) / SRAM2 128K(D-bus) / SRAM3 32K(S-bus)가 존재한다.
D3 domain 에는 SRAM4 64K / Backup SRAM 4K 가 존재한다.(얘네는 링커에 없다)
| 3.3.3 Embedded SRAM All devices feature around 1 Mbyte of RAM with hardware ECC. The RAM is divided as follows: • 512 Kbytes of AXI-SRAM mapped onto AXI bus on D1 domain. • SRAM1 mapped on D2 domain: 128 Kbytes • SRAM2 mapped on D2 domain: 128 Kbytes • SRAM3 mapped on D2 domain: 32 Kbytes • SRAM4 mapped on D3 domain: 64 Kbytes • 4 Kbytes of backup SRAM The content of this area is protected against possible unwanted write accesses, and is retained in Standby or VBAT mode. • RAM mapped to TCM interface (ITCM and DTCM): Both ITCM and DTCM RAMs are 0 wait state memories. They can be accessed either from the Arm® Cortex®-M7 CPU or the MDMA (even in Sleep mode) through a specific AHB slave of the Cortex®-M7(AHBS): – 64 Kbytes of ITCM-RAM (instruction RAM) This RAM is connected to ITCM 64-bit interface designed for execution of critical real-times routines by the Cortex®-M7. – 128 Kbytes of DTCM-RAM (2x 64-Kbyte DTCM-RAMs on 2x32-bit DTCM ports) The DTCM-RAM could be used for critical real-time data, such as interrupt service routines or stack/heap memory. Both DTCM-RAMs can be used in parallel (for load/store operations) thanks to the Cortex®-M7 dual issue capability. The MDMA can be used to load code or data in ITCM or DTCM RAMs. ![]() |
[링크 : https://www.st.com/resource/en/datasheet/stm32h757ai.pdf]
M4가 M7 보다 메모리 어드레스 비트가 낮은가? 아무튼 아래와 같이 연결이 된다고 한다.
| cortex-M7 | cortex-M4 | |
| AXI SRAM | 0x2400 0000 | ? |
| SRAM1 | 0x3000 0000 | 0x1000 0000 |
| SRAM2 | 0x3002 0000 | 0x1002 0000 |
| SRAM3 | 0x3004 0000 | 0x1004 0000 |
| SRAM4 | 0x3800 0000 | ? |
| 2.2.1 Embedded SRAM The STM32H7 dual‑core devices feature: • Up to 864 Kbytes of System SRAM • 128 Kbytes of data TCM RAM, DTCM RAM • 64 Kbytes of instruction TCM RAM, ITCM RAM • 4 Kbytes of backup SRAM The embedded system SRAM is split into five blocks over the three power domains: AXI SRAM, AHB SRAM1, AHB SRAM2, AHB SRAM3 and AHB SRAM4. • D1 domain, AXI SRAM: – AXI SRAM is accessible through D1 domain AXI bus matrix. It is mapped at address 0x2400 0000 and accessible by all system masters except BDMA. AXI SRAM can be used for application data which are not allocated in DTCM RAM or reserved for graphic objects (such as frame buffers) • D2 domain, AHB SRAM: – AHB SRAM1 is accessible through D2 domain AHB matrix. It is mapped at address 0x3000 0000 and accessible by all system masters except BDMA. The AHB SRAMs of the D2 domain are also aliased to an address range below 0x2000 0000 to maintain the Cortex®‑M4 Harvard architecture. The AHB SRAM1 also mapped at address 0x1000 0000. The AHB SRAM2 also mapped at address 0x1002 0000. The AHB SRAM3 also mapped at address 0x1004 0000. All those AHB SRAMs are accessible by all system masters through D2 domain AHB matrix. All those AHB SRAMs are accessible by all system masters through D2 domain AHB matrix. AHB SRAM1 can be used as DMA buffers to store peripheral input/output data in D2 domain, or as code location for Cortex®‑M4 CPU (application code available when D1 is powered off). AHB SRAM1 can be used as DMA buffers to store peripheral input/output data in D2 domain, or as code location for Cortex®‑M4 CPU (application code available when D1 is powered off). – AHB SRAM2 is accessible through D2 domain AHB matrix. It is mapped at address 0x3002 0000 and accessible by all system masters except BDMA. AHB SRAM2 can be used as DMA buffers to store peripheral input/output data in D2 domain, or as readwrite segment for application running on Cortex®‑M4 CPU. – AHB SRAM3 is accessible through D2 domain AHB matrix is mapped at address 0x3004 0000 and accessible by all system masters except BDMA. AHB SRAM3 can be used as buffers to store peripheral input/output data for Ethernet and USB, or as shared memory between the two cores. • D3 domain, AHB SRAM: – AHB SRAM4 is mapped at address 0x3800 0000 and accessible by most of system masters through D3 domain AHB matrix. AHB SRAM4 can be used as BDMA buffers to store peripheral input/output data in D3 domain. It can also be used to retain some application code/data when D1 and D2 domain in DStandby mode, or as shared memory between the two cores. The system AHB SRAM can be accessed as bytes, half‑words (16‑bit units) or words (32‑bit units), while the system AXI SRAM can be accessed as bytes, half‑words, words or doublewords (64‑bit units). These memories can be addressed at maximum system clock frequency without wait state. |
'embeded > Cortex-M7 STM' 카테고리의 다른 글
| stm32h757 링커 스크립트 (0) | 2026.03.13 |
|---|---|
| stm32f7 dual bank flash (0) | 2026.02.03 |
| stm32f746g-disco with semtech sx1276 and lvgl (0) | 2026.02.03 |
| modbus rtu coil read (0) | 2024.10.10 |
| stm32 __weak (0) | 2024.10.08 |

