diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-12-08 11:02:02 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-12-08 11:02:02 +0000 |
commit | ffdf5831594cbe5f5326b537e49aad6caf2fbf70 (patch) | |
tree | 20dcdc5c7cd78841863dcb5f7190c8128514c138 | |
parent | f8f59580aefc512e14857aa381d3824ec2f5624b (diff) | |
download | ChibiOS-ffdf5831594cbe5f5326b537e49aad6caf2fbf70.tar.gz ChibiOS-ffdf5831594cbe5f5326b537e49aad6caf2fbf70.tar.bz2 ChibiOS-ffdf5831594cbe5f5326b537e49aad6caf2fbf70.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3580 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | demos/ARMCM4-STM32F407-DISCOVERY/Makefile | 2 | ||||
-rw-r--r-- | os/ports/GCC/ARMCMx/LPC11xx/ld/LPC1114.ld | 7 | ||||
-rw-r--r-- | os/ports/GCC/ARMCMx/LPC13xx/ld/LPC1343.ld | 7 | ||||
-rw-r--r-- | os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F100xB.ld | 7 | ||||
-rw-r--r-- | os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xB.ld | 7 | ||||
-rw-r--r-- | os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xE.ld | 7 | ||||
-rw-r--r-- | os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xG.ld | 7 | ||||
-rw-r--r-- | os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F107xC.ld | 7 | ||||
-rw-r--r-- | os/ports/GCC/ARMCMx/STM32F4xx/ld/STM32F407xG.ld | 7 | ||||
-rw-r--r-- | os/ports/GCC/ARMCMx/STM32F4xx/ld/STM32F407xG_CCM.ld | 173 | ||||
-rw-r--r-- | os/ports/GCC/ARMCMx/STM32L1xx/ld/STM32L152xB.ld | 7 | ||||
-rw-r--r-- | os/ports/GCC/ARMCMx/rules.mk | 2 | ||||
-rw-r--r-- | readme.txt | 5 |
13 files changed, 216 insertions, 29 deletions
diff --git a/demos/ARMCM4-STM32F407-DISCOVERY/Makefile b/demos/ARMCM4-STM32F407-DISCOVERY/Makefile index 28a823c16..d6c23ea1f 100644 --- a/demos/ARMCM4-STM32F407-DISCOVERY/Makefile +++ b/demos/ARMCM4-STM32F407-DISCOVERY/Makefile @@ -67,7 +67,7 @@ include $(CHIBIOS)/os/kernel/kernel.mk include $(CHIBIOS)/test/test.mk
# Define linker script file here
-LDSCRIPT= $(PORTLD)/STM32F407xG.ld
+LDSCRIPT= $(PORTLD)/STM32F407xG_CCM.ld
# C sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
diff --git a/os/ports/GCC/ARMCMx/LPC11xx/ld/LPC1114.ld b/os/ports/GCC/ARMCMx/LPC11xx/ld/LPC1114.ld index 6964c4467..23b6d7a88 100644 --- a/os/ports/GCC/ARMCMx/LPC11xx/ld/LPC1114.ld +++ b/os/ports/GCC/ARMCMx/LPC11xx/ld/LPC1114.ld @@ -93,13 +93,14 @@ SECTIONS *(.eh_frame)
} > flash
- .endtext : ONLY_IF_RO
+ .textalign : ONLY_IF_RO
{
. = ALIGN(8);
- _etext = .;
- _textdata = _etext;
} > flash
+ _etext = .;
+ _textdata = _etext;
+
.stacks :
{
. = ALIGN(8);
diff --git a/os/ports/GCC/ARMCMx/LPC13xx/ld/LPC1343.ld b/os/ports/GCC/ARMCMx/LPC13xx/ld/LPC1343.ld index cbd12b2aa..517aa3e44 100644 --- a/os/ports/GCC/ARMCMx/LPC13xx/ld/LPC1343.ld +++ b/os/ports/GCC/ARMCMx/LPC13xx/ld/LPC1343.ld @@ -93,13 +93,14 @@ SECTIONS *(.eh_frame)
} > flash
- .endtext : ONLY_IF_RO
+ .textalign : ONLY_IF_RO
{
. = ALIGN(8);
- _etext = .;
- _textdata = _etext;
} > flash
+ _etext = .;
+ _textdata = _etext;
+
.stacks :
{
. = ALIGN(8);
diff --git a/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F100xB.ld b/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F100xB.ld index 8045d210d..301f4f37f 100644 --- a/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F100xB.ld +++ b/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F100xB.ld @@ -93,13 +93,14 @@ SECTIONS *(.eh_frame)
} > flash
- .endtext : ONLY_IF_RO
+ .textalign : ONLY_IF_RO
{
. = ALIGN(8);
- _etext = .;
- _textdata = _etext;
} > flash
+ _etext = .;
+ _textdata = _etext;
+
.stacks :
{
. = ALIGN(8);
diff --git a/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xB.ld b/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xB.ld index 4dd94bd7d..f1b7a089a 100644 --- a/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xB.ld +++ b/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xB.ld @@ -93,13 +93,14 @@ SECTIONS *(.eh_frame)
} > flash
- .endtext : ONLY_IF_RO
+ .textalign : ONLY_IF_RO
{
. = ALIGN(8);
- _etext = .;
- _textdata = _etext;
} > flash
+ _etext = .;
+ _textdata = _etext;
+
.stacks :
{
. = ALIGN(8);
diff --git a/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xE.ld b/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xE.ld index c200c342b..16049fa32 100644 --- a/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xE.ld +++ b/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xE.ld @@ -93,13 +93,14 @@ SECTIONS *(.eh_frame)
} > flash
- .endtext : ONLY_IF_RO
+ .textalign : ONLY_IF_RO
{
. = ALIGN(8);
- _etext = .;
- _textdata = _etext;
} > flash
+ _etext = .;
+ _textdata = _etext;
+
.stacks :
{
. = ALIGN(8);
diff --git a/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xG.ld b/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xG.ld index 614ef3187..6b66f9406 100644 --- a/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xG.ld +++ b/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xG.ld @@ -93,13 +93,14 @@ SECTIONS *(.eh_frame)
} > flash
- .endtext : ONLY_IF_RO
+ .textalign : ONLY_IF_RO
{
. = ALIGN(8);
- _etext = .;
- _textdata = _etext;
} > flash
+ _etext = .;
+ _textdata = _etext;
+
.stacks :
{
. = ALIGN(8);
diff --git a/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F107xC.ld b/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F107xC.ld index 0b7604ac8..9e95543a2 100644 --- a/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F107xC.ld +++ b/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F107xC.ld @@ -93,13 +93,14 @@ SECTIONS *(.eh_frame)
} > flash
- .endtext : ONLY_IF_RO
+ .textalign : ONLY_IF_RO
{
. = ALIGN(8);
- _etext = .;
- _textdata = _etext;
} > flash
+ _etext = .;
+ _textdata = _etext;
+
.stacks :
{
. = ALIGN(8);
diff --git a/os/ports/GCC/ARMCMx/STM32F4xx/ld/STM32F407xG.ld b/os/ports/GCC/ARMCMx/STM32F4xx/ld/STM32F407xG.ld index d3533a8f2..27716a62f 100644 --- a/os/ports/GCC/ARMCMx/STM32F4xx/ld/STM32F407xG.ld +++ b/os/ports/GCC/ARMCMx/STM32F4xx/ld/STM32F407xG.ld @@ -95,13 +95,14 @@ SECTIONS *(.eh_frame)
} > flash
- .endtext : ONLY_IF_RO
+ .textalign : ONLY_IF_RO
{
. = ALIGN(8);
- _etext = .;
- _textdata = _etext;
} > flash
+ _etext = .;
+ _textdata = _etext;
+
.stacks :
{
. = ALIGN(8);
diff --git a/os/ports/GCC/ARMCMx/STM32F4xx/ld/STM32F407xG_CCM.ld b/os/ports/GCC/ARMCMx/STM32F4xx/ld/STM32F407xG_CCM.ld new file mode 100644 index 000000000..b11a2cca1 --- /dev/null +++ b/os/ports/GCC/ARMCMx/STM32F4xx/ld/STM32F407xG_CCM.ld @@ -0,0 +1,173 @@ +/*
+ 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/>.
+*/
+
+/*
+ * ST32F407xG memory setup.
+ */
+__main_stack_size__ = 0x0400;
+__process_stack_size__ = 0x0400;
+
+MEMORY
+{
+ flash : org = 0x08000000, len = 1M
+ ram : org = 0x20000000, len = 112k
+ ethram : org = 0x2001C000, len = 16k
+ ccmram : org = 0x10000000, len = 64k
+}
+
+__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
+
+ .textalign : ONLY_IF_RO
+ {
+ . = ALIGN(8);
+ } > flash
+
+ _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__ = .;
+ } > ccmram
+
+ .ccm :
+ {
+ PROVIDE(_cmm_start = .);
+ . = ALIGN(4);
+ *(.bss.mainthread.*)
+ . = ALIGN(4);
+ *(.bss._idle_thread_wa)
+ . = ALIGN(4);
+ *(.bss.rlist)
+ . = ALIGN(4);
+ *(.bss.vtlist)
+ . = ALIGN(4);
+ *(.bss.endmem)
+ . = ALIGN(4);
+ *(.bss.nextmem)
+ . = ALIGN(4);
+ *(.bss.default_heap)
+ . = ALIGN(4);
+ PROVIDE(_cmmend = .);
+ } > ccmram
+
+ .data :
+ {
+ . = ALIGN(4);
+ PROVIDE(_data = .);
+ *(.data)
+ . = ALIGN(4);
+ *(.data.*)
+ . = ALIGN(4);
+ *(.ramtext)
+ . = ALIGN(4);
+ PROVIDE(_edata = .);
+ } > ram AT > flash
+
+ .bss :
+ {
+ . = ALIGN(4);
+ 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__;
diff --git a/os/ports/GCC/ARMCMx/STM32L1xx/ld/STM32L152xB.ld b/os/ports/GCC/ARMCMx/STM32L1xx/ld/STM32L152xB.ld index a4f78b500..342dd3556 100644 --- a/os/ports/GCC/ARMCMx/STM32L1xx/ld/STM32L152xB.ld +++ b/os/ports/GCC/ARMCMx/STM32L1xx/ld/STM32L152xB.ld @@ -93,13 +93,14 @@ SECTIONS *(.eh_frame)
} > flash
- .endtext : ONLY_IF_RO
+ .textalign : ONLY_IF_RO
{
. = ALIGN(8);
- _etext = .;
- _textdata = _etext;
} > flash
+ _etext = .;
+ _textdata = _etext;
+
.stacks :
{
. = ALIGN(8);
diff --git a/os/ports/GCC/ARMCMx/rules.mk b/os/ports/GCC/ARMCMx/rules.mk index cda8ceda2..e53105e1c 100644 --- a/os/ports/GCC/ARMCMx/rules.mk +++ b/os/ports/GCC/ARMCMx/rules.mk @@ -15,7 +15,7 @@ OPT = $(USE_OPT) COPT = $(USE_COPT)
CPPOPT = $(USE_CPPOPT)
ifeq ($(USE_LINK_GC),yes)
- OPT += -ffunction-sections -fdata-sections
+ OPT += -ffunction-sections -fdata-sections -fno-common
endif
# Source files groups and paths
diff --git a/readme.txt b/readme.txt index cb5ef15ca..d53e7fb73 100644 --- a/readme.txt +++ b/readme.txt @@ -76,6 +76,11 @@ *** 2.3.5 ***
- FIX: Fixed SYSCFG clock not started in STM32L1/F4 HALs (bug 3449139).
- FIX: Fixed wrong definitions in STM32L-Discovery board file (bug 3449076).
+- NEW: Modified the STM32F4-Discovery demo to put critical kernel data
+ structures and stacks in the CCM RAM instead normal RAM. It is done using
+ a special .ld file that can be customized to decide how to allocate data
+ in the various RAM sections.
+- NEW: Improved I2C driver model and STM32 implementation by Barthess.
*** 2.3.4 ***
- FIX: Fixed Extra initialization in STM32 SPI driver (bug 3436127)
|