From ac520b0676466f2240a904262b9146a5b466da03 Mon Sep 17 00:00:00 2001 From: treymarc Date: Sat, 24 May 2014 20:40:12 +0000 Subject: [PATCH] usf hardware fpu with target stm32f30x --- Makefile | 2 +- src/drivers/system_common.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 68d47c857..7e183d892 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ INCLUDE_DIRS := $(INCLUDE_DIRS) \ LD_SCRIPT = $(ROOT)/stm32_flash_f303.ld -ARCH_FLAGS = -mthumb -mcpu=cortex-m4 +ARCH_FLAGS = -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 DEVICE_FLAGS = -DSTM32F303xC TARGET_FLAGS = -D$(TARGET) ifeq ($(TARGET),CHEBUZZF3) diff --git a/src/drivers/system_common.c b/src/drivers/system_common.c index b07b276ec..73f5d9ace 100755 --- a/src/drivers/system_common.c +++ b/src/drivers/system_common.c @@ -59,6 +59,12 @@ uint32_t millis(void) void systemInit(bool overclock) { + +#ifdef STM32F303xC + // start fpu + SCB->CPACR = (0x3 << (10*2)) | (0x3 << (11*2)); +#endif + struct { GPIO_TypeDef *gpio; gpio_config_t cfg;