From e5a10ba0c5252b61a43886c47b70bbbf06cb15af Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 1 Apr 2012 12:33:00 +0000 Subject: Fixed bug 3513897. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4068 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32F4xx/USB_CDC/Makefile | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'testhal/STM32F4xx/USB_CDC') diff --git a/testhal/STM32F4xx/USB_CDC/Makefile b/testhal/STM32F4xx/USB_CDC/Makefile index 9085c6f37..0f32eeceb 100644 --- a/testhal/STM32F4xx/USB_CDC/Makefile +++ b/testhal/STM32F4xx/USB_CDC/Makefile @@ -41,6 +41,12 @@ endif # Architecture or project specific options # +# Enables the use of FPU on Cortex-M4. +# Enable this if you really want to use the STM FWLib. +ifeq ($(USE_FPU),) + USE_FPU = no +endif + # Enable this if you really want to use the STM FWLib. ifeq ($(USE_FWLIB),) USE_FWLIB = no @@ -58,7 +64,7 @@ endif PROJECT = ch # Imported source files and paths -CHIBIOS = ../../.. +CHIBIOS = ../.. include $(CHIBIOS)/boards/ST_STM32F4_DISCOVERY/board.mk include $(CHIBIOS)/os/hal/platforms/STM32F4xx/platform.mk include $(CHIBIOS)/os/hal/hal.mk @@ -68,6 +74,7 @@ include $(CHIBIOS)/test/test.mk # Define linker script file here LDSCRIPT= $(PORTLD)/STM32F407xG.ld +#LDSCRIPT= $(PORTLD)/STM32F407xG_CCM.ld # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. @@ -77,7 +84,7 @@ CSRC = $(PORTSRC) \ $(HALSRC) \ $(PLATFORMSRC) \ $(BOARDSRC) \ - $(CHIBIOS)/os/various/shell.c \ + $(CHIBIOS)/os/various/lis302dl.c \ $(CHIBIOS)/os/various/chprintf.c \ main.c @@ -158,7 +165,7 @@ CPPWARN = -Wall -Wextra # # List all default C defines here, like -D_DEBUG=1 -DDEFS = -DCORTEX_USE_FPU=0 +DDEFS = # List all default ASM defines here, like -D_DEBUG=1 DADEFS = @@ -199,6 +206,13 @@ ULIBS = # End of user defines ############################################################################## +ifeq ($(USE_FPU),yes) + USE_OPT += -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -fsingle-precision-constant + DDEFS += -DCORTEX_USE_FPU=TRUE +else + DDEFS += -DCORTEX_USE_FPU=FALSE +endif + ifeq ($(USE_FWLIB),yes) include $(CHIBIOS)/ext/stm32lib/stm32lib.mk CSRC += $(STM32SRC) -- cgit v1.2.3