Skip to content

Commit 47db661

Browse files
committed
Updated ARM linker scripts for Kinetis platforms that use SDK 2.0
1. Fix Heap start address 2. Update to the latest script provided by the Kinetis SDK team Signed-off-by: Mahadevan Mahesh <[email protected]>
1 parent 65ffa8c commit 47db661

File tree

5 files changed

+98
-24
lines changed

5 files changed

+98
-24
lines changed

hal/targets/cmsis/TARGET_Freescale/TARGET_K22F/TOOLCHAIN_ARM_STD/MK22FN512xxx12.sct

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@
33
** ###################################################################
44
** Processors: MK22FN512CAP12
55
** MK22FN512VDC12
6+
** MK22FN512VFX12
67
** MK22FN512VLH12
78
** MK22FN512VLL12
89
** MK22FN512VMP12
910
**
1011
** Compiler: Keil ARM C/C++ Compiler
1112
** Reference manual: K22P121M120SF7RM, Rev. 1, March 24, 2014
12-
** Version: rev. 2.8, 2015-02-19
13-
** Build: b151009
13+
** Version: rev. 2.9, 2016-03-21
14+
** Build: b160406
1415
**
1516
** Abstract:
1617
** Linker file for the Keil ARM C/C++ Compiler
1718
**
18-
** Copyright (c) 2015 Freescale Semiconductor, Inc.
19+
** Copyright (c) 2016 Freescale Semiconductor, Inc.
1920
** All rights reserved.
2021
**
2122
** Redistribution and use in source and binary forms, with or without modification,
@@ -50,6 +51,10 @@
5051
*/
5152
#define __ram_vector_table__ 1
5253

54+
/* Heap 1/4 of ram and stack 1/8 */
55+
#define __stack_size__ 0x4000
56+
#define __heap_size__ 0x8000
57+
5358
#if (defined(__ram_vector_table__))
5459
#define __ram_vector_table_size__ 0x00000400
5560
#else
@@ -74,25 +79,45 @@
7479
#define m_data_2_start 0x20000000
7580
#define m_data_2_size 0x00010000
7681

82+
/* Sizes */
83+
#if (defined(__stack_size__))
84+
#define Stack_Size __stack_size__
85+
#else
86+
#define Stack_Size 0x0400
87+
#endif
7788

