From ecb24e55bf39fbae2d12329c6215470eda031562 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Mon, 24 Oct 2016 17:35:44 +0200 Subject: [PATCH 1/2] cpu/stm32f103cb: generalized linkerscript --- cpu/stm32f1/ldscripts/stm32f103cb.ld | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/stm32f1/ldscripts/stm32f103cb.ld b/cpu/stm32f1/ldscripts/stm32f103cb.ld index 601fb652c6..37188f3677 100644 --- a/cpu/stm32f1/ldscripts/stm32f103cb.ld +++ b/cpu/stm32f1/ldscripts/stm32f103cb.ld @@ -20,7 +20,7 @@ MEMORY { - rom (rx) : ORIGIN = 0x08005000, LENGTH = 128K-0x5000 + rom (rx) : ORIGIN = 0x08000000, LENGTH = 128K ram (xrw) : ORIGIN = 0x20000000, LENGTH = 20K cpuid (r) : ORIGIN = 0x1ffff7e8, LENGTH = 12 } From f2eb4618f23d336b65fc6f3e9099a08a2e8f9c03 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Mon, 24 Oct 2016 17:36:31 +0200 Subject: [PATCH 2/2] boards/spark-core: added custom linkerscript --- boards/spark-core/Makefile.include | 3 ++ .../ldscripts/stm32f103cb_sparkcore.ld | 30 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 cpu/stm32f1/ldscripts/stm32f103cb_sparkcore.ld diff --git a/boards/spark-core/Makefile.include b/boards/spark-core/Makefile.include index 7ab641a023..7ff46a0183 100644 --- a/boards/spark-core/Makefile.include +++ b/boards/spark-core/Makefile.include @@ -2,6 +2,9 @@ export CPU = stm32f1 export CPU_MODEL = stm32f103cb +# the spark-core uses its own custom linkerscript... +export LINKER_SCRIPT = stm32f103cb_sparkcore.ld + # set the default port export PORT ?= /dev/ttyUSB0 diff --git a/cpu/stm32f1/ldscripts/stm32f103cb_sparkcore.ld b/cpu/stm32f1/ldscripts/stm32f103cb_sparkcore.ld new file mode 100644 index 0000000000..c5d3ca8361 --- /dev/null +++ b/cpu/stm32f1/ldscripts/stm32f103cb_sparkcore.ld @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2015 Freie Universität Berlin + * + * This file is subject to the terms and conditions of the GNU Lesser + * General Public License v2.1. See the file LICENSE in the top level + * directory for more details. + */ + +/** + * @addtogroup cpu_stm32f1 + * @{ + * + * @file + * @brief Spark-core specific memory definitions for the STM32F103CB + * + * @author Hauke Petersen + * + * @} + */ + +MEMORY +{ + rom (rx) : ORIGIN = 0x08005000, LENGTH = 128K-0x5000 + ram (xrw) : ORIGIN = 0x20000000, LENGTH = 20K + cpuid (r) : ORIGIN = 0x1ffff7e8, LENGTH = 12 +} + +_cpuid_address = ORIGIN(cpuid); + +INCLUDE cortexm_base.ld