blue-pill: fix bootloader.

This commit is contained in:
2018-03-07 19:50:01 -08:00
parent 524f860331
commit 5734a63997
10 changed files with 188 additions and 73 deletions

View File

@@ -14,10 +14,11 @@ LD := $(ARMTC)-gcc
AS := $(ARMTC)-as
ARMSIZE := $(ARMTC)-size
OBJCOPY := $(ARMTC)-objcopy
PAGER ?= less
# compiler options
CPUFLAGS := -mcpu=cortex-m3 -mthumb -std=c99
CFLAGS := -Wall -Wextra -Os -MD $(CPUFLAGS)
CFLAGS := -Wall -Wextra -Os -MD $(CPUFLAGS) -g
LDFLAGS := $(CPUFLAGS) -nostartfiles -Wl,-T,bluepill.ld
LDLIBS := -lc -lnosys
@@ -49,10 +50,21 @@ flash: $(BIN)
erase:
st-flash erase
.PHONY: reset
reset:
st-flash reset
.PHONY: install
install: erase flash
install: erase flash reset
.PHONY: clean
clean:
rm -f *.o *.bin *.elf *.d *.map
.PHONY: disass
disass: $(ELF)
$(ARMTC)-objdump -D $(ELF) | $(PAGER)
.PHONY: dump
dump: $(ELF)
$(ARMTC)-objcopy -D $(ELF) > $(TARGET).dump