Skip to content
Browse files

Changed STM32F4 makefile so hard-float version of libc.a is used, usb…

…_cdcacm example now successfully compiles.
1 parent 70746cc commit 23b185ef32d3c1d75381052143212edd6573ef95 @nagromo committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 examples/stm32/f4/Makefile.include
4 examples/stm32/f4/Makefile.include
@@ -43,8 +43,8 @@ CFLAGS += -Os -g -Wall -Wextra -I$(TOOLCHAIN_DIR)/include \
-fno-common -mcpu=cortex-m4 -mthumb \
-mfloat-abi=hard -mfpu=fpv4-sp-d16 -MD -DSTM32F4
-LDFLAGS += --static -lc -lnosys -L$(TOOLCHAIN_DIR)/lib \
- -L$(TOOLCHAIN_DIR)/lib/stm32/f4 \
+LDFLAGS += --static -lc -lnosys \
+ -L$(TOOLCHAIN_DIR)/lib/thumb/cortex-m4/float-abi-hard/fpuv4-sp-d16 \
-T$(LDSCRIPT) -nostartfiles -Wl,--gc-sections \
-mthumb -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16

2 comments on commit 23b185e


Providing explicit path to the libraries should not be necessary. The compiler should be choosing the right directory based on the -mthumb -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 parameters.


That is what I expected also, but I have three computers where I got that linker error, and the two of them where I explicitly gave the path, it compiled and ran properly.

Could it be that the original makefile gave both /lib and /lib/stm32/f4; could that be overriding the automatic selection? I'll try that when I can; if not, it seems like a bug in the toolchain.

Please sign in to comment.
Something went wrong with that request. Please try again.