-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1113 from Ant-ON/flash_loader_rework
Flash loader rework
- Loading branch information
Showing
13 changed files
with
329 additions
and
311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
# Note that according to the original GPLed code, compiling is noted to be | ||
# as simple as gcc -c, this fails with my tests where this will lead to a wrong | ||
# address read by the program. | ||
# This makefile will save your time from dealing with compile errors | ||
# Adjust CC if needed | ||
# The flash loader code cannot be compiled by the system gcc. This | ||
# makefile use arm-none-eabi-gcc for this purpose | ||
|
||
CC = /opt/local/gcc-arm-none-eabi-8-2018-q4-major/bin/arm-none-eabi-gcc | ||
CROSS_COMPILE ?= arm-none-eabi- | ||
|
||
CFLAGS_thumb1 = -mcpu=Cortex-M0 -Tlinker.ld -ffreestanding -nostdlib | ||
CFLAGS_thumb2 = -mcpu=Cortex-M3 -Tlinker.ld -ffreestanding -nostdlib | ||
CC = $(CROSS_COMPILE)gcc | ||
OBJCOPY = $(CROSS_COMPILE)objcopy | ||
|
||
all: stm32vl.o stm32f0.o stm32l.o stm32f4.o stm32f4_lv.o stm32l4.o stm32f7.o stm32f7_lv.o | ||
XXD = xxd | ||
XXDFLAGS = -i -c 4 | ||
|
||
stm32vl.o: stm32f0.s | ||
$(CC) stm32f0.s $(CFLAGS_thumb2) -o stm32vl.o | ||
stm32f0.o: stm32f0.s | ||
$(CC) stm32f0.s $(CFLAGS_thumb1) -o stm32f0.o | ||
stm32l.o: stm32lx.s | ||
$(CC) stm32lx.s $(CFLAGS_thumb2) -o stm32l.o | ||
stm32f4.o: stm32f4.s | ||
$(CC) stm32f4.s $(CFLAGS_thumb2) -o stm32f4.o | ||
stm32f4_lv.o: stm32f4lv.s | ||
$(CC) stm32f4lv.s $(CFLAGS_thumb2) -o stm32f4_lv.o | ||
stm32l4.o: stm32l4.s | ||
$(CC) stm32l4.s $(CFLAGS_thumb2) -o stm32l4.o | ||
stm32f7.o: stm32f7.s | ||
$(CC) stm32f7.s $(CFLAGS_thumb2) -o stm32f7.o | ||
stm32f7_lv.o: stm32f7lv.s | ||
$(CC) stm32f7lv.s $(CFLAGS_thumb2) -o stm32f7_lv.o | ||
CFLAGS_ARMV6_M = -mcpu=Cortex-M0 -Tlinker.ld -ffreestanding -nostdlib | ||
CFLAGS_ARMV7_M = -mcpu=Cortex-M3 -Tlinker.ld -ffreestanding -nostdlib | ||
|
||
clean: | ||
rm *.o | ||
all: stm32vl.h stm32f0.h stm32lx.h stm32f4.h stm32f4lv.h stm32l4.h stm32f7.h stm32f7lv.h | ||
|
||
|
||
%.h: %.bin | ||
$(XXD) $(XXDFLAGS) $< $@ | ||
|
||
%.bin: %.o | ||
$(OBJCOPY) -O binary $< $@ | ||
rm $< | ||
|
||
# separate rule for STM32F0 | ||
stm32f0.o: stm32f0.s | ||
$(CC) stm32f0.s $(CFLAGS_ARMV6_M) -o stm32f0.o | ||
|
||
# separate rule for STM32F1/F3 | ||
stm32vl.o: stm32f0.s | ||
$(CC) stm32f0.s $(CFLAGS_ARMV7_M) -o stm32vl.o | ||
|
||
# generic rule for all other ARMv7-M | ||
%.o: *.s | ||
$(CC) $< $(CFLAGS_ARMV7_M) -o $@ | ||
|
||
clean: | ||
rm -f *.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.