aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Serpell2012-08-22 00:05:08 -0400
committerNicolas Schodet2012-09-27 23:12:18 +0200
commite4819d3cd284e76339887a45598269dbe1479da7 (patch)
tree90326b079cd380c3840bf25ea12de6011f033701
parent584052c28cdfe5c383f13471deb891ba9438843a (diff)
Enable floating-point coprocessor on reset.
Always enable the floating-point coprocessor with full access on reset, allowing usage of hard-fp toolchains.
-rw-r--r--lib/stm32/f4/vector.c5
1 files changed, 5 insertions, 0 deletions
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 <http://www.gnu.org/licenses/>.
*/
+#include <libopencm3/stm32/f4/scb.h>
+
#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;