Skip to content

Commit 535804a

Browse files
committed
stmhal/Makefile: Use hardware double-prec FP for MCUs that support it.
1 parent d20f8fb commit 535804a

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

stmhal/Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,17 @@ INC += -I$(HAL_DIR)/inc
4848
INC += -I$(USBDEV_DIR)/core/inc -I$(USBDEV_DIR)/class/inc
4949
#INC += -I$(USBHOST_DIR)
5050

51-
CFLAGS_CORTEX_M = -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard
51+
# Basic Cortex-M flags
52+
CFLAGS_CORTEX_M = -mthumb
53+
54+
# Select hardware floating-point support
55+
ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),STM32F767xx STM32F769xx))
56+
CFLAGS_CORTEX_M += -mfpu=fpv5-d16 -mfloat-abi=hard
57+
else
58+
CFLAGS_CORTEX_M += -mfpu=fpv4-sp-d16 -mfloat-abi=hard
59+
endif
60+
61+
# Options for particular MCU series
5262
CFLAGS_MCU_f4 = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4 -DMCU_SERIES_F4
5363
CFLAGS_MCU_f7 = $(CFLAGS_CORTEX_M) -mtune=cortex-m7 -mcpu=cortex-m7 -DMCU_SERIES_F7
5464
CFLAGS_MCU_l4 = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4 -DMCU_SERIES_L4

0 commit comments

Comments
 (0)