From 1a316c5a2f47277e5bad21d1f7d8aa6e6bea0dd9 Mon Sep 17 00:00:00 2001 From: dragonmux Date: Wed, 8 Jun 2022 04:58:42 -0400 Subject: [PATCH] platforms/f3: moved the linker script and fixed the build system We need build the right libopencm3 library which is not done by default, so this adds an extra build step for it --- src/platforms/f3/Makefile.inc | 8 +++++++- src/platforms/{f3 => stm32}/stm32f303xc.ld | 0 2 files changed, 7 insertions(+), 1 deletion(-) rename src/platforms/{f3 => stm32}/stm32f303xc.ld (100%) diff --git a/src/platforms/f3/Makefile.inc b/src/platforms/f3/Makefile.inc index 66351c5..c7dc25a 100644 --- a/src/platforms/f3/Makefile.inc +++ b/src/platforms/f3/Makefile.inc @@ -8,7 +8,7 @@ CFLAGS += -Istm32/include -mcpu=cortex-m4 -mthumb \ -DDFU_SERIAL_LENGTH=13 -Iplatforms/stm32 LDFLAGS = --specs=nano.specs -lopencm3_stm32f3 \ - -Wl,-T,platforms/f3-if/stm32f303xc.ld -nostartfiles -lc -lnosys \ + -Wl,-T,platforms/stm32/stm32f303xc.ld -nostartfiles -lc -lnosys \ -Wl,-Map=mapfile -mthumb -mcpu=cortex-m4 -Wl,-gc-sections \ -mfloat-abi=hard -mfpu=fpv4-sp-d16 \ -L../libopencm3/lib @@ -24,6 +24,12 @@ SRC += cdcacm.c \ timing_stm32.c \ all: blackmagic.bin +blackmagic.elf: libopencm3_stm32f3 + +libopencm3_stm32f3: + $(Q)$(MAKE) $(MFLAGS) -C ../libopencm3 lib/stm32/f3 host_clean: -$(Q)$(RM) blackmagic.bin + +.PHONY: libopencm3_stm32f3 diff --git a/src/platforms/f3/stm32f303xc.ld b/src/platforms/stm32/stm32f303xc.ld similarity index 100% rename from src/platforms/f3/stm32f303xc.ld rename to src/platforms/stm32/stm32f303xc.ld