aboutsummaryrefslogtreecommitdiff
path: root/lib/stm32/f4
diff options
context:
space:
mode:
authorchrysn2012-10-17 18:55:54 +0200
committerchrysn2012-10-17 18:55:54 +0200
commit7c33025c318bcc43cfcd3a23a76d14b299fecc0a (patch)
tree491adcf9ada616f15c435929e878c5ca3cddc568 /lib/stm32/f4
parenta69d83d312396ee604426dce5341a54316c7c9b5 (diff)
parent0a483449654e18189ff017f70d6b97888cdba382 (diff)
Merge branch 'master' into generalizations
Conflicts: lib/lm3s/vector.c -- split out to lm3s/irq.h lib/stm32/f4/vector.c -- put the floating point initialization code into a function like in lpc43xx
Diffstat (limited to 'lib/stm32/f4')
-rw-r--r--lib/stm32/f4/Makefile3
-rw-r--r--lib/stm32/f4/vector.c31
2 files changed, 33 insertions, 1 deletions
diff --git a/lib/stm32/f4/Makefile b/lib/stm32/f4/Makefile
index 85870a7..fd0b279 100644
--- a/lib/stm32/f4/Makefile
+++ b/lib/stm32/f4/Makefile
@@ -24,7 +24,8 @@ PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CFLAGS = -Os -g -Wall -Wextra -I../../../include -fno-common \
- -mcpu=cortex-m3 -mthumb -Wstrict-prototypes \
+ -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 \
+ -Wstrict-prototypes \
-ffunction-sections -fdata-sections -MD -DSTM32F4
# ARFLAGS = rcsv
ARFLAGS = rcs
diff --git a/lib/stm32/f4/vector.c b/lib/stm32/f4/vector.c
index 8d158a6..a5017b3 100644
--- a/lib/stm32/f4/vector.c
+++ b/lib/stm32/f4/vector.c
@@ -1,2 +1,33 @@
+/*
+ * This file is part of the libopencm3 project.
+ *
+ * Copyright (C) 2010 Piotr Esden-Tempski <piotr@esden.net>
+ * Copyright (C) 2011 Fergus Noble <fergusnoble@gmail.com>
+ *
+ * This library is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This library 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
#include <libopencm3/stm32/f4/irq.h>
+#define reset_handler original_reset_handler
#include "../../cm3/vector.c"
+#undef reset_handler
+#include <libopencm3/stm32/f4/scb.h>
+
+void WEAK reset_handler(void)
+{
+ /* Enable access to Floating-Point coprocessor. */
+ SCB_CPACR |= SCB_CPACR_FULL * (SCB_CPACR_CP10 | SCB_CPACR_CP11);
+
+ original_reset_handler();
+}