From e4819d3cd284e76339887a45598269dbe1479da7 Mon Sep 17 00:00:00 2001 From: Daniel Serpell Date: Wed, 22 Aug 2012 00:05:08 -0400 Subject: Enable floating-point coprocessor on reset. Always enable the floating-point coprocessor with full access on reset, allowing usage of hard-fp toolchains. --- lib/stm32/f4/vector.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') diff --git a/lib/stm32/f4/vector.c b/lib/stm32/f4/vector.c index 3429bfb..01b5e64 100644 --- a/lib/stm32/f4/vector.c +++ b/lib/stm32/f4/vector.c @@ -18,6 +18,8 @@ * along with this library. If not, see . */ +#include + #define WEAK __attribute__ ((weak)) /* Symbols exported by the linker script(s): */ @@ -224,6 +226,9 @@ void reset_handler(void) __asm__("MSR msp, %0" : : "r"(&_stack)); + /* Enable access to Floating-Point coprocessor. */ + SCB_CPACR |= SCB_CPACR_FULL * (SCB_CPACR_CP10 | SCB_CPACR_CP11); + for (src = &_data_loadaddr, dest = &_data; dest < &_edata; src++, dest++) *dest = *src; -- cgit v1.2.3