78-
LR_m_text m_interrupts_start m_text_size+m_interrupts_size+m_flash_config_size { ; load region size_region
89+
#if (defined(__heap_size__))
90+
#define Heap_Size __heap_size__
91+
#else
92+
#define Heap_Size 0x0400
93+
#endif
94+
95+
LR_m_text m_interrupts_start m_text_start+m_text_size-m_interrupts_start { ; load region size_region
7996
VECTOR_ROM m_interrupts_start m_interrupts_size { ; load address = execution address
8097
* (RESET,+FIRST)
8198
}
82-
ER_m_flash_config m_flash_config_start m_flash_config_size { ; load address = execution address
99+
ER_m_flash_config m_flash_config_start FIXED m_flash_config_size { ; load address = execution address
83100
* (FlashConfig)
84101
}
85102
ER_m_text m_text_start m_text_size { ; load address = execution address
86103
* (InRoot$$Sections)
87104
.ANY (+RO)
88105
}
106+
107+
#if (defined(__ram_vector_table__))
108+
VECTOR_RAM m_interrupts_ram_start EMPTY m_interrupts_ram_size {
109+
}
110+
#else
111+
VECTOR_RAM m_interrupts_start EMPTY 0 {
112+
}
113+
#endif
89114
RW_m_data m_data_start m_data_size { ; RW data
90115
.ANY (+RW +ZI)
91116
}
92-
RW_IRAM1 m_data_2_start m_data_2_size { ; RW data
117+
RW_m_data_2 m_data_2_start m_data_2_size-Stack_Size-Heap_Size { ; RW data
93118
.ANY (+RW +ZI)
94119
}
95-
VECTOR_RAM m_interrupts_ram_start EMPTY m_interrupts_ram_size {
120+
RW_IRAM1 ImageLimit(RW_m_data_2) { ; Heap region growing up
96121
}
97122
}
98123

hal/targets/cmsis/TARGET_Freescale/TARGET_K66F/TOOLCHAIN_ARM_STD/MK66FN2M0xxx18.sct

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
** Compiler: Keil ARM C/C++ Compiler
88
** Reference manual: K66P144M180SF5RMV2, Rev. 1, Mar 2015
99
** Version: rev. 3.0, 2015-03-25
10-
** Build: b151009
10+
** Build: b160406
1111
**
1212
** Abstract:
1313
** Linker file for the Keil ARM C/C++ Compiler
1414
**
15-
** Copyright (c) 2015 Freescale Semiconductor, Inc.
15+
** Copyright (c) 2016 Freescale Semiconductor, Inc.
1616
** All rights reserved.
1717
**
1818
** Redistribution and use in source and binary forms, with or without modification,
@@ -47,6 +47,10 @@
4747
*/
4848
#define __ram_vector_table__ 1
4949

50+
/* Heap 1/4 of ram and stack 1/8 */
51+
#define __stack_size__ 0x8000
52+
#define __heap_size__ 0x10000
53+
5054
#if (defined(__ram_vector_table__))
5155
#define __ram_vector_table_size__ 0x00000400
5256
#else
@@ -71,24 +75,44 @@
7175
#define m_data_2_start 0x20000000
7276
#define m_data_2_size 0x00030000
7377

78+
/* Sizes */
79+
#if (defined(__stack_size__))
80+
#define Stack_Size __stack_size__
81+
#else
82+
#define Stack_Size 0x0400
83+
#endif
84+
85+
#if (defined(__heap_size__))
86+
#define Heap_Size __heap_size__
87+
#else
88+
#define Heap_Size 0x0400
89+
#endif
7490

75-
LR_m_text m_interrupts_start m_text_size+m_interrupts_size+m_flash_config_size { ; load region size_region
91+
LR_m_text m_interrupts_start m_text_start+m_text_size-m_interrupts_start { ; load region size_region
7692
VECTOR_ROM m_interrupts_start m_interrupts_size { ; load address = execution address
7793
* (RESET,+FIRST)
7894
}
79-
ER_m_flash_config m_flash_config_start m_flash_config_size { ; load address = execution address
95+
ER_m_flash_config m_flash_config_start FIXED m_flash_config_size { ; load address = execution address
8096
* (FlashConfig)
8197
}
8298
ER_m_text m_text_start m_text_size { ; load address = execution address
8399
* (InRoot$$Sections)
84100
.ANY (+RO)
85101
}
102+
103+
#if (defined(__ram_vector_table__))
104+
VECTOR_RAM m_interrupts_ram_start EMPTY m_interrupts_ram_size {
105+
}
106+
#else
107+
VECTOR_RAM m_interrupts_start EMPTY 0 {
108+
}
109+
#endif
86110
RW_m_data m_data_start m_data_size { ; RW data
87111
.ANY (+RW +ZI)
88112
}
89-
RW_IRAM1 m_data_2_start m_data_2_size { ; RW data
113+
RW_m_data_2 m_data_2_start m_data_2_size-Stack_Size-Heap_Size { ; RW data
90114
.ANY (+RW +ZI)
91115
}
92-
VECTOR_RAM m_interrupts_ram_start EMPTY m_interrupts_ram_size {
116+
RW_IRAM1 ImageLimit(RW_m_data_2) { ; Heap region growing up
93117
}
94-
}
118+
}

hal/targets/cmsis/TARGET_Freescale/TARGET_KL27Z/TOOLCHAIN_ARM_STD/MKL27Z64xxx4.sct

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ LR_m_text m_interrupts_start m_text_start+m_text_size-m_interrupts_start { ; l
110110
RW_m_data m_data_start m_data_size-Stack_Size-Heap_Size { ; RW data
111111
.ANY (+RW +ZI)
112112
}
113-
RW_IRAM1 +0 EMPTY Heap_Size { ; RW data
113+
RW_IRAM1 +0 { ; Heap region growing up
114114
}
115115
}
116116

hal/targets/cmsis/TARGET_Freescale/TARGET_KL43Z/TOOLCHAIN_ARM_STD/MKL43Z256xxx4.sct

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ LR_m_text m_interrupts_start m_text_start+m_text_size-m_interrupts_start { ; loa
107107
RW_m_data m_data_start m_data_size-Stack_Size-Heap_Size { ; RW data
108108
.ANY (+RW +ZI)
109109
}
110-
RW_IRAM1 +0 EMPTY Heap_Size { ; Heap region growing up
110+
RW_IRAM1 +0 { ; Heap region growing up
111111
}
112112
}
113113

hal/targets/cmsis/TARGET_Freescale/TARGET_MCU_K64F/TOOLCHAIN_ARM_STD/MK64FN1M0xxx12.sct

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
#! armcc -E
22
/*
33
** ###################################################################
4-
** Processors: MK64FN1M0VDC12
4+
** Processors: MK64FN1M0CAJ12
5+
** MK64FN1M0VDC12
56
** MK64FN1M0VLL12
67
** MK64FN1M0VLQ12
78
** MK64FN1M0VMD12
89
**
910
** Compiler: Keil ARM C/C++ Compiler
1011
** Reference manual: K64P144M120SF5RM, Rev.2, January 2014
11-
** Version: rev. 2.8, 2015-02-19
12-
** Build: b151009
12+
** Version: rev. 2.9, 2016-03-21
13+
** Build: b160406
1314
**
1415
** Abstract:
1516
** Linker file for the Keil ARM C/C++ Compiler
1617
**
17-
** Copyright (c) 2015 Freescale Semiconductor, Inc.
18+
** Copyright (c) 2016 Freescale Semiconductor, Inc.
1819
** All rights reserved.
1920
**
2021
** Redistribution and use in source and binary forms, with or without modification,
@@ -49,6 +50,10 @@
4950
*/
5051
#define __ram_vector_table__ 1
5152

53+
/* Heap 1/4 of ram and stack 1/8 */
54+
#define __stack_size__ 0x8000
55+
#define __heap_size__ 0x10000
56+
5257
#if (defined(__ram_vector_table__))
5358
#define __ram_vector_table_size__ 0x00000400
5459
#else
@@ -73,24 +78,44 @@
7378
#define m_data_2_start 0x20000000
7479
#define m_data_2_size 0x00030000
7580

81+
/* Sizes */
82+
#if (defined(__stack_size__))
83+
#define Stack_Size __stack_size__
84+
#else
85+
#define Stack_Size 0x0400
86+
#endif
7687

77-
LR_m_text m_interrupts_start m_text_size+m_interrupts_size+m_flash_config_size { ; load region size_region
88+
#if (defined(__heap_size__))
89+
#define Heap_Size __heap_size__
90+
#else
91+
#define Heap_Size 0x0400
92+
#endif
93+
94+
LR_m_text m_interrupts_start m_text_start+m_text_size-m_interrupts_start { ; load region size_region
7895
VECTOR_ROM m_interrupts_start m_interrupts_size { ; load address = execution address
7996
* (RESET,+FIRST)
8097
}
81-
ER_m_flash_config m_flash_config_start m_flash_config_size { ; load address = execution address
98+
ER_m_flash_config m_flash_config_start FIXED m_flash_config_size { ; load address = execution address
8299
* (FlashConfig)
83100
}
84101
ER_m_text m_text_start m_text_size { ; load address = execution address
85102
* (InRoot$$Sections)
86103
.ANY (+RO)
87104
}
105+
106+
#if (defined(__ram_vector_table__))
107+
VECTOR_RAM m_interrupts_ram_start EMPTY m_interrupts_ram_size {
108+
}
109+
#else
110+
VECTOR_RAM m_interrupts_start EMPTY 0 {
111+
}
112+
#endif
88113
RW_m_data m_data_start m_data_size { ; RW data
89114
.ANY (+RW +ZI)
90115
}
91-
RW_IRAM1 m_data_2_start m_data_2_size { ; RW data
116+
RW_m_data_2 m_data_2_start m_data_2_size-Stack_Size-Heap_Size { ; RW data
92117
.ANY (+RW +ZI)
93118
}
94-
VECTOR_RAM m_interrupts_ram_start EMPTY m_interrupts_ram_size {
119+
RW_IRAM1 ImageLimit(RW_m_data_2) { ; Heap region growing up
95120
}
96121
}

0 commit comments

Comments
 (0)