Skip to content

Commit 594398e

Browse files
committed
NUCLEO_H743ZI: use DTCM RAM @0x20000000
1 parent 0772f93 commit 594398e

File tree

6 files changed

+27
-29
lines changed

6 files changed

+27
-29
lines changed

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H743xI/device/TOOLCHAIN_ARM_MICRO/stm32h743xI.sct

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2929

30-
; STM32H743ZI: 2MB FLASH (0x200000) + 512 KB SRAM (0x80000) @ 0x24000000
30+
; 2MB FLASH (0x200000)
3131
LR_IROM1 0x08000000 0x200000 { ; load region size_region
3232

3333
ER_IROM1 0x08000000 0x200000 { ; load address = execution address
@@ -36,10 +36,10 @@ LR_IROM1 0x08000000 0x200000 { ; load region size_region
3636
.ANY (+RO)
3737
}
3838

39-
; Total: 166 vectors = 664 bytes (0x298) to be reserved in RAM
40-
RW_IRAM1 (0x24000000+0x298) (0x80000-0x298) { ; RW data
39+
; 128KB DTCM RAM (0x20000)
40+
; 166 vectors = 664 bytes (0x298) to be reserved in RAM
41+
RW_IRAM1 (0x20000000+0x298) (0x20000-0x298) { ; RW data
4142
.ANY (+RW +ZI)
4243
}
4344

4445
}
45-

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H743xI/device/TOOLCHAIN_ARM_STD/stm32h743xI.sct

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2929

30-
; STM32H743ZI: 2MB FLASH (0x200000) + 512 KB SRAM (0x80000) @ 0x24000000
30+
; 2MB FLASH (0x200000)
3131
LR_IROM1 0x08000000 0x200000 { ; load region size_region
3232

3333
ER_IROM1 0x08000000 0x200000 { ; load address = execution address
@@ -36,10 +36,10 @@ LR_IROM1 0x08000000 0x200000 { ; load region size_region
3636
.ANY (+RO)
3737
}
3838

39-
; Total: 166 vectors = 664 bytes (0x298) to be reserved in RAM
40-
RW_IRAM1 (0x24000000+0x298) (0x80000-0x298) { ; RW data
39+
; 128KB DTCM RAM (0x20000)
40+
; 166 vectors = 664 bytes (0x298) to be reserved in RAM
41+
RW_IRAM1 (0x20000000+0x298) (0x20000-0x298) { ; RW data
4142
.ANY (+RW +ZI)
4243
}
4344

4445
}
45-

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H743xI/device/TOOLCHAIN_GCC_ARM/STM32H743xI.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
MEMORY
33
{
44
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K
5-
RAM (rwx) : ORIGIN = 0x24000298, LENGTH = 512K - 0x298
5+
RAM (rwx) : ORIGIN = 0x20000298, LENGTH = 128K - 0x298
66
}
77

88
/* Linker script to place sections and symbol values. Should be used together

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H743xI/device/TOOLCHAIN_IAR/stm32h743xI.icf

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
/* [ROM = 2Mb = 0x200000] */
2-
define symbol __intvec_start__ = 0x08000000;
3-
define symbol __region_ROM_start__ = 0x08000000;
4-
define symbol __region_ROM_end__ = 0x08000000 + 0x200000 - 1;
1+
// 2MB FLASH (0x200000)
2+
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x08000000; }
3+
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x200000; }
4+
define symbol __intvec_start__ = MBED_APP_START;
5+
define symbol __region_ROM_start__ = MBED_APP_START;
6+
define symbol __region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
57

6-
/* [RAM = 512kb = 0x80000] Vector table dynamic copy: 166 vectors = 664 bytes (0x298) to be reserved in RAM */
7-
define symbol __NVIC_start__ = 0x24000000;
8-
define symbol __NVIC_end__ = 0x24000000 + 0x298 - 1;
9-
define symbol __region_RAM_start__ = 0x24000000 + 0x298; /* Aligned on 8 bytes */
10-
define symbol __region_RAM_end__ = 0x24000000 + 0x80000 - 1;
8+
// 128KB DTCM RAM (0x20000)
9+
// Vector table dynamic copy: 166 vectors = 664 bytes (0x298) to be reserved in RAM
10+
define symbol __region_RAM_start__ = 0x20000000 + 0x298; // Aligned on 8 bytes
11+
define symbol __region_RAM_end__ = 0x20000000 + 0x20000 - 1;
1112

12-
/* Memory regions */
13+
// Memory regions
1314
define memory mem with size = 4G;
1415
define region ROM_region = mem:[from __region_ROM_start__ to __region_ROM_end__];
1516
define region RAM_region = mem:[from __region_RAM_start__ to __region_RAM_end__];
1617

17-
/* Stack and Heap */
18-
define symbol __size_cstack__ = 0x8000;
19-
define symbol __size_heap__ = 0x10000;
18+
// Stack and Heap
19+
define symbol __size_cstack__ = 0x400; // 1KB
20+
define symbol __size_heap__ = 0x10000; // 64KB
2021
define block CSTACK with alignment = 8, size = __size_cstack__ { };
2122
define block HEAP with alignment = 8, size = __size_heap__ { };
2223
define block STACKHEAP with fixed order { block HEAP, block CSTACK };

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H743xI/device/cmsis_nvic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@
3535
// MCU Peripherals: 150 vectors = 600 bytes from 0x40 to 0x297
3636
// Total: 166 vectors = 664 bytes (0x298) to be reserved in RAM
3737
#define NVIC_NUM_VECTORS 166
38-
#define NVIC_RAM_VECTOR_ADDRESS 0x24000000 // Vectors positioned at start of RAM
38+
#define NVIC_RAM_VECTOR_ADDRESS 0x20000000 // Vectors positioned at start of DTCM RAM
3939

4040
#endif

targets/TARGET_STM/mbed_rtx.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@
9595
defined(TARGET_STM32F411RE) ||\
9696
defined(TARGET_STM32F446RE) ||\
9797
defined(TARGET_STM32F446VE) ||\
98-
defined(TARGET_STM32F446ZE))
98+
defined(TARGET_STM32F446ZE) ||\
99+
defined(TARGET_STM32H743ZI) ||\
100+
defined(TARGET_STM32H753ZI))
99101
#define INITIAL_SP (0x20020000UL)
100102

101103
#elif (defined(TARGET_STM32F429ZI) ||\
@@ -120,11 +122,6 @@
120122
defined(TARGET_STM32F769NI))
121123
#define INITIAL_SP (0x20080000UL)
122124

123-
#elif (defined(TARGET_STM32H743ZI) ||\
124-
defined(TARGET_STM32H753ZI))
125-
#define INITIAL_SP (0x24080000UL)
126-
127-
128125
#else
129126
#error "INITIAL_SP is not defined for this target in the mbed_rtx.h file"
130127
#endif

0 commit comments

Comments
 (0)