diff options
39 files changed, 162 insertions, 1792 deletions
| diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/Makefile b/demos/ARMCM0-LPC1114-LPCXPRESSO/Makefile index 7ed1b6e78..8f455c75f 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/Makefile +++ b/demos/ARMCM0-LPC1114-LPCXPRESSO/Makefile @@ -47,9 +47,6 @@ endif  # Define project name here
  PROJECT = ch
 -# Define linker script file here
 -LDSCRIPT= ch.ld
 -
  # Imported source files
  CHIBIOS = ../..
  include $(CHIBIOS)/boards/EA_LPCXPRESSO_BB_1114/board.mk
 @@ -59,6 +56,9 @@ include $(CHIBIOS)/os/ports/GCC/ARMCMx/LPC11xx/port.mk  include $(CHIBIOS)/os/kernel/kernel.mk
  include $(CHIBIOS)/test/test.mk
 +# Define linker script file here
 +LDSCRIPT= $(PORTLD)/LPC1114.ld
 +
  # C sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
  CSRC = $(PORTSRC) \
 @@ -69,7 +69,7 @@ CSRC = $(PORTSRC) \         $(BOARDSRC) \
         $(CHIBIOS)/os/various/evtimer.c \
         $(CHIBIOS)/os/various/syscalls.c \
 -       main.c +       main.c
  # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
 diff --git a/demos/ARMCM3-LPC1343-LPCXPRESSO/Makefile b/demos/ARMCM3-LPC1343-LPCXPRESSO/Makefile index dc3cc484f..f544b4f57 100644 --- a/demos/ARMCM3-LPC1343-LPCXPRESSO/Makefile +++ b/demos/ARMCM3-LPC1343-LPCXPRESSO/Makefile @@ -47,9 +47,6 @@ endif  # Define project name here
  PROJECT = ch
 -# Define linker script file here
 -LDSCRIPT= ch.ld
 -
  # Imported source files
  CHIBIOS = ../..
  include $(CHIBIOS)/boards/EA_LPCXPRESSO_BB_1343/board.mk
 @@ -59,6 +56,9 @@ include $(CHIBIOS)/os/ports/GCC/ARMCMx/LPC13xx/port.mk  include $(CHIBIOS)/os/kernel/kernel.mk
  include $(CHIBIOS)/test/test.mk
 +# Define linker script file here
 +LDSCRIPT= $(PORTLD)/LPC1343.ld
 +
  # C sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
  CSRC = $(PORTSRC) \
 @@ -69,7 +69,7 @@ CSRC = $(PORTSRC) \         $(BOARDSRC) \
         $(CHIBIOS)/os/various/evtimer.c \
         $(CHIBIOS)/os/various/syscalls.c \
 -       main.c +       main.c
  # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
 diff --git a/demos/ARMCM3-STM32F103-FATFS/Makefile b/demos/ARMCM3-STM32F103-FATFS/Makefile index 10e682178..55311691a 100644 --- a/demos/ARMCM3-STM32F103-FATFS/Makefile +++ b/demos/ARMCM3-STM32F103-FATFS/Makefile @@ -52,10 +52,7 @@ endif  # Define project name here
  PROJECT = ch
 -# Define linker script file here
 -LDSCRIPT= ch.ld
 -
 -# Imported source files
 +# Imported source files and paths
  CHIBIOS = ../..
  include $(CHIBIOS)/boards/OLIMEX_STM32_P103/board.mk
  include $(CHIBIOS)/os/hal/platforms/STM32F1xx/platform.mk
 @@ -65,6 +62,9 @@ include $(CHIBIOS)/os/kernel/kernel.mk  include $(CHIBIOS)/test/test.mk
  include $(CHIBIOS)/ext/fatfs/fatfs.mk
 +# Define linker script file here
 +LDSCRIPT= $(PORTLD)/STM32F103xB.ld
 +
  # C sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
  CSRC = $(PORTSRC) \
 diff --git a/demos/ARMCM3-STM32F103-FATFS/ch.ld b/demos/ARMCM3-STM32F103-FATFS/ch.ld deleted file mode 100644 index 4d97e7682..000000000 --- a/demos/ARMCM3-STM32F103-FATFS/ch.ld +++ /dev/null @@ -1,130 +0,0 @@ -/*
 -    ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
 -                 2011 Giovanni Di Sirio.
 -
 -    This file is part of ChibiOS/RT.
 -
 -    ChibiOS/RT is free software; you can redistribute it and/or modify
 -    it under the terms of the GNU General Public License as published by
 -    the Free Software Foundation; either version 3 of the License, or
 -    (at your option) any later version.
 -
 -    ChibiOS/RT is distributed in the hope that it will be useful,
 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -    GNU General Public License for more details.
 -
 -    You should have received a copy of the GNU General Public License
 -    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -*/
 -
 -/*
 - * ST32F103 memory setup.
 - */
 -__main_stack_size__     = 0x0400;
 -__process_stack_size__  = 0x0400;
 -__stacks_total_size__   = __main_stack_size__ + __process_stack_size__;
 -
 -MEMORY
 -{
 -    flash : org = 0x08000000, len = 128k
 -    ram : org = 0x20000000, len = 20k
 -}
 -
 -__ram_start__           = ORIGIN(ram);
 -__ram_size__            = LENGTH(ram);
 -__ram_end__             = __ram_start__ + __ram_size__;
 -
 -SECTIONS
 -{
 -    . = 0;
 -    _text = .;
 -
 -    startup : ALIGN(16) SUBALIGN(16)
 -    {
 -        KEEP(*(vectors))
 -    } > flash
 -
 -    constructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__init_array_start = .);
 -        KEEP(*(SORT(.init_array.*)))
 -        KEEP(*(.init_array))
 -        PROVIDE(__init_array_end = .);
 -    } > flash
 -
 -    destructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__fini_array_start = .);
 -        KEEP(*(.fini_array))
 -        KEEP(*(SORT(.fini_array.*)))
 -        PROVIDE(__fini_array_end = .);
 -    } > flash
 -
 -    .text : ALIGN(16) SUBALIGN(16)
 -    {
 -        *(.text.startup.*)
 -        *(.text)
 -        *(.text.*)
 -        *(.rodata)
 -        *(.rodata.*)
 -        *(.glue_7t)
 -        *(.glue_7)
 -        *(.gcc*)
 -    } > flash
 -
 -    .ARM.extab :
 -    {
 -        *(.ARM.extab* .gnu.linkonce.armextab.*)
 -    } > flash
 -
 -    .ARM.exidx : {
 -        PROVIDE(__exidx_start = .);
 -        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
 -        PROVIDE(__exidx_end = .);
 -     } > flash
 -
 -    .eh_frame_hdr :
 -    {
 -        *(.eh_frame_hdr)
 -    } > flash
 -
 -    .eh_frame : ONLY_IF_RO
 -    {
 -        *(.eh_frame)
 -    } > flash
 -
 -    . = ALIGN(4);
 -    _etext = .;
 -    _textdata = _etext;
 -
 -    .data :
 -    {
 -        PROVIDE(_data = .);
 -        *(.data)
 -        . = ALIGN(4);
 -        *(.data.*)
 -        . = ALIGN(4);
 -        *(.ramtext)
 -        . = ALIGN(4);
 -        PROVIDE(_edata = .);
 -    } > ram AT > flash
 -
 -    .bss :
 -    {
 -        PROVIDE(_bss_start = .);
 -        *(.bss)
 -        . = ALIGN(4);
 -        *(.bss.*)
 -        . = ALIGN(4);
 -        *(COMMON)
 -        . = ALIGN(4);
 -        PROVIDE(_bss_end = .);
 -    } > ram    
 -}
 -
 -PROVIDE(end = .);
 -_end            = .;
 -
 -__heap_base__   = _end;
 -__heap_end__    = __ram_end__ - __stacks_total_size__;
 diff --git a/demos/ARMCM3-STM32F103-G++/Makefile b/demos/ARMCM3-STM32F103-G++/Makefile index df59da351..9cf499290 100644 --- a/demos/ARMCM3-STM32F103-G++/Makefile +++ b/demos/ARMCM3-STM32F103-G++/Makefile @@ -52,10 +52,7 @@ endif  # Define project name here
  PROJECT = ch
 -# Define linker script file here
 -LDSCRIPT= ch.ld
 -
 -# Imported source files
 +# Imported source files and paths
  CHIBIOS = ../..
  include $(CHIBIOS)/boards/OLIMEX_STM32_P103/board.mk
  include $(CHIBIOS)/os/hal/platforms/STM32F1xx/platform.mk
 @@ -64,6 +61,9 @@ include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk  include $(CHIBIOS)/os/kernel/kernel.mk
  include $(CHIBIOS)/test/test.mk
 +# Define linker script file here
 +LDSCRIPT= $(PORTLD)/STM32F103xB.ld
 +
  # C sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
  CSRC = $(PORTSRC) \
 diff --git a/demos/ARMCM3-STM32F103-G++/ch.ld b/demos/ARMCM3-STM32F103-G++/ch.ld deleted file mode 100644 index 4d97e7682..000000000 --- a/demos/ARMCM3-STM32F103-G++/ch.ld +++ /dev/null @@ -1,130 +0,0 @@ -/*
 -    ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
 -                 2011 Giovanni Di Sirio.
 -
 -    This file is part of ChibiOS/RT.
 -
 -    ChibiOS/RT is free software; you can redistribute it and/or modify
 -    it under the terms of the GNU General Public License as published by
 -    the Free Software Foundation; either version 3 of the License, or
 -    (at your option) any later version.
 -
 -    ChibiOS/RT is distributed in the hope that it will be useful,
 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -    GNU General Public License for more details.
 -
 -    You should have received a copy of the GNU General Public License
 -    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -*/
 -
 -/*
 - * ST32F103 memory setup.
 - */
 -__main_stack_size__     = 0x0400;
 -__process_stack_size__  = 0x0400;
 -__stacks_total_size__   = __main_stack_size__ + __process_stack_size__;
 -
 -MEMORY
 -{
 -    flash : org = 0x08000000, len = 128k
 -    ram : org = 0x20000000, len = 20k
 -}
 -
 -__ram_start__           = ORIGIN(ram);
 -__ram_size__            = LENGTH(ram);
 -__ram_end__             = __ram_start__ + __ram_size__;
 -
 -SECTIONS
 -{
 -    . = 0;
 -    _text = .;
 -
 -    startup : ALIGN(16) SUBALIGN(16)
 -    {
 -        KEEP(*(vectors))
 -    } > flash
 -
 -    constructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__init_array_start = .);
 -        KEEP(*(SORT(.init_array.*)))
 -        KEEP(*(.init_array))
 -        PROVIDE(__init_array_end = .);
 -    } > flash
 -
 -    destructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__fini_array_start = .);
 -        KEEP(*(.fini_array))
 -        KEEP(*(SORT(.fini_array.*)))
 -        PROVIDE(__fini_array_end = .);
 -    } > flash
 -
 -    .text : ALIGN(16) SUBALIGN(16)
 -    {
 -        *(.text.startup.*)
 -        *(.text)
 -        *(.text.*)
 -        *(.rodata)
 -        *(.rodata.*)
 -        *(.glue_7t)
 -        *(.glue_7)
 -        *(.gcc*)
 -    } > flash
 -
 -    .ARM.extab :
 -    {
 -        *(.ARM.extab* .gnu.linkonce.armextab.*)
 -    } > flash
 -
 -    .ARM.exidx : {
 -        PROVIDE(__exidx_start = .);
 -        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
 -        PROVIDE(__exidx_end = .);
 -     } > flash
 -
 -    .eh_frame_hdr :
 -    {
 -        *(.eh_frame_hdr)
 -    } > flash
 -
 -    .eh_frame : ONLY_IF_RO
 -    {
 -        *(.eh_frame)
 -    } > flash
 -
 -    . = ALIGN(4);
 -    _etext = .;
 -    _textdata = _etext;
 -
 -    .data :
 -    {
 -        PROVIDE(_data = .);
 -        *(.data)
 -        . = ALIGN(4);
 -        *(.data.*)
 -        . = ALIGN(4);
 -        *(.ramtext)
 -        . = ALIGN(4);
 -        PROVIDE(_edata = .);
 -    } > ram AT > flash
 -
 -    .bss :
 -    {
 -        PROVIDE(_bss_start = .);
 -        *(.bss)
 -        . = ALIGN(4);
 -        *(.bss.*)
 -        . = ALIGN(4);
 -        *(COMMON)
 -        . = ALIGN(4);
 -        PROVIDE(_bss_end = .);
 -    } > ram    
 -}
 -
 -PROVIDE(end = .);
 -_end            = .;
 -
 -__heap_base__   = _end;
 -__heap_end__    = __ram_end__ - __stacks_total_size__;
 diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/Makefile b/demos/ARMCM3-STM32F103ZG-FATFS/Makefile index 994b5c9c7..7ecf4e3cb 100644 --- a/demos/ARMCM3-STM32F103ZG-FATFS/Makefile +++ b/demos/ARMCM3-STM32F103ZG-FATFS/Makefile @@ -52,10 +52,7 @@ endif  # Define project name here
  PROJECT = ch
 -# Define linker script file here
 -LDSCRIPT= ch.ld
 -
 -# Imported source files
 +# Imported source files and paths
  CHIBIOS = ../..
  include $(CHIBIOS)/boards/ST_STM3210E_EVAL/board.mk
  include $(CHIBIOS)/os/hal/platforms/STM32F1xx/platform.mk
 @@ -65,6 +62,9 @@ include $(CHIBIOS)/os/kernel/kernel.mk  include $(CHIBIOS)/test/test.mk
  include $(CHIBIOS)/ext/fatfs/fatfs.mk
 +# Define linker script file here
 +LDSCRIPT= $(PORTLD)/STM32F103xG.ld
 +
  # C sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
  CSRC = $(PORTSRC) \
 @@ -78,7 +78,7 @@ CSRC = $(PORTSRC) \         $(CHIBIOS)/os/various/syscalls.c \
         $(CHIBIOS)/os/various/shell.c \
         $(CHIBIOS)/os/various/chprintf.c \
 -       main.c +       main.c
  # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
 diff --git a/demos/ARMCM3-STM32F107/Makefile b/demos/ARMCM3-STM32F107/Makefile index af14b681d..4f70f1e0e 100644 --- a/demos/ARMCM3-STM32F107/Makefile +++ b/demos/ARMCM3-STM32F107/Makefile @@ -52,10 +52,7 @@ endif  # Define project name here
  PROJECT = ch
 -# Define linker script file here
 -LDSCRIPT= ch.ld
 -
 -# Imported source files
 +# Imported source files and paths
  CHIBIOS = ../..
  include $(CHIBIOS)/boards/OLIMEX_STM32_P107/board.mk
  include $(CHIBIOS)/os/hal/platforms/STM32F1xx/platform.mk
 @@ -64,6 +61,9 @@ include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk  include $(CHIBIOS)/os/kernel/kernel.mk
  include $(CHIBIOS)/test/test.mk
 +# Define linker script file here
 +LDSCRIPT= $(PORTLD)/STM32F107xC.ld
 +
  # C sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
  CSRC = $(PORTSRC) \
 @@ -74,7 +74,7 @@ CSRC = $(PORTSRC) \         $(BOARDSRC) \
         $(CHIBIOS)/os/various/evtimer.c \
         $(CHIBIOS)/os/various/syscalls.c \
 -       main.c +       main.c
  # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
 diff --git a/demos/ARMCM3-STM32L152-DISCOVERY/Makefile b/demos/ARMCM3-STM32L152-DISCOVERY/Makefile index 65ba0eece..603ceb433 100644 --- a/demos/ARMCM3-STM32L152-DISCOVERY/Makefile +++ b/demos/ARMCM3-STM32L152-DISCOVERY/Makefile @@ -52,10 +52,7 @@ endif  # Define project name here
  PROJECT = ch
 -# Define linker script file here
 -LDSCRIPT= ch.ld
 -
 -# Imported source files
 +# Imported source files and paths
  CHIBIOS = ../..
  include $(CHIBIOS)/boards/ST_STM32L_DISCOVERY/board.mk
  include $(CHIBIOS)/os/hal/platforms/STM32L1xx/platform.mk
 @@ -64,6 +61,9 @@ include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32L1xx/port.mk  include $(CHIBIOS)/os/kernel/kernel.mk
  include $(CHIBIOS)/test/test.mk
 +# Define linker script file here
 +LDSCRIPT= $(PORTLD)/STM32L152xB.ld
 +
  # C sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
  CSRC = $(PORTSRC) \
 @@ -74,7 +74,7 @@ CSRC = $(PORTSRC) \         $(BOARDSRC) \
         $(CHIBIOS)/os/various/evtimer.c \
         $(CHIBIOS)/os/various/syscalls.c \
 -       main.c +       main.c
  # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
 diff --git a/demos/ARMCM0-LPC1114-LPCXPRESSO/ch.ld b/os/ports/GCC/ARMCMx/LPC11xx/ld/LPC1114.ld index cfc5ff3b6..cfc5ff3b6 100644 --- a/demos/ARMCM0-LPC1114-LPCXPRESSO/ch.ld +++ b/os/ports/GCC/ARMCMx/LPC11xx/ld/LPC1114.ld diff --git a/demos/ARMCM3-LPC1343-LPCXPRESSO/ch.ld b/os/ports/GCC/ARMCMx/LPC13xx/ld/LPC1343.ld index 703f09ca4..703f09ca4 100644 --- a/demos/ARMCM3-LPC1343-LPCXPRESSO/ch.ld +++ b/os/ports/GCC/ARMCMx/LPC13xx/ld/LPC1343.ld diff --git a/demos/ARMCM3-STM32L152-DISCOVERY/ch.ld b/os/ports/GCC/ARMCMx/STM32/ld/STM32F100xB.ld index 51237c594..deabb622a 100644 --- a/demos/ARMCM3-STM32L152-DISCOVERY/ch.ld +++ b/os/ports/GCC/ARMCMx/STM32/ld/STM32F100xB.ld @@ -19,16 +19,15 @@  */
  /*
 - * ST32L1152xB memory setup.
 + * ST32F100xB memory setup.
   */
  __main_stack_size__     = 0x0400;
  __process_stack_size__  = 0x0400;
 -__stacks_total_size__   = __main_stack_size__ + __process_stack_size__;
  MEMORY
  {
      flash : org = 0x08000000, len = 128k
 -    ram : org = 0x20000000, len = 16k
 +    ram : org = 0x20000000, len = 8k
  }
  __ram_start__           = ORIGIN(ram);
 @@ -98,6 +97,21 @@ SECTIONS      _etext = .;
      _textdata = _etext;
 +    .stacks :
 +    {
 +        . = ALIGN(8);
 +        __main_stack_base__ = .;
 +        . += __main_stack_size__;
 +        . = ALIGN(8);
 +        __main_stack_end__ = .;
 +        __process_stack_base__ = .;
 +        __main_thread_stack_base__ = .;
 +        . += __process_stack_size__;
 +        . = ALIGN(8);
 +        __process_stack_end__ = .;
 +        __main_thread_stack_end__ = .;
 +    } > ram
 +
      .data :
      {
          PROVIDE(_data = .);
 @@ -127,4 +141,4 @@ PROVIDE(end = .);  _end            = .;
  __heap_base__   = _end;
 -__heap_end__    = __ram_end__ - __stacks_total_size__;
 +__heap_end__    = __ram_end__;
 diff --git a/testhal/STM32F1xx/ADC/ch.ld b/os/ports/GCC/ARMCMx/STM32/ld/STM32F103xB.ld index 4d97e7682..b786a6249 100644 --- a/testhal/STM32F1xx/ADC/ch.ld +++ b/os/ports/GCC/ARMCMx/STM32/ld/STM32F103xB.ld @@ -19,11 +19,10 @@  */
  /*
 - * ST32F103 memory setup.
 + * ST32F103xB memory setup.
   */
  __main_stack_size__     = 0x0400;
  __process_stack_size__  = 0x0400;
 -__stacks_total_size__   = __main_stack_size__ + __process_stack_size__;
  MEMORY
  {
 @@ -98,6 +97,21 @@ SECTIONS      _etext = .;
      _textdata = _etext;
 +    .stacks :
 +    {
 +        . = ALIGN(8);
 +        __main_stack_base__ = .;
 +        . += __main_stack_size__;
 +        . = ALIGN(8);
 +        __main_stack_end__ = .;
 +        __process_stack_base__ = .;
 +        __main_thread_stack_base__ = .;
 +        . += __process_stack_size__;
 +        . = ALIGN(8);
 +        __process_stack_end__ = .;
 +        __main_thread_stack_end__ = .;
 +    } > ram
 +
      .data :
      {
          PROVIDE(_data = .);
 @@ -127,4 +141,4 @@ PROVIDE(end = .);  _end            = .;
  __heap_base__   = _end;
 -__heap_end__    = __ram_end__ - __stacks_total_size__;
 +__heap_end__    = __ram_end__;
 diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/ch.ld b/os/ports/GCC/ARMCMx/STM32/ld/STM32F103xE.ld index 363ddce9f..7e6b8ee56 100644 --- a/demos/ARMCM3-STM32F103ZG-FATFS/ch.ld +++ b/os/ports/GCC/ARMCMx/STM32/ld/STM32F103xE.ld @@ -19,11 +19,10 @@  */
  /*
 - * ST32F103xG memory setup.
 + * ST32F103xE memory setup.
   */
  __main_stack_size__     = 0x0400;
  __process_stack_size__  = 0x0400;
 -__stacks_total_size__   = __main_stack_size__ + __process_stack_size__;
  MEMORY
  {
 @@ -98,6 +97,21 @@ SECTIONS      _etext = .;
      _textdata = _etext;
 +    .stacks :
 +    {
 +        . = ALIGN(8);
 +        __main_stack_base__ = .;
 +        . += __main_stack_size__;
 +        . = ALIGN(8);
 +        __main_stack_end__ = .;
 +        __process_stack_base__ = .;
 +        __main_thread_stack_base__ = .;
 +        . += __process_stack_size__;
 +        . = ALIGN(8);
 +        __process_stack_end__ = .;
 +        __main_thread_stack_end__ = .;
 +    } > ram
 +
      .data :
      {
          PROVIDE(_data = .);
 @@ -127,4 +141,4 @@ PROVIDE(end = .);  _end            = .;
  __heap_base__   = _end;
 -__heap_end__    = __ram_end__ - __stacks_total_size__;
 +__heap_end__    = __ram_end__;
 diff --git a/demos/ARMCM3-STM32F107/ch.ld b/os/ports/GCC/ARMCMx/STM32/ld/STM32F107xC.ld index 1381b8b1c..711b50a30 100644 --- a/demos/ARMCM3-STM32F107/ch.ld +++ b/os/ports/GCC/ARMCMx/STM32/ld/STM32F107xC.ld @@ -19,11 +19,10 @@  */
  /*
 - * ST32F107 memory setup.
 + * ST32F107xC memory setup.
   */
 -__main_stack_size__     = 0x0200;
 +__main_stack_size__     = 0x0400;
  __process_stack_size__  = 0x0400;
 -__stacks_total_size__   = __main_stack_size__ + __process_stack_size__;
  MEMORY
  {
 @@ -98,6 +97,21 @@ SECTIONS      _etext = .;
      _textdata = _etext;
 +    .stacks :
 +    {
 +        . = ALIGN(8);
 +        __main_stack_base__ = .;
 +        . += __main_stack_size__;
 +        . = ALIGN(8);
 +        __main_stack_end__ = .;
 +        __process_stack_base__ = .;
 +        __main_thread_stack_base__ = .;
 +        . += __process_stack_size__;
 +        . = ALIGN(8);
 +        __process_stack_end__ = .;
 +        __main_thread_stack_end__ = .;
 +    } > ram
 +
      .data :
      {
          PROVIDE(_data = .);
 @@ -127,4 +141,4 @@ PROVIDE(end = .);  _end            = .;
  __heap_base__   = _end;
 -__heap_end__    = __ram_end__ - __stacks_total_size__;
 +__heap_end__    = __ram_end__;
 diff --git a/readme.txt b/readme.txt index 149551b26..fb4e8a5f8 100644 --- a/readme.txt +++ b/readme.txt @@ -89,6 +89,10 @@    (backported to 2.2.4).
  - FIX: Fixed timeout problem in the lwIP interface layer (bug 3302420)
    (backported to 2.2.4).
 +- Removed all the ch.ld files from the ARMCMx demos, now the makefiles point
 +  to common ld files under the various ports. Less duplication and easier
 +  maintenance.
 +  (do this to the other GCC ports too)
  - NEW: Improved stack checking and reorganized memory map for the Cortex-Mx
    demos. Now stacks are allocated at the start of the RAM, an overflow of the
    exception stack now triggers an exception (it could went unnoticed before).
 diff --git a/testhal/LPC11xx/IRQ_STORM/Makefile b/testhal/LPC11xx/IRQ_STORM/Makefile index 2f65b9fe4..d5c1b4cbd 100644 --- a/testhal/LPC11xx/IRQ_STORM/Makefile +++ b/testhal/LPC11xx/IRQ_STORM/Makefile @@ -47,10 +47,7 @@ endif  # Define project name here
  PROJECT = ch
 -# Define linker script file here
 -LDSCRIPT= ch.ld
 -
 -# Imported source files
 +# Imported source files and paths
  CHIBIOS = ../../..
  include $(CHIBIOS)/boards/EA_LPCXPRESSO_BB_1114/board.mk
  include $(CHIBIOS)/os/hal/platforms/LPC11xx/platform.mk
 @@ -59,6 +56,9 @@ include $(CHIBIOS)/os/ports/GCC/ARMCMx/LPC11xx/port.mk  include $(CHIBIOS)/os/kernel/kernel.mk
  include $(CHIBIOS)/test/test.mk
 +# Define linker script file here
 +LDSCRIPT= $(PORTLD)/LPC1114.ld
 +
  # C sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
  CSRC = $(PORTSRC) \
 @@ -69,7 +69,7 @@ CSRC = $(PORTSRC) \         $(BOARDSRC) \
         $(CHIBIOS)/os/various/evtimer.c \
         $(CHIBIOS)/os/various/syscalls.c \
 -       main.c +       main.c
  # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
 diff --git a/testhal/LPC11xx/IRQ_STORM/ch.ld b/testhal/LPC11xx/IRQ_STORM/ch.ld deleted file mode 100644 index cfc5ff3b6..000000000 --- a/testhal/LPC11xx/IRQ_STORM/ch.ld +++ /dev/null @@ -1,130 +0,0 @@ -/*
 -    ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
 -                 2011 Giovanni Di Sirio.
 -
 -    This file is part of ChibiOS/RT.
 -
 -    ChibiOS/RT is free software; you can redistribute it and/or modify
 -    it under the terms of the GNU General Public License as published by
 -    the Free Software Foundation; either version 3 of the License, or
 -    (at your option) any later version.
 -
 -    ChibiOS/RT is distributed in the hope that it will be useful,
 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -    GNU General Public License for more details.
 -
 -    You should have received a copy of the GNU General Public License
 -    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -*/
 -
 -/*
 - * LPC1114 memory setup.
 - */
 -__main_stack_size__     = 0x0100;
 -__process_stack_size__  = 0x0100;
 -__stacks_total_size__   = __main_stack_size__ + __process_stack_size__;
 -
 -MEMORY
 -{
 -    flash : org = 0x00000000, len = 32k
 -    ram : org = 0x10000000, len = 8k
 -}
 -
 -__ram_start__           = ORIGIN(ram);
 -__ram_size__            = LENGTH(ram);
 -__ram_end__             = __ram_start__ + __ram_size__;
 -
 -SECTIONS
 -{
 -    . = 0;
 -    _text = .;
 -
 -    startup : ALIGN(16) SUBALIGN(16)
 -    {
 -        KEEP(*(vectors))
 -    } > flash
 -
 -    constructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__init_array_start = .);
 -        KEEP(*(SORT(.init_array.*)))
 -        KEEP(*(.init_array))
 -        PROVIDE(__init_array_end = .);
 -    } > flash
 -
 -    destructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__fini_array_start = .);
 -        KEEP(*(.fini_array))
 -        KEEP(*(SORT(.fini_array.*)))
 -        PROVIDE(__fini_array_end = .);
 -    } > flash
 -
 -    .text : ALIGN(16) SUBALIGN(16)
 -    {
 -        *(.text.startup.*)
 -        *(.text)
 -        *(.text.*)
 -        *(.rodata)
 -        *(.rodata.*)
 -        *(.glue_7t)
 -        *(.glue_7)
 -        *(.gcc*)
 -    } > flash
 -
 -    .ARM.extab :
 -    {
 -        *(.ARM.extab* .gnu.linkonce.armextab.*)
 -    } > flash
 -
 -    .ARM.exidx : {
 -        PROVIDE(__exidx_start = .);
 -        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
 -        PROVIDE(__exidx_end = .);
 -     } > flash
 -
 -    .eh_frame_hdr :
 -    {
 -        *(.eh_frame_hdr)
 -    } > flash
 -
 -    .eh_frame : ONLY_IF_RO
 -    {
 -        *(.eh_frame)
 -    } > flash
 -
 -    . = ALIGN(4);
 -    _etext = .;
 -    _textdata = _etext;
 -
 -    .data :
 -    {
 -        PROVIDE(_data = .);
 -        *(.data)
 -        . = ALIGN(4);
 -        *(.data.*)
 -        . = ALIGN(4);
 -        *(.ramtext)
 -        . = ALIGN(4);
 -        PROVIDE(_edata = .);
 -    } > ram AT > flash
 -
 -    .bss :
 -    {
 -        PROVIDE(_bss_start = .);
 -        *(.bss)
 -        . = ALIGN(4);
 -        *(.bss.*)
 -        . = ALIGN(4);
 -        *(COMMON)
 -        . = ALIGN(4);
 -        PROVIDE(_bss_end = .);
 -    } > ram    
 -}
 -
 -PROVIDE(end = .);
 -_end            = .;
 -
 -__heap_base__   = _end;
 -__heap_end__    = __ram_end__ - __stacks_total_size__;
 diff --git a/testhal/LPC13xx/IRQ_STORM/Makefile b/testhal/LPC13xx/IRQ_STORM/Makefile index 6d904e8a8..cb53a7761 100644 --- a/testhal/LPC13xx/IRQ_STORM/Makefile +++ b/testhal/LPC13xx/IRQ_STORM/Makefile @@ -47,10 +47,7 @@ endif  # Define project name here
  PROJECT = ch
 -# Define linker script file here
 -LDSCRIPT= ch.ld
 -
 -# Imported source files
 +# Imported source files and paths
  CHIBIOS = ../../..
  include $(CHIBIOS)/boards/EA_LPCXPRESSO_BB_1343/board.mk
  include $(CHIBIOS)/os/hal/platforms/LPC13xx/platform.mk
 @@ -59,6 +56,9 @@ include $(CHIBIOS)/os/ports/GCC/ARMCMx/LPC13xx/port.mk  include $(CHIBIOS)/os/kernel/kernel.mk
  include $(CHIBIOS)/test/test.mk
 +# Define linker script file here
 +LDSCRIPT= $(PORTLD)/LPC1343.ld
 +
  # C sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
  CSRC = $(PORTSRC) \
 @@ -69,7 +69,7 @@ CSRC = $(PORTSRC) \         $(BOARDSRC) \
         $(CHIBIOS)/os/various/evtimer.c \
         $(CHIBIOS)/os/various/syscalls.c \
 -       main.c +       main.c
  # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
 diff --git a/testhal/LPC13xx/IRQ_STORM/ch.ld b/testhal/LPC13xx/IRQ_STORM/ch.ld deleted file mode 100644 index 703f09ca4..000000000 --- a/testhal/LPC13xx/IRQ_STORM/ch.ld +++ /dev/null @@ -1,130 +0,0 @@ -/*
 -    ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
 -                 2011 Giovanni Di Sirio.
 -
 -    This file is part of ChibiOS/RT.
 -
 -    ChibiOS/RT is free software; you can redistribute it and/or modify
 -    it under the terms of the GNU General Public License as published by
 -    the Free Software Foundation; either version 3 of the License, or
 -    (at your option) any later version.
 -
 -    ChibiOS/RT is distributed in the hope that it will be useful,
 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -    GNU General Public License for more details.
 -
 -    You should have received a copy of the GNU General Public License
 -    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -*/
 -
 -/*
 - * LPC1343 memory setup.
 - */
 -__main_stack_size__     = 0x0100;
 -__process_stack_size__  = 0x0100;
 -__stacks_total_size__   = __main_stack_size__ + __process_stack_size__;
 -
 -MEMORY
 -{
 -    flash : org = 0x00000000, len = 32k
 -    ram : org = 0x10000000, len = 8k
 -}
 -
 -__ram_start__           = ORIGIN(ram);
 -__ram_size__            = LENGTH(ram);
 -__ram_end__             = __ram_start__ + __ram_size__;
 -
 -SECTIONS
 -{
 -    . = 0;
 -    _text = .;
 -
 -    startup : ALIGN(16) SUBALIGN(16)
 -    {
 -        KEEP(*(vectors))
 -    } > flash
 -
 -    constructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__init_array_start = .);
 -        KEEP(*(SORT(.init_array.*)))
 -        KEEP(*(.init_array))
 -        PROVIDE(__init_array_end = .);
 -    } > flash
 -
 -    destructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__fini_array_start = .);
 -        KEEP(*(.fini_array))
 -        KEEP(*(SORT(.fini_array.*)))
 -        PROVIDE(__fini_array_end = .);
 -    } > flash
 -
 -    .text : ALIGN(16) SUBALIGN(16)
 -    {
 -        *(.text.startup.*)
 -        *(.text)
 -        *(.text.*)
 -        *(.rodata)
 -        *(.rodata.*)
 -        *(.glue_7t)
 -        *(.glue_7)
 -        *(.gcc*)
 -    } > flash
 -
 -    .ARM.extab :
 -    {
 -        *(.ARM.extab* .gnu.linkonce.armextab.*)
 -    } > flash
 -
 -    .ARM.exidx : {
 -        PROVIDE(__exidx_start = .);
 -        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
 -        PROVIDE(__exidx_end = .);
 -     } > flash
 -
 -    .eh_frame_hdr :
 -    {
 -        *(.eh_frame_hdr)
 -    } > flash
 -
 -    .eh_frame : ONLY_IF_RO
 -    {
 -        *(.eh_frame)
 -    } > flash
 -
 -    . = ALIGN(4);
 -    _etext = .;
 -    _textdata = _etext;
 -
 -    .data :
 -    {
 -        PROVIDE(_data = .);
 -        *(.data)
 -        . = ALIGN(4);
 -        *(.data.*)
 -        . = ALIGN(4);
 -        *(.ramtext)
 -        . = ALIGN(4);
 -        PROVIDE(_edata = .);
 -    } > ram AT > flash
 -
 -    .bss :
 -    {
 -        PROVIDE(_bss_start = .);
 -        *(.bss)
 -        . = ALIGN(4);
 -        *(.bss.*)
 -        . = ALIGN(4);
 -        *(COMMON)
 -        . = ALIGN(4);
 -        PROVIDE(_bss_end = .);
 -    } > ram    
 -}
 -
 -PROVIDE(end = .);
 -_end            = .;
 -
 -__heap_base__   = _end;
 -__heap_end__    = __ram_end__ - __stacks_total_size__;
 diff --git a/testhal/STM32F1xx/ADC/Makefile b/testhal/STM32F1xx/ADC/Makefile index a5c76f1c8..1312b4480 100644 --- a/testhal/STM32F1xx/ADC/Makefile +++ b/testhal/STM32F1xx/ADC/Makefile @@ -52,10 +52,7 @@ endif  # Define project name here
  PROJECT = ch
 -# Define linker script file here
 -LDSCRIPT= ch.ld
 -
 -# Imported source files
 +# Imported source files and paths
  CHIBIOS = ../../..
  include $(CHIBIOS)/boards/OLIMEX_STM32_P103/board.mk
  include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk
 @@ -64,6 +61,9 @@ include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk  include $(CHIBIOS)/os/kernel/kernel.mk
  #include $(CHIBIOS)/test/test.mk
 +# Define linker script file here
 +LDSCRIPT= $(PORTLD)/STM32F103xB.ld
 +
  # C sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
  CSRC = $(PORTSRC) \
 @@ -74,7 +74,7 @@ CSRC = $(PORTSRC) \         $(BOARDSRC) \
         $(CHIBIOS)/os/various/evtimer.c \
         $(CHIBIOS)/os/various/syscalls.c \
 -       main.c +       main.c
  # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
 diff --git a/testhal/STM32F1xx/CAN/Makefile b/testhal/STM32F1xx/CAN/Makefile index a5c76f1c8..1312b4480 100644 --- a/testhal/STM32F1xx/CAN/Makefile +++ b/testhal/STM32F1xx/CAN/Makefile @@ -52,10 +52,7 @@ endif  # Define project name here
  PROJECT = ch
 -# Define linker script file here
 -LDSCRIPT= ch.ld
 -
 -# Imported source files
 +# Imported source files and paths
  CHIBIOS = ../../..
  include $(CHIBIOS)/boards/OLIMEX_STM32_P103/board.mk
  include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk
 @@ -64,6 +61,9 @@ include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk  include $(CHIBIOS)/os/kernel/kernel.mk
  #include $(CHIBIOS)/test/test.mk
 +# Define linker script file here
 +LDSCRIPT= $(PORTLD)/STM32F103xB.ld
 +
  # C sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
  CSRC = $(PORTSRC) \
 @@ -74,7 +74,7 @@ CSRC = $(PORTSRC) \         $(BOARDSRC) \
         $(CHIBIOS)/os/various/evtimer.c \
         $(CHIBIOS)/os/various/syscalls.c \
 -       main.c +       main.c
  # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
 diff --git a/testhal/STM32F1xx/CAN/ch.ld b/testhal/STM32F1xx/CAN/ch.ld deleted file mode 100644 index 4d97e7682..000000000 --- a/testhal/STM32F1xx/CAN/ch.ld +++ /dev/null @@ -1,130 +0,0 @@ -/*
 -    ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
 -                 2011 Giovanni Di Sirio.
 -
 -    This file is part of ChibiOS/RT.
 -
 -    ChibiOS/RT is free software; you can redistribute it and/or modify
 -    it under the terms of the GNU General Public License as published by
 -    the Free Software Foundation; either version 3 of the License, or
 -    (at your option) any later version.
 -
 -    ChibiOS/RT is distributed in the hope that it will be useful,
 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -    GNU General Public License for more details.
 -
 -    You should have received a copy of the GNU General Public License
 -    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -*/
 -
 -/*
 - * ST32F103 memory setup.
 - */
 -__main_stack_size__     = 0x0400;
 -__process_stack_size__  = 0x0400;
 -__stacks_total_size__   = __main_stack_size__ + __process_stack_size__;
 -
 -MEMORY
 -{
 -    flash : org = 0x08000000, len = 128k
 -    ram : org = 0x20000000, len = 20k
 -}
 -
 -__ram_start__           = ORIGIN(ram);
 -__ram_size__            = LENGTH(ram);
 -__ram_end__             = __ram_start__ + __ram_size__;
 -
 -SECTIONS
 -{
 -    . = 0;
 -    _text = .;
 -
 -    startup : ALIGN(16) SUBALIGN(16)
 -    {
 -        KEEP(*(vectors))
 -    } > flash
 -
 -    constructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__init_array_start = .);
 -        KEEP(*(SORT(.init_array.*)))
 -        KEEP(*(.init_array))
 -        PROVIDE(__init_array_end = .);
 -    } > flash
 -
 -    destructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__fini_array_start = .);
 -        KEEP(*(.fini_array))
 -        KEEP(*(SORT(.fini_array.*)))
 -        PROVIDE(__fini_array_end = .);
 -    } > flash
 -
 -    .text : ALIGN(16) SUBALIGN(16)
 -    {
 -        *(.text.startup.*)
 -        *(.text)
 -        *(.text.*)
 -        *(.rodata)
 -        *(.rodata.*)
 -        *(.glue_7t)
 -        *(.glue_7)
 -        *(.gcc*)
 -    } > flash
 -
 -    .ARM.extab :
 -    {
 -        *(.ARM.extab* .gnu.linkonce.armextab.*)
 -    } > flash
 -
 -    .ARM.exidx : {
 -        PROVIDE(__exidx_start = .);
 -        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
 -        PROVIDE(__exidx_end = .);
 -     } > flash
 -
 -    .eh_frame_hdr :
 -    {
 -        *(.eh_frame_hdr)
 -    } > flash
 -
 -    .eh_frame : ONLY_IF_RO
 -    {
 -        *(.eh_frame)
 -    } > flash
 -
 -    . = ALIGN(4);
 -    _etext = .;
 -    _textdata = _etext;
 -
 -    .data :
 -    {
 -        PROVIDE(_data = .);
 -        *(.data)
 -        . = ALIGN(4);
 -        *(.data.*)
 -        . = ALIGN(4);
 -        *(.ramtext)
 -        . = ALIGN(4);
 -        PROVIDE(_edata = .);
 -    } > ram AT > flash
 -
 -    .bss :
 -    {
 -        PROVIDE(_bss_start = .);
 -        *(.bss)
 -        . = ALIGN(4);
 -        *(.bss.*)
 -        . = ALIGN(4);
 -        *(COMMON)
 -        . = ALIGN(4);
 -        PROVIDE(_bss_end = .);
 -    } > ram    
 -}
 -
 -PROVIDE(end = .);
 -_end            = .;
 -
 -__heap_base__   = _end;
 -__heap_end__    = __ram_end__ - __stacks_total_size__;
 diff --git a/testhal/STM32F1xx/GPT/Makefile b/testhal/STM32F1xx/GPT/Makefile index a5c76f1c8..1312b4480 100644 --- a/testhal/STM32F1xx/GPT/Makefile +++ b/testhal/STM32F1xx/GPT/Makefile @@ -52,10 +52,7 @@ endif  # Define project name here
  PROJECT = ch
 -# Define linker script file here
 -LDSCRIPT= ch.ld
 -
 -# Imported source files
 +# Imported source files and paths
  CHIBIOS = ../../..
  include $(CHIBIOS)/boards/OLIMEX_STM32_P103/board.mk
  include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk
 @@ -64,6 +61,9 @@ include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk  include $(CHIBIOS)/os/kernel/kernel.mk
  #include $(CHIBIOS)/test/test.mk
 +# Define linker script file here
 +LDSCRIPT= $(PORTLD)/STM32F103xB.ld
 +
  # C sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
  CSRC = $(PORTSRC) \
 @@ -74,7 +74,7 @@ CSRC = $(PORTSRC) \         $(BOARDSRC) \
         $(CHIBIOS)/os/various/evtimer.c \
         $(CHIBIOS)/os/various/syscalls.c \
 -       main.c +       main.c
  # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
 diff --git a/testhal/STM32F1xx/GPT/ch.ld b/testhal/STM32F1xx/GPT/ch.ld deleted file mode 100644 index 4d97e7682..000000000 --- a/testhal/STM32F1xx/GPT/ch.ld +++ /dev/null @@ -1,130 +0,0 @@ -/*
 -    ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
 -                 2011 Giovanni Di Sirio.
 -
 -    This file is part of ChibiOS/RT.
 -
 -    ChibiOS/RT is free software; you can redistribute it and/or modify
 -    it under the terms of the GNU General Public License as published by
 -    the Free Software Foundation; either version 3 of the License, or
 -    (at your option) any later version.
 -
 -    ChibiOS/RT is distributed in the hope that it will be useful,
 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -    GNU General Public License for more details.
 -
 -    You should have received a copy of the GNU General Public License
 -    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -*/
 -
 -/*
 - * ST32F103 memory setup.
 - */
 -__main_stack_size__     = 0x0400;
 -__process_stack_size__  = 0x0400;
 -__stacks_total_size__   = __main_stack_size__ + __process_stack_size__;
 -
 -MEMORY
 -{
 -    flash : org = 0x08000000, len = 128k
 -    ram : org = 0x20000000, len = 20k
 -}
 -
 -__ram_start__           = ORIGIN(ram);
 -__ram_size__            = LENGTH(ram);
 -__ram_end__             = __ram_start__ + __ram_size__;
 -
 -SECTIONS
 -{
 -    . = 0;
 -    _text = .;
 -
 -    startup : ALIGN(16) SUBALIGN(16)
 -    {
 -        KEEP(*(vectors))
 -    } > flash
 -
 -    constructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__init_array_start = .);
 -        KEEP(*(SORT(.init_array.*)))
 -        KEEP(*(.init_array))
 -        PROVIDE(__init_array_end = .);
 -    } > flash
 -
 -    destructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__fini_array_start = .);
 -        KEEP(*(.fini_array))
 -        KEEP(*(SORT(.fini_array.*)))
 -        PROVIDE(__fini_array_end = .);
 -    } > flash
 -
 -    .text : ALIGN(16) SUBALIGN(16)
 -    {
 -        *(.text.startup.*)
 -        *(.text)
 -        *(.text.*)
 -        *(.rodata)
 -        *(.rodata.*)
 -        *(.glue_7t)
 -        *(.glue_7)
 -        *(.gcc*)
 -    } > flash
 -
 -    .ARM.extab :
 -    {
 -        *(.ARM.extab* .gnu.linkonce.armextab.*)
 -    } > flash
 -
 -    .ARM.exidx : {
 -        PROVIDE(__exidx_start = .);
 -        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
 -        PROVIDE(__exidx_end = .);
 -     } > flash
 -
 -    .eh_frame_hdr :
 -    {
 -        *(.eh_frame_hdr)
 -    } > flash
 -
 -    .eh_frame : ONLY_IF_RO
 -    {
 -        *(.eh_frame)
 -    } > flash
 -
 -    . = ALIGN(4);
 -    _etext = .;
 -    _textdata = _etext;
 -
 -    .data :
 -    {
 -        PROVIDE(_data = .);
 -        *(.data)
 -        . = ALIGN(4);
 -        *(.data.*)
 -        . = ALIGN(4);
 -        *(.ramtext)
 -        . = ALIGN(4);
 -        PROVIDE(_edata = .);
 -    } > ram AT > flash
 -
 -    .bss :
 -    {
 -        PROVIDE(_bss_start = .);
 -        *(.bss)
 -        . = ALIGN(4);
 -        *(.bss.*)
 -        . = ALIGN(4);
 -        *(COMMON)
 -        . = ALIGN(4);
 -        PROVIDE(_bss_end = .);
 -    } > ram    
 -}
 -
 -PROVIDE(end = .);
 -_end            = .;
 -
 -__heap_base__   = _end;
 -__heap_end__    = __ram_end__ - __stacks_total_size__;
 diff --git a/testhal/STM32F1xx/IRQ_STORM/Makefile b/testhal/STM32F1xx/IRQ_STORM/Makefile index a5c76f1c8..1312b4480 100644 --- a/testhal/STM32F1xx/IRQ_STORM/Makefile +++ b/testhal/STM32F1xx/IRQ_STORM/Makefile @@ -52,10 +52,7 @@ endif  # Define project name here
  PROJECT = ch
 -# Define linker script file here
 -LDSCRIPT= ch.ld
 -
 -# Imported source files
 +# Imported source files and paths
  CHIBIOS = ../../..
  include $(CHIBIOS)/boards/OLIMEX_STM32_P103/board.mk
  include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk
 @@ -64,6 +61,9 @@ include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk  include $(CHIBIOS)/os/kernel/kernel.mk
  #include $(CHIBIOS)/test/test.mk
 +# Define linker script file here
 +LDSCRIPT= $(PORTLD)/STM32F103xB.ld
 +
  # C sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
  CSRC = $(PORTSRC) \
 @@ -74,7 +74,7 @@ CSRC = $(PORTSRC) \         $(BOARDSRC) \
         $(CHIBIOS)/os/various/evtimer.c \
         $(CHIBIOS)/os/various/syscalls.c \
 -       main.c +       main.c
  # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
 diff --git a/testhal/STM32F1xx/IRQ_STORM/ch.ld b/testhal/STM32F1xx/IRQ_STORM/ch.ld deleted file mode 100644 index 4d97e7682..000000000 --- a/testhal/STM32F1xx/IRQ_STORM/ch.ld +++ /dev/null @@ -1,130 +0,0 @@ -/*
 -    ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
 -                 2011 Giovanni Di Sirio.
 -
 -    This file is part of ChibiOS/RT.
 -
 -    ChibiOS/RT is free software; you can redistribute it and/or modify
 -    it under the terms of the GNU General Public License as published by
 -    the Free Software Foundation; either version 3 of the License, or
 -    (at your option) any later version.
 -
 -    ChibiOS/RT is distributed in the hope that it will be useful,
 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -    GNU General Public License for more details.
 -
 -    You should have received a copy of the GNU General Public License
 -    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -*/
 -
 -/*
 - * ST32F103 memory setup.
 - */
 -__main_stack_size__     = 0x0400;
 -__process_stack_size__  = 0x0400;
 -__stacks_total_size__   = __main_stack_size__ + __process_stack_size__;
 -
 -MEMORY
 -{
 -    flash : org = 0x08000000, len = 128k
 -    ram : org = 0x20000000, len = 20k
 -}
 -
 -__ram_start__           = ORIGIN(ram);
 -__ram_size__            = LENGTH(ram);
 -__ram_end__             = __ram_start__ + __ram_size__;
 -
 -SECTIONS
 -{
 -    . = 0;
 -    _text = .;
 -
 -    startup : ALIGN(16) SUBALIGN(16)
 -    {
 -        KEEP(*(vectors))
 -    } > flash
 -
 -    constructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__init_array_start = .);
 -        KEEP(*(SORT(.init_array.*)))
 -        KEEP(*(.init_array))
 -        PROVIDE(__init_array_end = .);
 -    } > flash
 -
 -    destructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__fini_array_start = .);
 -        KEEP(*(.fini_array))
 -        KEEP(*(SORT(.fini_array.*)))
 -        PROVIDE(__fini_array_end = .);
 -    } > flash
 -
 -    .text : ALIGN(16) SUBALIGN(16)
 -    {
 -        *(.text.startup.*)
 -        *(.text)
 -        *(.text.*)
 -        *(.rodata)
 -        *(.rodata.*)
 -        *(.glue_7t)
 -        *(.glue_7)
 -        *(.gcc*)
 -    } > flash
 -
 -    .ARM.extab :
 -    {
 -        *(.ARM.extab* .gnu.linkonce.armextab.*)
 -    } > flash
 -
 -    .ARM.exidx : {
 -        PROVIDE(__exidx_start = .);
 -        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
 -        PROVIDE(__exidx_end = .);
 -     } > flash
 -
 -    .eh_frame_hdr :
 -    {
 -        *(.eh_frame_hdr)
 -    } > flash
 -
 -    .eh_frame : ONLY_IF_RO
 -    {
 -        *(.eh_frame)
 -    } > flash
 -
 -    . = ALIGN(4);
 -    _etext = .;
 -    _textdata = _etext;
 -
 -    .data :
 -    {
 -        PROVIDE(_data = .);
 -        *(.data)
 -        . = ALIGN(4);
 -        *(.data.*)
 -        . = ALIGN(4);
 -        *(.ramtext)
 -        . = ALIGN(4);
 -        PROVIDE(_edata = .);
 -    } > ram AT > flash
 -
 -    .bss :
 -    {
 -        PROVIDE(_bss_start = .);
 -        *(.bss)
 -        . = ALIGN(4);
 -        *(.bss.*)
 -        . = ALIGN(4);
 -        *(COMMON)
 -        . = ALIGN(4);
 -        PROVIDE(_bss_end = .);
 -    } > ram    
 -}
 -
 -PROVIDE(end = .);
 -_end            = .;
 -
 -__heap_base__   = _end;
 -__heap_end__    = __ram_end__ - __stacks_total_size__;
 diff --git a/testhal/STM32F1xx/PWM-ICU/Makefile b/testhal/STM32F1xx/PWM-ICU/Makefile index a5c76f1c8..507d994f5 100644 --- a/testhal/STM32F1xx/PWM-ICU/Makefile +++ b/testhal/STM32F1xx/PWM-ICU/Makefile @@ -52,10 +52,7 @@ endif  # Define project name here
  PROJECT = ch
 -# Define linker script file here
 -LDSCRIPT= ch.ld
 -
 -# Imported source files
 +# Imported source files and paths
  CHIBIOS = ../../..
  include $(CHIBIOS)/boards/OLIMEX_STM32_P103/board.mk
  include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk
 @@ -74,7 +71,7 @@ CSRC = $(PORTSRC) \         $(BOARDSRC) \
         $(CHIBIOS)/os/various/evtimer.c \
         $(CHIBIOS)/os/various/syscalls.c \
 -       main.c +       main.c
  # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
 diff --git a/testhal/STM32F1xx/PWM-ICU/ch.ld b/testhal/STM32F1xx/PWM-ICU/ch.ld deleted file mode 100644 index 4d97e7682..000000000 --- a/testhal/STM32F1xx/PWM-ICU/ch.ld +++ /dev/null @@ -1,130 +0,0 @@ -/*
 -    ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
 -                 2011 Giovanni Di Sirio.
 -
 -    This file is part of ChibiOS/RT.
 -
 -    ChibiOS/RT is free software; you can redistribute it and/or modify
 -    it under the terms of the GNU General Public License as published by
 -    the Free Software Foundation; either version 3 of the License, or
 -    (at your option) any later version.
 -
 -    ChibiOS/RT is distributed in the hope that it will be useful,
 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -    GNU General Public License for more details.
 -
 -    You should have received a copy of the GNU General Public License
 -    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -*/
 -
 -/*
 - * ST32F103 memory setup.
 - */
 -__main_stack_size__     = 0x0400;
 -__process_stack_size__  = 0x0400;
 -__stacks_total_size__   = __main_stack_size__ + __process_stack_size__;
 -
 -MEMORY
 -{
 -    flash : org = 0x08000000, len = 128k
 -    ram : org = 0x20000000, len = 20k
 -}
 -
 -__ram_start__           = ORIGIN(ram);
 -__ram_size__            = LENGTH(ram);
 -__ram_end__             = __ram_start__ + __ram_size__;
 -
 -SECTIONS
 -{
 -    . = 0;
 -    _text = .;
 -
 -    startup : ALIGN(16) SUBALIGN(16)
 -    {
 -        KEEP(*(vectors))
 -    } > flash
 -
 -    constructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__init_array_start = .);
 -        KEEP(*(SORT(.init_array.*)))
 -        KEEP(*(.init_array))
 -        PROVIDE(__init_array_end = .);
 -    } > flash
 -
 -    destructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__fini_array_start = .);
 -        KEEP(*(.fini_array))
 -        KEEP(*(SORT(.fini_array.*)))
 -        PROVIDE(__fini_array_end = .);
 -    } > flash
 -
 -    .text : ALIGN(16) SUBALIGN(16)
 -    {
 -        *(.text.startup.*)
 -        *(.text)
 -        *(.text.*)
 -        *(.rodata)
 -        *(.rodata.*)
 -        *(.glue_7t)
 -        *(.glue_7)
 -        *(.gcc*)
 -    } > flash
 -
 -    .ARM.extab :
 -    {
 -        *(.ARM.extab* .gnu.linkonce.armextab.*)
 -    } > flash
 -
 -    .ARM.exidx : {
 -        PROVIDE(__exidx_start = .);
 -        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
 -        PROVIDE(__exidx_end = .);
 -     } > flash
 -
 -    .eh_frame_hdr :
 -    {
 -        *(.eh_frame_hdr)
 -    } > flash
 -
 -    .eh_frame : ONLY_IF_RO
 -    {
 -        *(.eh_frame)
 -    } > flash
 -
 -    . = ALIGN(4);
 -    _etext = .;
 -    _textdata = _etext;
 -
 -    .data :
 -    {
 -        PROVIDE(_data = .);
 -        *(.data)
 -        . = ALIGN(4);
 -        *(.data.*)
 -        . = ALIGN(4);
 -        *(.ramtext)
 -        . = ALIGN(4);
 -        PROVIDE(_edata = .);
 -    } > ram AT > flash
 -
 -    .bss :
 -    {
 -        PROVIDE(_bss_start = .);
 -        *(.bss)
 -        . = ALIGN(4);
 -        *(.bss.*)
 -        . = ALIGN(4);
 -        *(COMMON)
 -        . = ALIGN(4);
 -        PROVIDE(_bss_end = .);
 -    } > ram    
 -}
 -
 -PROVIDE(end = .);
 -_end            = .;
 -
 -__heap_base__   = _end;
 -__heap_end__    = __ram_end__ - __stacks_total_size__;
 diff --git a/testhal/STM32F1xx/SDIO/Makefile b/testhal/STM32F1xx/SDIO/Makefile index cf88c1190..af2aa97d8 100644 --- a/testhal/STM32F1xx/SDIO/Makefile +++ b/testhal/STM32F1xx/SDIO/Makefile @@ -55,7 +55,7 @@ PROJECT = ch  # Define linker script file here
  LDSCRIPT= ch.ld
 -# Imported source files
 +# Imported source files and paths
  CHIBIOS = ../../..
  include $(CHIBIOS)/boards/ST_STM3210E_EVAL/board.mk
  include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk
 @@ -64,6 +64,9 @@ include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk  include $(CHIBIOS)/os/kernel/kernel.mk
  #include $(CHIBIOS)/test/test.mk
 +# Define linker script file here
 +LDSCRIPT= $(PORTLD)/STM32F103xE.ld
 +
  # C sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
  CSRC = $(PORTSRC) \
 @@ -74,7 +77,7 @@ CSRC = $(PORTSRC) \         $(BOARDSRC) \
         $(CHIBIOS)/os/various/evtimer.c \
         $(CHIBIOS)/os/various/syscalls.c \
 -       main.c +       main.c
  # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
 diff --git a/testhal/STM32F1xx/SDIO/ch.ld b/testhal/STM32F1xx/SDIO/ch.ld deleted file mode 100644 index 363ddce9f..000000000 --- a/testhal/STM32F1xx/SDIO/ch.ld +++ /dev/null @@ -1,130 +0,0 @@ -/*
 -    ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
 -                 2011 Giovanni Di Sirio.
 -
 -    This file is part of ChibiOS/RT.
 -
 -    ChibiOS/RT is free software; you can redistribute it and/or modify
 -    it under the terms of the GNU General Public License as published by
 -    the Free Software Foundation; either version 3 of the License, or
 -    (at your option) any later version.
 -
 -    ChibiOS/RT is distributed in the hope that it will be useful,
 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -    GNU General Public License for more details.
 -
 -    You should have received a copy of the GNU General Public License
 -    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -*/
 -
 -/*
 - * ST32F103xG memory setup.
 - */
 -__main_stack_size__     = 0x0400;
 -__process_stack_size__  = 0x0400;
 -__stacks_total_size__   = __main_stack_size__ + __process_stack_size__;
 -
 -MEMORY
 -{
 -    flash : org = 0x08000000, len = 1m
 -    ram : org = 0x20000000, len = 96k
 -}
 -
 -__ram_start__           = ORIGIN(ram);
 -__ram_size__            = LENGTH(ram);
 -__ram_end__             = __ram_start__ + __ram_size__;
 -
 -SECTIONS
 -{
 -    . = 0;
 -    _text = .;
 -
 -    startup : ALIGN(16) SUBALIGN(16)
 -    {
 -        KEEP(*(vectors))
 -    } > flash
 -
 -    constructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__init_array_start = .);
 -        KEEP(*(SORT(.init_array.*)))
 -        KEEP(*(.init_array))
 -        PROVIDE(__init_array_end = .);
 -    } > flash
 -
 -    destructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__fini_array_start = .);
 -        KEEP(*(.fini_array))
 -        KEEP(*(SORT(.fini_array.*)))
 -        PROVIDE(__fini_array_end = .);
 -    } > flash
 -
 -    .text : ALIGN(16) SUBALIGN(16)
 -    {
 -        *(.text.startup.*)
 -        *(.text)
 -        *(.text.*)
 -        *(.rodata)
 -        *(.rodata.*)
 -        *(.glue_7t)
 -        *(.glue_7)
 -        *(.gcc*)
 -    } > flash
 -
 -    .ARM.extab :
 -    {
 -        *(.ARM.extab* .gnu.linkonce.armextab.*)
 -    } > flash
 -
 -    .ARM.exidx : {
 -        PROVIDE(__exidx_start = .);
 -        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
 -        PROVIDE(__exidx_end = .);
 -     } > flash
 -
 -    .eh_frame_hdr :
 -    {
 -        *(.eh_frame_hdr)
 -    } > flash
 -
 -    .eh_frame : ONLY_IF_RO
 -    {
 -        *(.eh_frame)
 -    } > flash
 -
 -    . = ALIGN(4);
 -    _etext = .;
 -    _textdata = _etext;
 -
 -    .data :
 -    {
 -        PROVIDE(_data = .);
 -        *(.data)
 -        . = ALIGN(4);
 -        *(.data.*)
 -        . = ALIGN(4);
 -        *(.ramtext)
 -        . = ALIGN(4);
 -        PROVIDE(_edata = .);
 -    } > ram AT > flash
 -
 -    .bss :
 -    {
 -        PROVIDE(_bss_start = .);
 -        *(.bss)
 -        . = ALIGN(4);
 -        *(.bss.*)
 -        . = ALIGN(4);
 -        *(COMMON)
 -        . = ALIGN(4);
 -        PROVIDE(_bss_end = .);
 -    } > ram    
 -}
 -
 -PROVIDE(end = .);
 -_end            = .;
 -
 -__heap_base__   = _end;
 -__heap_end__    = __ram_end__ - __stacks_total_size__;
 diff --git a/testhal/STM32F1xx/SPI/Makefile b/testhal/STM32F1xx/SPI/Makefile index a5c76f1c8..1312b4480 100644 --- a/testhal/STM32F1xx/SPI/Makefile +++ b/testhal/STM32F1xx/SPI/Makefile @@ -52,10 +52,7 @@ endif  # Define project name here
  PROJECT = ch
 -# Define linker script file here
 -LDSCRIPT= ch.ld
 -
 -# Imported source files
 +# Imported source files and paths
  CHIBIOS = ../../..
  include $(CHIBIOS)/boards/OLIMEX_STM32_P103/board.mk
  include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk
 @@ -64,6 +61,9 @@ include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk  include $(CHIBIOS)/os/kernel/kernel.mk
  #include $(CHIBIOS)/test/test.mk
 +# Define linker script file here
 +LDSCRIPT= $(PORTLD)/STM32F103xB.ld
 +
  # C sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
  CSRC = $(PORTSRC) \
 @@ -74,7 +74,7 @@ CSRC = $(PORTSRC) \         $(BOARDSRC) \
         $(CHIBIOS)/os/various/evtimer.c \
         $(CHIBIOS)/os/various/syscalls.c \
 -       main.c +       main.c
  # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
 diff --git a/testhal/STM32F1xx/SPI/ch.ld b/testhal/STM32F1xx/SPI/ch.ld deleted file mode 100644 index 4d97e7682..000000000 --- a/testhal/STM32F1xx/SPI/ch.ld +++ /dev/null @@ -1,130 +0,0 @@ -/*
 -    ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
 -                 2011 Giovanni Di Sirio.
 -
 -    This file is part of ChibiOS/RT.
 -
 -    ChibiOS/RT is free software; you can redistribute it and/or modify
 -    it under the terms of the GNU General Public License as published by
 -    the Free Software Foundation; either version 3 of the License, or
 -    (at your option) any later version.
 -
 -    ChibiOS/RT is distributed in the hope that it will be useful,
 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -    GNU General Public License for more details.
 -
 -    You should have received a copy of the GNU General Public License
 -    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -*/
 -
 -/*
 - * ST32F103 memory setup.
 - */
 -__main_stack_size__     = 0x0400;
 -__process_stack_size__  = 0x0400;
 -__stacks_total_size__   = __main_stack_size__ + __process_stack_size__;
 -
 -MEMORY
 -{
 -    flash : org = 0x08000000, len = 128k
 -    ram : org = 0x20000000, len = 20k
 -}
 -
 -__ram_start__           = ORIGIN(ram);
 -__ram_size__            = LENGTH(ram);
 -__ram_end__             = __ram_start__ + __ram_size__;
 -
 -SECTIONS
 -{
 -    . = 0;
 -    _text = .;
 -
 -    startup : ALIGN(16) SUBALIGN(16)
 -    {
 -        KEEP(*(vectors))
 -    } > flash
 -
 -    constructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__init_array_start = .);
 -        KEEP(*(SORT(.init_array.*)))
 -        KEEP(*(.init_array))
 -        PROVIDE(__init_array_end = .);
 -    } > flash
 -
 -    destructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__fini_array_start = .);
 -        KEEP(*(.fini_array))
 -        KEEP(*(SORT(.fini_array.*)))
 -        PROVIDE(__fini_array_end = .);
 -    } > flash
 -
 -    .text : ALIGN(16) SUBALIGN(16)
 -    {
 -        *(.text.startup.*)
 -        *(.text)
 -        *(.text.*)
 -        *(.rodata)
 -        *(.rodata.*)
 -        *(.glue_7t)
 -        *(.glue_7)
 -        *(.gcc*)
 -    } > flash
 -
 -    .ARM.extab :
 -    {
 -        *(.ARM.extab* .gnu.linkonce.armextab.*)
 -    } > flash
 -
 -    .ARM.exidx : {
 -        PROVIDE(__exidx_start = .);
 -        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
 -        PROVIDE(__exidx_end = .);
 -     } > flash
 -
 -    .eh_frame_hdr :
 -    {
 -        *(.eh_frame_hdr)
 -    } > flash
 -
 -    .eh_frame : ONLY_IF_RO
 -    {
 -        *(.eh_frame)
 -    } > flash
 -
 -    . = ALIGN(4);
 -    _etext = .;
 -    _textdata = _etext;
 -
 -    .data :
 -    {
 -        PROVIDE(_data = .);
 -        *(.data)
 -        . = ALIGN(4);
 -        *(.data.*)
 -        . = ALIGN(4);
 -        *(.ramtext)
 -        . = ALIGN(4);
 -        PROVIDE(_edata = .);
 -    } > ram AT > flash
 -
 -    .bss :
 -    {
 -        PROVIDE(_bss_start = .);
 -        *(.bss)
 -        . = ALIGN(4);
 -        *(.bss.*)
 -        . = ALIGN(4);
 -        *(COMMON)
 -        . = ALIGN(4);
 -        PROVIDE(_bss_end = .);
 -    } > ram    
 -}
 -
 -PROVIDE(end = .);
 -_end            = .;
 -
 -__heap_base__   = _end;
 -__heap_end__    = __ram_end__ - __stacks_total_size__;
 diff --git a/testhal/STM32F1xx/UART/Makefile b/testhal/STM32F1xx/UART/Makefile index a5c76f1c8..1312b4480 100644 --- a/testhal/STM32F1xx/UART/Makefile +++ b/testhal/STM32F1xx/UART/Makefile @@ -52,10 +52,7 @@ endif  # Define project name here
  PROJECT = ch
 -# Define linker script file here
 -LDSCRIPT= ch.ld
 -
 -# Imported source files
 +# Imported source files and paths
  CHIBIOS = ../../..
  include $(CHIBIOS)/boards/OLIMEX_STM32_P103/board.mk
  include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk
 @@ -64,6 +61,9 @@ include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk  include $(CHIBIOS)/os/kernel/kernel.mk
  #include $(CHIBIOS)/test/test.mk
 +# Define linker script file here
 +LDSCRIPT= $(PORTLD)/STM32F103xB.ld
 +
  # C sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
  CSRC = $(PORTSRC) \
 @@ -74,7 +74,7 @@ CSRC = $(PORTSRC) \         $(BOARDSRC) \
         $(CHIBIOS)/os/various/evtimer.c \
         $(CHIBIOS)/os/various/syscalls.c \
 -       main.c +       main.c
  # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
 diff --git a/testhal/STM32F1xx/UART/ch.ld b/testhal/STM32F1xx/UART/ch.ld deleted file mode 100644 index 4d97e7682..000000000 --- a/testhal/STM32F1xx/UART/ch.ld +++ /dev/null @@ -1,130 +0,0 @@ -/*
 -    ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
 -                 2011 Giovanni Di Sirio.
 -
 -    This file is part of ChibiOS/RT.
 -
 -    ChibiOS/RT is free software; you can redistribute it and/or modify
 -    it under the terms of the GNU General Public License as published by
 -    the Free Software Foundation; either version 3 of the License, or
 -    (at your option) any later version.
 -
 -    ChibiOS/RT is distributed in the hope that it will be useful,
 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -    GNU General Public License for more details.
 -
 -    You should have received a copy of the GNU General Public License
 -    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -*/
 -
 -/*
 - * ST32F103 memory setup.
 - */
 -__main_stack_size__     = 0x0400;
 -__process_stack_size__  = 0x0400;
 -__stacks_total_size__   = __main_stack_size__ + __process_stack_size__;
 -
 -MEMORY
 -{
 -    flash : org = 0x08000000, len = 128k
 -    ram : org = 0x20000000, len = 20k
 -}
 -
 -__ram_start__           = ORIGIN(ram);
 -__ram_size__            = LENGTH(ram);
 -__ram_end__             = __ram_start__ + __ram_size__;
 -
 -SECTIONS
 -{
 -    . = 0;
 -    _text = .;
 -
 -    startup : ALIGN(16) SUBALIGN(16)
 -    {
 -        KEEP(*(vectors))
 -    } > flash
 -
 -    constructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__init_array_start = .);
 -        KEEP(*(SORT(.init_array.*)))
 -        KEEP(*(.init_array))
 -        PROVIDE(__init_array_end = .);
 -    } > flash
 -
 -    destructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__fini_array_start = .);
 -        KEEP(*(.fini_array))
 -        KEEP(*(SORT(.fini_array.*)))
 -        PROVIDE(__fini_array_end = .);
 -    } > flash
 -
 -    .text : ALIGN(16) SUBALIGN(16)
 -    {
 -        *(.text.startup.*)
 -        *(.text)
 -        *(.text.*)
 -        *(.rodata)
 -        *(.rodata.*)
 -        *(.glue_7t)
 -        *(.glue_7)
 -        *(.gcc*)
 -    } > flash
 -
 -    .ARM.extab :
 -    {
 -        *(.ARM.extab* .gnu.linkonce.armextab.*)
 -    } > flash
 -
 -    .ARM.exidx : {
 -        PROVIDE(__exidx_start = .);
 -        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
 -        PROVIDE(__exidx_end = .);
 -     } > flash
 -
 -    .eh_frame_hdr :
 -    {
 -        *(.eh_frame_hdr)
 -    } > flash
 -
 -    .eh_frame : ONLY_IF_RO
 -    {
 -        *(.eh_frame)
 -    } > flash
 -
 -    . = ALIGN(4);
 -    _etext = .;
 -    _textdata = _etext;
 -
 -    .data :
 -    {
 -        PROVIDE(_data = .);
 -        *(.data)
 -        . = ALIGN(4);
 -        *(.data.*)
 -        . = ALIGN(4);
 -        *(.ramtext)
 -        . = ALIGN(4);
 -        PROVIDE(_edata = .);
 -    } > ram AT > flash
 -
 -    .bss :
 -    {
 -        PROVIDE(_bss_start = .);
 -        *(.bss)
 -        . = ALIGN(4);
 -        *(.bss.*)
 -        . = ALIGN(4);
 -        *(COMMON)
 -        . = ALIGN(4);
 -        PROVIDE(_bss_end = .);
 -    } > ram    
 -}
 -
 -PROVIDE(end = .);
 -_end            = .;
 -
 -__heap_base__   = _end;
 -__heap_end__    = __ram_end__ - __stacks_total_size__;
 diff --git a/testhal/STM32F1xx/USB_CDC/Makefile b/testhal/STM32F1xx/USB_CDC/Makefile index 8ebd984fb..92a70f199 100644 --- a/testhal/STM32F1xx/USB_CDC/Makefile +++ b/testhal/STM32F1xx/USB_CDC/Makefile @@ -52,10 +52,7 @@ endif  # Define project name here
  PROJECT = ch
 -# Define linker script file here
 -LDSCRIPT= ch.ld
 -
 -# Imported source files
 +# Imported source files and paths
  CHIBIOS = ../../..
  include $(CHIBIOS)/boards/OLIMEX_STM32_P103/board.mk
  include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk
 @@ -64,6 +61,9 @@ include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk  include $(CHIBIOS)/os/kernel/kernel.mk
  include $(CHIBIOS)/test/test.mk
 +# Define linker script file here
 +LDSCRIPT= $(PORTLD)/STM32F103xB.ld
 +
  # C sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
  CSRC = $(PORTSRC) \
 @@ -74,7 +74,7 @@ CSRC = $(PORTSRC) \         $(BOARDSRC) \
         $(CHIBIOS)/os/various/shell.c \
         $(CHIBIOS)/os/various/chprintf.c \
 -       main.c +       main.c
  # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
 diff --git a/testhal/STM32F1xx/USB_CDC/ch.ld b/testhal/STM32F1xx/USB_CDC/ch.ld deleted file mode 100644 index 4d97e7682..000000000 --- a/testhal/STM32F1xx/USB_CDC/ch.ld +++ /dev/null @@ -1,130 +0,0 @@ -/*
 -    ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
 -                 2011 Giovanni Di Sirio.
 -
 -    This file is part of ChibiOS/RT.
 -
 -    ChibiOS/RT is free software; you can redistribute it and/or modify
 -    it under the terms of the GNU General Public License as published by
 -    the Free Software Foundation; either version 3 of the License, or
 -    (at your option) any later version.
 -
 -    ChibiOS/RT is distributed in the hope that it will be useful,
 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -    GNU General Public License for more details.
 -
 -    You should have received a copy of the GNU General Public License
 -    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -*/
 -
 -/*
 - * ST32F103 memory setup.
 - */
 -__main_stack_size__     = 0x0400;
 -__process_stack_size__  = 0x0400;
 -__stacks_total_size__   = __main_stack_size__ + __process_stack_size__;
 -
 -MEMORY
 -{
 -    flash : org = 0x08000000, len = 128k
 -    ram : org = 0x20000000, len = 20k
 -}
 -
 -__ram_start__           = ORIGIN(ram);
 -__ram_size__            = LENGTH(ram);
 -__ram_end__             = __ram_start__ + __ram_size__;
 -
 -SECTIONS
 -{
 -    . = 0;
 -    _text = .;
 -
 -    startup : ALIGN(16) SUBALIGN(16)
 -    {
 -        KEEP(*(vectors))
 -    } > flash
 -
 -    constructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__init_array_start = .);
 -        KEEP(*(SORT(.init_array.*)))
 -        KEEP(*(.init_array))
 -        PROVIDE(__init_array_end = .);
 -    } > flash
 -
 -    destructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__fini_array_start = .);
 -        KEEP(*(.fini_array))
 -        KEEP(*(SORT(.fini_array.*)))
 -        PROVIDE(__fini_array_end = .);
 -    } > flash
 -
 -    .text : ALIGN(16) SUBALIGN(16)
 -    {
 -        *(.text.startup.*)
 -        *(.text)
 -        *(.text.*)
 -        *(.rodata)
 -        *(.rodata.*)
 -        *(.glue_7t)
 -        *(.glue_7)
 -        *(.gcc*)
 -    } > flash
 -
 -    .ARM.extab :
 -    {
 -        *(.ARM.extab* .gnu.linkonce.armextab.*)
 -    } > flash
 -
 -    .ARM.exidx : {
 -        PROVIDE(__exidx_start = .);
 -        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
 -        PROVIDE(__exidx_end = .);
 -     } > flash
 -
 -    .eh_frame_hdr :
 -    {
 -        *(.eh_frame_hdr)
 -    } > flash
 -
 -    .eh_frame : ONLY_IF_RO
 -    {
 -        *(.eh_frame)
 -    } > flash
 -
 -    . = ALIGN(4);
 -    _etext = .;
 -    _textdata = _etext;
 -
 -    .data :
 -    {
 -        PROVIDE(_data = .);
 -        *(.data)
 -        . = ALIGN(4);
 -        *(.data.*)
 -        . = ALIGN(4);
 -        *(.ramtext)
 -        . = ALIGN(4);
 -        PROVIDE(_edata = .);
 -    } > ram AT > flash
 -
 -    .bss :
 -    {
 -        PROVIDE(_bss_start = .);
 -        *(.bss)
 -        . = ALIGN(4);
 -        *(.bss.*)
 -        . = ALIGN(4);
 -        *(COMMON)
 -        . = ALIGN(4);
 -        PROVIDE(_bss_end = .);
 -    } > ram    
 -}
 -
 -PROVIDE(end = .);
 -_end            = .;
 -
 -__heap_base__   = _end;
 -__heap_end__    = __ram_end__ - __stacks_total_size__;
 diff --git a/testhal/STM32F1xx/USB_MSC/Makefile b/testhal/STM32F1xx/USB_MSC/Makefile index b98b34374..81feb6170 100644 --- a/testhal/STM32F1xx/USB_MSC/Makefile +++ b/testhal/STM32F1xx/USB_MSC/Makefile @@ -52,10 +52,7 @@ endif  # Define project name here
  PROJECT = ch
 -# Define linker script file here
 -LDSCRIPT= ch.ld
 -
 -# Imported source files
 +# Imported source files and paths
  CHIBIOS = ../../..
  include $(CHIBIOS)/boards/OLIMEX_STM32_P103/board.mk
  include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk
 @@ -64,6 +61,9 @@ include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32/port.mk  include $(CHIBIOS)/os/kernel/kernel.mk
  include $(CHIBIOS)/test/test.mk
 +# Define linker script file here
 +LDSCRIPT= $(PORTLD)/STM32F103xB.ld
 +
  # C sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
  CSRC = $(PORTSRC) \
 @@ -75,7 +75,7 @@ CSRC = $(PORTSRC) \         $(CHIBIOS)/os/various/usb_msc.c \
         $(CHIBIOS)/os/various/evtimer.c \
         $(CHIBIOS)/os/various/syscalls.c \
 -       main.c +       main.c
  # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
 diff --git a/testhal/STM32F1xx/USB_MSC/ch.ld b/testhal/STM32F1xx/USB_MSC/ch.ld deleted file mode 100644 index 4d97e7682..000000000 --- a/testhal/STM32F1xx/USB_MSC/ch.ld +++ /dev/null @@ -1,130 +0,0 @@ -/*
 -    ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
 -                 2011 Giovanni Di Sirio.
 -
 -    This file is part of ChibiOS/RT.
 -
 -    ChibiOS/RT is free software; you can redistribute it and/or modify
 -    it under the terms of the GNU General Public License as published by
 -    the Free Software Foundation; either version 3 of the License, or
 -    (at your option) any later version.
 -
 -    ChibiOS/RT is distributed in the hope that it will be useful,
 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -    GNU General Public License for more details.
 -
 -    You should have received a copy of the GNU General Public License
 -    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -*/
 -
 -/*
 - * ST32F103 memory setup.
 - */
 -__main_stack_size__     = 0x0400;
 -__process_stack_size__  = 0x0400;
 -__stacks_total_size__   = __main_stack_size__ + __process_stack_size__;
 -
 -MEMORY
 -{
 -    flash : org = 0x08000000, len = 128k
 -    ram : org = 0x20000000, len = 20k
 -}
 -
 -__ram_start__           = ORIGIN(ram);
 -__ram_size__            = LENGTH(ram);
 -__ram_end__             = __ram_start__ + __ram_size__;
 -
 -SECTIONS
 -{
 -    . = 0;
 -    _text = .;
 -
 -    startup : ALIGN(16) SUBALIGN(16)
 -    {
 -        KEEP(*(vectors))
 -    } > flash
 -
 -    constructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__init_array_start = .);
 -        KEEP(*(SORT(.init_array.*)))
 -        KEEP(*(.init_array))
 -        PROVIDE(__init_array_end = .);
 -    } > flash
 -
 -    destructors : ALIGN(4) SUBALIGN(4)
 -    {
 -        PROVIDE(__fini_array_start = .);
 -        KEEP(*(.fini_array))
 -        KEEP(*(SORT(.fini_array.*)))
 -        PROVIDE(__fini_array_end = .);
 -    } > flash
 -
 -    .text : ALIGN(16) SUBALIGN(16)
 -    {
 -        *(.text.startup.*)
 -        *(.text)
 -        *(.text.*)
 -        *(.rodata)
 -        *(.rodata.*)
 -        *(.glue_7t)
 -        *(.glue_7)
 -        *(.gcc*)
 -    } > flash
 -
 -    .ARM.extab :
 -    {
 -        *(.ARM.extab* .gnu.linkonce.armextab.*)
 -    } > flash
 -
 -    .ARM.exidx : {
 -        PROVIDE(__exidx_start = .);
 -        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
 -        PROVIDE(__exidx_end = .);
 -     } > flash
 -
 -    .eh_frame_hdr :
 -    {
 -        *(.eh_frame_hdr)
 -    } > flash
 -
 -    .eh_frame : ONLY_IF_RO
 -    {
 -        *(.eh_frame)
 -    } > flash
 -
 -    . = ALIGN(4);
 -    _etext = .;
 -    _textdata = _etext;
 -
 -    .data :
 -    {
 -        PROVIDE(_data = .);
 -        *(.data)
 -        . = ALIGN(4);
 -        *(.data.*)
 -        . = ALIGN(4);
 -        *(.ramtext)
 -        . = ALIGN(4);
 -        PROVIDE(_edata = .);
 -    } > ram AT > flash
 -
 -    .bss :
 -    {
 -        PROVIDE(_bss_start = .);
 -        *(.bss)
 -        . = ALIGN(4);
 -        *(.bss.*)
 -        . = ALIGN(4);
 -        *(COMMON)
 -        . = ALIGN(4);
 -        PROVIDE(_bss_end = .);
 -    } > ram    
 -}
 -
 -PROVIDE(end = .);
 -_end            = .;
 -
 -__heap_base__   = _end;
 -__heap_end__    = __ram_end__ - __stacks_total_size__;
 | 
