# # This Source Code Form is subject to the terms of the MIT License. # If a copy of the MIT License was not distributed with this file, # you can obtain one at https://opensource.org/licenses/MIT # #compiler flags CFLAGS = -mthumb -mcpu=cortex-m4 -g3 -O0 -Wall -Wextra #linker flags LDFLAGS = -T link.ld -nostartfiles #cross compiler CC = arm-none-eabi-gcc all: main.o swd.o target.o uart.o startup.o system.o $(CC) $(LDFLAGS) $(CFLAGS) $^ -o img.elf image.bin: img.elf arm-none-eabi-objcopy -O binary img.elf $@ flash: image.bin sudo st-flash write $^ 0x08000000 bin: image.bin dfu: image.bin sudo dfu-util --alt 0 -D image.bin --dfuse-address 0x08000000 clean: rm -f *.o st/startup_stm32f0.o *.elf image.bin tags