Skip to content
This repository has been archived by the owner on Apr 13, 2021. It is now read-only.

Commit

Permalink
Build for F4 hard-fp, use installed versions of locm3 and libswiftnav.
Browse files Browse the repository at this point in the history
  • Loading branch information
fnoble committed Feb 7, 2013
1 parent 1fe9a00 commit 1f6d512
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ libswiftnav:
@printf "BUILD libswiftnav\n"; \
$(MAKE) -C libswiftnav $(MAKEFLAGS)

firmware: libswiftnav
firmware:
@printf "BUILD src\n"; \
$(MAKE) -C src $(MAKEFLAGS)

Expand Down
21 changes: 10 additions & 11 deletions stm32/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,16 @@ CC = $(PREFIX)-gcc
LD = $(PREFIX)-gcc
OBJCOPY = $(PREFIX)-objcopy
OBJDUMP = $(PREFIX)-objdump
# Uncomment this line if you want to use the installed (not local) library.
#TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX)
TOOLCHAIN_DIR = $(SWIFTNAV_ROOT)/../libopencm3
CFLAGS += -O0 -g -Wall -Wextra -Werror -I$(TOOLCHAIN_DIR)/include -I$(SWIFTNAV_ROOT)\
-fno-common -mcpu=cortex-m3 -mthumb -msoft-float -MD -DSTM32F2 \
-DGIT_VERSION="\"$(GIT_VERSION)\"" -std=gnu99
CFLAGS += -O0 -g -Wall -Wextra -Werror -std=gnu99 \
-fno-common -MD -DSTM32F4 -DGIT_VERSION="\"$(GIT_VERSION)\"" \
-mcpu=cortex-m4 -march=armv7e-m -mthumb \
-mfloat-abi=hard -mfpu=fpv4-sp-d16

LDSCRIPT = $(SWIFTNAV_ROOT)/stm32/swiftnav.ld
LDFLAGS += -lc -lnosys -L$(TOOLCHAIN_DIR)/lib -L$(SWIFTNAV_ROOT)/libswiftnav \
-L$(TOOLCHAIN_DIR)/lib/stm32/f4 \
-T$(LDSCRIPT) -nostartfiles -Wl,--gc-sections \
-mthumb -march=armv7 -mfix-cortex-m3-ldrd -msoft-float -lm
LDFLAGS += -lc -lnosys -T$(LDSCRIPT) -nostartfiles -Wl,--gc-sections \
-mcpu=cortex-m4 -march=armv7e-m -mthumb \
-mfloat-abi=hard -mfpu=fpv4-sp-d16 \
-lopencm3_stm32f4 -lswiftnav-static-cortex-m4 -lm

OOCD ?= openocd
OOCD_INTERFACE ?= flossjtag
Expand Down Expand Up @@ -81,7 +80,7 @@ flash: $(BINARY).flash

%.elf: $(OBJS)
@printf " LD $(subst $(shell pwd)/,,$(@))\n"
$(Q)$(LD) -o $(*).elf $(OBJS) -lopencm3_stm32f4 -lswiftnav-arm -Xlinker -Map=$(*).map $(LDFLAGS)
$(Q)$(LD) -o $(*).elf $(OBJS) -Xlinker -Map=$(*).map $(LDFLAGS)

%.o: %.c Makefile
@printf " CC $(subst $(shell pwd)/,,$(@))\n"
Expand Down

0 comments on commit 1f6d512

Please sign in to comment.