Skip to content

Commit 2d97246

Browse files
committed
KL27Z: Update the ARM linker file
Signed-off-by: Mahadevan Mahesh <[email protected]>
1 parent 1fe6c2f commit 2d97246

File tree

1 file changed

+28
-4
lines changed
  • hal/targets/cmsis/TARGET_Freescale/TARGET_KL27Z/TOOLCHAIN_ARM_STD

1 file changed

+28
-4
lines changed

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

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
** Abstract:
1616
** Linker file for the Keil ARM C/C++ Compiler
1717
**
18-
** Copyright (c) 2015 Freescale Semiconductor, Inc.
18+
** Copyright (c) 2016 Freescale Semiconductor, Inc.
1919
** All rights reserved.
2020
**
2121
** Redistribution and use in source and binary forms, with or without modification,
@@ -50,6 +50,10 @@
5050
*/
5151
#define __ram_vector_table__ 1
5252

53+
/* Heap 1/4 of ram and stack 1/8 */
54+
#define __stack_size__ 0x800
55+
#define __heap_size__ 0x1000
56+
5357
#if (defined(__ram_vector_table__))
5458
#define __ram_vector_table_size__ 0x00000200
5559
#else
@@ -71,22 +75,42 @@
7175
#define m_data_start (m_interrupts_ram_start + m_interrupts_ram_size)
7276
#define m_data_size (0x00004000 - m_interrupts_ram_size)
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 0x10000 { ; 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
}
7995
ER_m_flash_config m_flash_config_start FIXED m_flash_config_size { ; load address = execution address
8096
* (FlashConfig)
8197
}
82-
ER_m_text m_text_start FIXED m_text_size { ; load address = execution address
98+
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__))
86104
VECTOR_RAM m_interrupts_ram_start EMPTY m_interrupts_ram_size {
87105
}
88-
RW_IRAM1 m_data_start m_data_size { ; RW data
106+
#else
107+
VECTOR_RAM m_interrupts_start EMPTY 0 {
108+
}
109+
#endif
110+
RW_m_data m_data_start m_data_size-Stack_Size-Heap_Size { ; RW data
89111
.ANY (+RW +ZI)
90112
}
113+
RW_IRAM1 +0 EMPTY Heap_Size { ; RW data
114+
}
91115
}
92116

0 commit comments

Comments
 (0)