Skip to content

Commit 87a5b41

Browse files
IM880B: update ARM settings
1 parent b3e4e4c commit 87a5b41

File tree

3 files changed

+47
-35
lines changed

3 files changed

+47
-35
lines changed

targets/TARGET_STM/TARGET_STM32L1/TARGET_IM880B/device/TOOLCHAIN_ARM_MICRO/startup_stm32l151xba.S

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -41,36 +41,9 @@
4141
;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4242
;
4343
;*******************************************************************************
44-
;
45-
; Amount of memory (in bytes) allocated for Stack
46-
; Tailor this value to your application needs
47-
; <h> Stack Configuration
48-
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
49-
; </h>
50-
51-
Stack_Size EQU 0x00000400
5244

53-
AREA STACK, NOINIT, READWRITE, ALIGN=3
54-
EXPORT __initial_sp
55-
56-
Stack_Mem SPACE Stack_Size
5745
__initial_sp EQU 0x20008000 ; Top of RAM (32 KB)
5846

59-
60-
; <h> Heap Configuration
61-
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
62-
; </h>
63-
64-
Heap_Size EQU 0x00000200
65-
66-
AREA HEAP, NOINIT, READWRITE, ALIGN=3
67-
EXPORT __heap_base
68-
EXPORT __heap_limit
69-
70-
__heap_base
71-
Heap_Mem SPACE Heap_Size
72-
__heap_limit EQU (__initial_sp - Stack_Size)
73-
7447
PRESERVE8
7548
THUMB
7649

targets/TARGET_STM/TARGET_STM32L1/TARGET_IM880B/device/TOOLCHAIN_ARM_MICRO/stm32l151cba.sct

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#! armcc -E
12
; Scatter-Loading Description File
23
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
34
; Copyright (c) 2015, STMicroelectronics
@@ -27,19 +28,49 @@
2728
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2829
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2930

30-
; STM32L151CB: 128KB FLASH + 32KB SRAM
31-
LR_IROM1 0x08000000 0x20000 { ; load region size_region
31+
#if !defined(MBED_APP_START)
32+
#define MBED_APP_START 0x08000000
33+
#endif
3234

33-
ER_IROM1 0x08000000 0x20000 { ; load address = execution address
35+
; STM32L151CB: 128KB FLASH
36+
#if !defined(MBED_APP_SIZE)
37+
#define MBED_APP_SIZE 0x20000
38+
#endif
39+
40+
; 32KB SRAM
41+
#if !defined(MBED_RAM_START)
42+
#define MBED_RAM_START 0x20000000
43+
#endif
44+
45+
#if !defined(MBED_RAM_SIZE)
46+
#define MBED_RAM_SIZE 0x8000
47+
#endif
48+
49+
50+
#if !defined(MBED_BOOT_STACK_SIZE)
51+
#define MBED_BOOT_STACK_SIZE 0x400
52+
#endif
53+
54+
; 61 vectors = 244 bytes (0xF4) 8-byte aligned = 0xF8 (0xF4 + 0x4) to be reserved in RAM
55+
#define VECTOR_SIZE 0xF8
56+
57+
#define RAM_FIXED_SIZE (MBED_BOOT_STACK_SIZE+VECTOR_SIZE)
58+
59+
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
60+
61+
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
3462
*.o (RESET, +First)
3563
*(InRoot$$Sections)
3664
.ANY (+RO)
3765
}
3866

39-
; 61 vectors = 244 bytes (0xF4) 8-byte aligned = 0xF8 (0xF4 + 0x4) to be reserved in RAM
40-
RW_IRAM1 (0x20000000+0xF8) (0x8000-0xF8) { ; RW data
67+
RW_IRAM1 (MBED_RAM_START+VECTOR_SIZE) (MBED_RAM_SIZE-VECTOR_SIZE) { ; RW data
4168
.ANY (+RW +ZI)
4269
}
4370

44-
}
71+
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE-RAM_FIXED_SIZE+MBED_RAM_START-AlignExpr(ImageLimit(RW_IRAM1), 16)) {
72+
}
4573

74+
ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -MBED_BOOT_STACK_SIZE { ; stack
75+
}
76+
}

targets/TARGET_STM/TARGET_STM32L1/TARGET_IM880B/device/TOOLCHAIN_ARM_STD/stm32l151cba.sct

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#! armcc -E
12
; Scatter-Loading Description File
23
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
34
; Copyright (c) 2015, STMicroelectronics
@@ -27,6 +28,12 @@
2728
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2829
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2930

31+
#if !defined(MBED_BOOT_STACK_SIZE)
32+
#define MBED_BOOT_STACK_SIZE 0x400
33+
#endif
34+
35+
#define Stack_Size MBED_BOOT_STACK_SIZE
36+
3037
; STM32L151CB: 128KB FLASH + 32KB SRAM
3138
LR_IROM1 0x08000000 0x20000 { ; load region size_region
3239

@@ -37,9 +44,10 @@ LR_IROM1 0x08000000 0x20000 { ; load region size_region
3744
}
3845

3946
; 61 vectors = 244 bytes (0xF4) 8-byte aligned = 0xF8 (0xF4 + 0x4) to be reserved in RAM
40-
RW_IRAM1 (0x20000000+0xF8) (0x8000-0xF8) { ; RW data
47+
RW_IRAM1 (0x20000000+0xF8) (0x8000-0xF8-Stack_Size) { ; RW data
4148
.ANY (+RW +ZI)
4249
}
43-
50+
ARM_LIB_STACK (0x20000000+0x8000) EMPTY -Stack_Size { ; stack
51+
}
4452
}
4553

0 commit comments

Comments
 (0)