From 17f239924a2d52d099e60ba3a65662f4d2b1fb16 Mon Sep 17 00:00:00 2001 From: lottaviano Date: Wed, 4 May 2011 12:59:54 +0000 Subject: [PATCH] Stack size problem solved for cortex-m3 CPU family. (STACK_SIZE variable in cortex-m3 linker scripts was shared between every cortex-m3 CPU) STACK_SIZE variable moved into the CPU specific linker script file. Signed-off-by: Andrea Scalise Signed-off-by: Matteo Silvestri git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4875 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cpu/cortex-m3/scripts/cortex-m3_ram.ld | 5 +---- bertos/cpu/cortex-m3/scripts/cortex-m3_rom.ld | 5 +---- bertos/cpu/cortex-m3/scripts/lm3s1968_ram.ld | 6 ++++++ bertos/cpu/cortex-m3/scripts/lm3s1968_rom.ld | 6 ++++++ bertos/cpu/cortex-m3/scripts/lm3s8962_ram.ld | 7 +++++++ bertos/cpu/cortex-m3/scripts/lm3s8962_rom.ld | 6 ++++++ bertos/cpu/cortex-m3/scripts/sam3n4_ram.ld | 6 ++++++ bertos/cpu/cortex-m3/scripts/sam3n4_rom.ld | 6 ++++++ bertos/cpu/cortex-m3/scripts/sam3x8_rom.ld | 6 ++++++ bertos/cpu/cortex-m3/scripts/stm32f100rb_rom.ld | 5 +++++ bertos/cpu/cortex-m3/scripts/stm32f101c4_ram.ld | 6 ++++++ bertos/cpu/cortex-m3/scripts/stm32f101c4_rom.ld | 7 +++++++ bertos/cpu/cortex-m3/scripts/stm32f103rb_rom.ld | 6 ++++++ bertos/cpu/cortex-m3/scripts/stm32f103re_rom.ld | 6 ++++++ 14 files changed, 75 insertions(+), 8 deletions(-) diff --git a/bertos/cpu/cortex-m3/scripts/cortex-m3_ram.ld b/bertos/cpu/cortex-m3/scripts/cortex-m3_ram.ld index df757988..f045c1ef 100644 --- a/bertos/cpu/cortex-m3/scripts/cortex-m3_ram.ld +++ b/bertos/cpu/cortex-m3/scripts/cortex-m3_ram.ld @@ -39,10 +39,6 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) -/* - * Define stack size here - */ -STACK_SIZE = 0x1000; /* * Allocate section memory @@ -92,6 +88,7 @@ SECTIONS /* * Allocated stack at the end of bss section. * Data heap is allocate at end of stack. + * STACK_SIZE variable is defined in the CPU specific linker script file. */ PROVIDE (__msp_start = .); . = ALIGN(8); diff --git a/bertos/cpu/cortex-m3/scripts/cortex-m3_rom.ld b/bertos/cpu/cortex-m3/scripts/cortex-m3_rom.ld index bed63240..94a18136 100644 --- a/bertos/cpu/cortex-m3/scripts/cortex-m3_rom.ld +++ b/bertos/cpu/cortex-m3/scripts/cortex-m3_rom.ld @@ -38,10 +38,6 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) -/* - * Define stack size here - */ -STACK_SIZE = 0x1000; /* * Allocate section memory @@ -94,6 +90,7 @@ SECTIONS /* * Allocated stack at the end of bss section. * Data heap is allocate at end of stack. + * STACK_SIZE variable is defined in the CPU specific linker script file. */ PROVIDE (__msp_start = .); . = ALIGN(8); diff --git a/bertos/cpu/cortex-m3/scripts/lm3s1968_ram.ld b/bertos/cpu/cortex-m3/scripts/lm3s1968_ram.ld index 1afe5643..2585d53a 100644 --- a/bertos/cpu/cortex-m3/scripts/lm3s1968_ram.ld +++ b/bertos/cpu/cortex-m3/scripts/lm3s1968_ram.ld @@ -36,6 +36,12 @@ * */ +/* + * Define stack size here + * Variable used in the cortex-m3_ram.ld file + */ +STACK_SIZE = 0x1000; + /* * Define memory configuration for LM3S1968 board */ diff --git a/bertos/cpu/cortex-m3/scripts/lm3s1968_rom.ld b/bertos/cpu/cortex-m3/scripts/lm3s1968_rom.ld index 8a8cefe2..eff380ed 100644 --- a/bertos/cpu/cortex-m3/scripts/lm3s1968_rom.ld +++ b/bertos/cpu/cortex-m3/scripts/lm3s1968_rom.ld @@ -36,6 +36,12 @@ * */ +/* + * Define stack size here + * Variable used in the cortex-m3_rom.ld file + */ +STACK_SIZE = 0x1000; + /* * Define memory configuration for LM3S1968 board */ diff --git a/bertos/cpu/cortex-m3/scripts/lm3s8962_ram.ld b/bertos/cpu/cortex-m3/scripts/lm3s8962_ram.ld index d4049882..61e673d0 100644 --- a/bertos/cpu/cortex-m3/scripts/lm3s8962_ram.ld +++ b/bertos/cpu/cortex-m3/scripts/lm3s8962_ram.ld @@ -35,6 +35,13 @@ * \author Andrea Righi */ + +/* + * Define stack size here + * Variable used in the cortex-m3_ram.ld file + */ +STACK_SIZE = 0x1000; + /* * Define memory configuration for LM3S8962 board */ diff --git a/bertos/cpu/cortex-m3/scripts/lm3s8962_rom.ld b/bertos/cpu/cortex-m3/scripts/lm3s8962_rom.ld index 93ef1b1a..b79f5c01 100644 --- a/bertos/cpu/cortex-m3/scripts/lm3s8962_rom.ld +++ b/bertos/cpu/cortex-m3/scripts/lm3s8962_rom.ld @@ -35,6 +35,12 @@ * \author Andrea Righi */ +/* + * Define stack size here + * Variable used in the cortex-m3_rom.ld file + */ +STACK_SIZE = 0x1000; + /*/ * Define memory configuration for LM3S8962 board */ diff --git a/bertos/cpu/cortex-m3/scripts/sam3n4_ram.ld b/bertos/cpu/cortex-m3/scripts/sam3n4_ram.ld index ad3bf375..9dee00df 100644 --- a/bertos/cpu/cortex-m3/scripts/sam3n4_ram.ld +++ b/bertos/cpu/cortex-m3/scripts/sam3n4_ram.ld @@ -36,6 +36,12 @@ * */ +/* + * Define stack size here + * Variable used in the cortex-m3_ram.ld file + */ +STACK_SIZE = 0x1000; + /* * Memory configuration for SAM3N4. */ diff --git a/bertos/cpu/cortex-m3/scripts/sam3n4_rom.ld b/bertos/cpu/cortex-m3/scripts/sam3n4_rom.ld index 170ff03b..5d6efa49 100644 --- a/bertos/cpu/cortex-m3/scripts/sam3n4_rom.ld +++ b/bertos/cpu/cortex-m3/scripts/sam3n4_rom.ld @@ -36,6 +36,12 @@ * */ +/* + * Define stack size here + * Variable used in the cortex-m3_rom.ld file + */ +STACK_SIZE = 0x1000; + /* * Memory configuration for SAM3N4. */ diff --git a/bertos/cpu/cortex-m3/scripts/sam3x8_rom.ld b/bertos/cpu/cortex-m3/scripts/sam3x8_rom.ld index 17676137..bdf929e8 100644 --- a/bertos/cpu/cortex-m3/scripts/sam3x8_rom.ld +++ b/bertos/cpu/cortex-m3/scripts/sam3x8_rom.ld @@ -36,6 +36,12 @@ * */ +/* + * Define stack size here + * Variable used in the cortex-m3_rom.ld file + */ +STACK_SIZE = 0x1000; + /* * Memory configuration for SAM3X8. */ diff --git a/bertos/cpu/cortex-m3/scripts/stm32f100rb_rom.ld b/bertos/cpu/cortex-m3/scripts/stm32f100rb_rom.ld index 06a894a6..aebe3298 100644 --- a/bertos/cpu/cortex-m3/scripts/stm32f100rb_rom.ld +++ b/bertos/cpu/cortex-m3/scripts/stm32f100rb_rom.ld @@ -37,6 +37,11 @@ * */ +/* + * Define stack size here + * Variable used in the cortex-m3_rom.ld file + */ +STACK_SIZE = 0x400; /* * Define memory configuration for STM32F100RB diff --git a/bertos/cpu/cortex-m3/scripts/stm32f101c4_ram.ld b/bertos/cpu/cortex-m3/scripts/stm32f101c4_ram.ld index 0637501c..f78c529d 100644 --- a/bertos/cpu/cortex-m3/scripts/stm32f101c4_ram.ld +++ b/bertos/cpu/cortex-m3/scripts/stm32f101c4_ram.ld @@ -36,6 +36,12 @@ * */ +/* + * Define stack size here + * Variable used in the cortex-m3_ram.ld file + */ +STACK_SIZE = 0x200; + /* * Define memory configuration for STM32F101C4 */ diff --git a/bertos/cpu/cortex-m3/scripts/stm32f101c4_rom.ld b/bertos/cpu/cortex-m3/scripts/stm32f101c4_rom.ld index f2ea131c..19dc6423 100644 --- a/bertos/cpu/cortex-m3/scripts/stm32f101c4_rom.ld +++ b/bertos/cpu/cortex-m3/scripts/stm32f101c4_rom.ld @@ -36,6 +36,13 @@ * */ + +/* + * Define stack size here + * Variable used in the cortex-m3_rom.ld file + */ +STACK_SIZE = 0x200; + /* * Define memory configuration for STM32F101C4 */ diff --git a/bertos/cpu/cortex-m3/scripts/stm32f103rb_rom.ld b/bertos/cpu/cortex-m3/scripts/stm32f103rb_rom.ld index 438bb615..4d0884b9 100644 --- a/bertos/cpu/cortex-m3/scripts/stm32f103rb_rom.ld +++ b/bertos/cpu/cortex-m3/scripts/stm32f103rb_rom.ld @@ -36,6 +36,12 @@ * */ +/* + * Define stack size here + * Variable used in the cortex-m3_rom.ld file + */ +STACK_SIZE = 0x1000; + /* * Define memory configuration for STM32F103R8 */ diff --git a/bertos/cpu/cortex-m3/scripts/stm32f103re_rom.ld b/bertos/cpu/cortex-m3/scripts/stm32f103re_rom.ld index 24b5307b..c7c4def8 100644 --- a/bertos/cpu/cortex-m3/scripts/stm32f103re_rom.ld +++ b/bertos/cpu/cortex-m3/scripts/stm32f103re_rom.ld @@ -36,6 +36,12 @@ * */ +/* + * Define stack size here + * Variable used in the cortex-m3_rom.ld file + */ +STACK_SIZE = 0x1000; + /* * Define memory configuration for STM32F103RE */ -- 2.25.1