Skip to content

Commit c06368a

Browse files
Merge pull request #5171 from jeromecoutant/PR_L432_RAM
STM32L432KC: increase RAM size from 48k to 64k
2 parents 6cb0258 + 8b0ee27 commit c06368a

File tree

8 files changed

+13
-27
lines changed

8 files changed

+13
-27
lines changed

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L432xC/device/TOOLCHAIN_ARM_MICRO/startup_stm32l432xx.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@
4242
AREA STACK, NOINIT, READWRITE, ALIGN=3
4343
EXPORT __initial_sp
4444

45-
__initial_sp EQU 0x2000C000 ; Top of RAM, L4-ECC-SRAM2 retained in standby
45+
__initial_sp EQU 0x20010000 ; Top of RAM
4646

4747
; <h> Heap Configuration
4848
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
4949
; </h>
5050

51-
Heap_Size EQU 0x0BA00 ; 46KB (48KB, -2*1KB for main thread and scheduler)
51+
Heap_Size EQU 0x0F800 ; 62KB (64KB, -2*1KB for main thread and scheduler)
5252

5353
AREA HEAP, NOINIT, READWRITE, ALIGN=3
5454
EXPORT __heap_base

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L432xC/device/TOOLCHAIN_ARM_MICRO/stm32l432xx.sct

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,8 @@ LR_IROM1 0x08000000 0x40000 { ; load region size_region
3636
.ANY (+RO)
3737
}
3838

39-
RW_IRAM1 0x20000000 0x0000C000 { ; RW data 48k L4-SRAM1
40-
.ANY (+RW +ZI)
41-
}
42-
4339
; Total: 98 vectors = 392 bytes (0x188) to be reserved in RAM
44-
RW_IRAM2 (0x10000000+0x188) (0x04000-0x188) { ; RW data 16k L4-ECC-SRAM2 retained in standby
40+
RW_IRAM1 (0x20000000+0x188) (0x00010000-0x188) {
4541
.ANY (+RW +ZI)
4642
}
4743

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L432xC/device/TOOLCHAIN_ARM_STD/startup_stm32l432xx.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
;*
4040
;*******************************************************************************
4141

42-
__initial_sp EQU 0x2000C000 ; Top of RAM, L4-ECC-SRAM2 retained in standby
42+
__initial_sp EQU 0x20010000 ; Top of RAM
4343

4444
PRESERVE8
4545
THUMB

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L432xC/device/TOOLCHAIN_ARM_STD/stm32l432xx.sct

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,9 @@ LR_IROM1 0x08000000 0x40000 { ; load region size_region
3636
.ANY (+RO)
3737
}
3838

39-
RW_IRAM1 0x20000000 0x0000C000 { ; RW data 48k L4-SRAM1
40-
.ANY (+RW +ZI)
41-
}
42-
4339
; Total: 98 vectors = 392 bytes (0x188) to be reserved in RAM
44-
RW_IRAM2 (0x10000000+0x188) (0x04000-0x188) { ; RW data 16k L4-ECC-SRAM2 retained in standby
45-
.ANY (+RW +ZI)
40+
RW_IRAM1 (0x20000000+0x188) (0x00010000-0x188) {
41+
.ANY (+RW +ZI)
4642
}
4743

4844
}

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L432xC/device/TOOLCHAIN_GCC_ARM/STM32L432XX.ld

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
MEMORY
33
{
44
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 256K
5-
SRAM2 (rwx) : ORIGIN = 0x10000188, LENGTH = 16k - 0x188
6-
SRAM1 (rwx) : ORIGIN = 0x20000000, LENGTH = 48k
5+
SRAM1 (rwx) : ORIGIN = 0x20000188, LENGTH = 64k - 0x188
76
}
87

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

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L432xC/device/TOOLCHAIN_IAR/stm32l432xx.icf

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,16 @@ define symbol __region_ROM_end__ = 0x0803FFFF;
55

66
/* [RAM = 48kb + 16kb = 0xC000] */
77
/* Vector table dynamic copy: Total: 98 vectors = 392 bytes (0x188) to be reserved in RAM */
8-
define symbol __NVIC_start__ = 0x10000000;
9-
define symbol __NVIC_end__ = 0x10000187; /* Aligned on 8 bytes (392 = 49 x 8) */
10-
define symbol __region_SRAM2_start__ = 0x10000188;
11-
define symbol __region_SRAM2_end__ = 0x10003FFF;
12-
define symbol __region_SRAM1_start__ = 0x20000000;
13-
define symbol __region_SRAM1_end__ = 0x2000BFFF;
8+
define symbol __NVIC_start__ = 0x20000000;
9+
define symbol __NVIC_end__ = 0x20000187; /* Aligned on 8 bytes (392 = 49 x 8) */
10+
define symbol __region_SRAM1_start__ = 0x20000188;
11+
define symbol __region_SRAM1_end__ = 0x2000FFFF;
1412

1513
/* Memory regions */
1614
define memory mem with size = 4G;
1715
define region ROM_region = mem:[from __region_ROM_start__ to __region_ROM_end__];
18-
define region SRAM2_region = mem:[from __region_SRAM2_start__ to __region_SRAM2_end__];
1916
define region SRAM1_region = mem:[from __region_SRAM1_start__ to __region_SRAM1_end__];
2017

21-
/* Stack 1/8 and Heap 1/4 of RAM */
2218
define symbol __size_cstack__ = 0x2000;
2319
define symbol __size_heap__ = 0x4000;
2420
define block CSTACK with alignment = 8, size = __size_cstack__ { };
@@ -32,4 +28,3 @@ place at address mem:__intvec_start__ { readonly section .intvec };
3228

3329
place in ROM_region { readonly };
3430
place in SRAM1_region { readwrite, block STACKHEAP };
35-
place in SRAM2_region { };

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L432xC/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: 82 vectors = 328 bytes from 0x40 to 0x187
3636
// Total: 98 vectors = 392 bytes (0x188) to be reserved in RAM
3737
#define NVIC_NUM_VECTORS 98
38-
#define NVIC_RAM_VECTOR_ADDRESS 0x10000000 // Vectors positioned at start of SRAM2
38+
#define NVIC_RAM_VECTOR_ADDRESS SRAM1_BASE // Vectors positioned at start of SRAM1
3939

4040
#endif

targets/TARGET_STM/mbed_rtx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
#define INITIAL_SP (0x2000A000UL)
5454

5555
#elif defined(TARGET_STM32L432KC)
56-
#define INITIAL_SP (0x2000C000UL)
56+
#define INITIAL_SP (0x20010000UL)
5757

5858
#elif (defined(TARGET_STM32F303RE) ||\
5959
defined(TARGET_STM32F303ZE) ||\

0 commit comments

Comments
 (0)