Skip to content

Commit

Permalink
Changed STM32F4 makefile so hard-float version of libc.a is used, usb…
Browse files Browse the repository at this point in the history
…_cdcacm example now successfully compiles.
  • Loading branch information
mlamoore committed Nov 14, 2012
1 parent 70746cc commit 23b185e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/stm32/f4/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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
LDSCRIPT ?= $(BINARY).ld
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
OBJS += $(BINARY).o
Expand Down

2 comments on commit 23b185e

@esden
Copy link

@esden esden commented on 23b185e Nov 14, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mlamoore
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.