1 Star 0 Fork 0

QK0920/Avem

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 1.81 KB
一键复制 编辑 原始数据 按行查看 历史
but0n 提交于 2017-06-05 22:43 . feat: (ISP) jump to bootloader
# general Makefile
# make OptLIB=0 OptSRC=0 all tshow
include Makefile.common
LDFLAGS=$(COMMONFLAGS) -fno-exceptions -ffunction-sections -fdata-sections -L$(LIBDIR) -nostartfiles -Wl,--gc-sections,-Tlinker.ld
LDLIBS+=-lm
LDLIBS+=-lstm32
STARTUP=startup.c
all: libs src
$(CC) -o $(PROGRAM).elf $(LDFLAGS) \
-Wl,--whole-archive \
src/app.a \
-Wl,--no-whole-archive \
$(LDLIBS)
$(OBJCOPY) -O ihex $(PROGRAM).elf $(PROGRAM).hex
$(OBJCOPY) -O binary $(PROGRAM).elf $(PROGRAM).bin
#Extract info contained in ELF to readable text-files:
arm-none-eabi-readelf -a $(PROGRAM).elf > $(PROGRAM).info_elf
arm-none-eabi-size -d -B -t $(PROGRAM).elf > $(PROGRAM).info_size
arm-none-eabi-objdump -S $(PROGRAM).elf > $(PROGRAM).info_code
arm-none-eabi-nm -t d -S --size-sort -s $(PROGRAM).elf > $(PROGRAM).info_symbol
.PHONY: libs src clean tshow
libs:
$(MAKE) -C libs $@
src:
$(MAKE) -C src $@
clean:
$(MAKE) -C src $@
$(MAKE) -C libs $@
rm -f $(PROGRAM).elf $(PROGRAM).hex $(PROGRAM).bin $(PROGRAM).info_elf $(PROGRAM).info_size
rm -f $(PROGRAM).info_code
rm -f $(PROGRAM).info_symbol
rm -f DUMP.s
tshow:
@echo "=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_"
@echo "=🍺====>> optimize settings: $(InfoTextLib), $(InfoTextSrc)"
@echo "=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_"
isp: /dev/cu.SLAB_USBtoUART main.bin
cat -u /dev/cu.SLAB_USBtoUART & stty -f /dev/cu.SLAB_USBtoUART 115200
echo '>' > /dev/cu.SLAB_USBtoUART
pkill cat -u /dev/cu.SLAB_USBtoUART
make flash || make flash
flash: /dev/cu.SLAB_USBtoUART main.bin
stm32flash -w $(TOP)/main.bin -v -g 0 /dev/tty.SLAB_USBtoUART
dump:
$(OBJDUMP) -D main.elf > DUMP.s
open DUMP.s
tty:
screen /dev/tty.SLAB_USBtoUART 115200
dfu:
dfu-util -d 0483:df11 -c 1 -a 0 -s 0x08000000:leave -D main.bin
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/QK0920/avem.git
[email protected]:QK0920/avem.git
QK0920
avem
Avem
master

搜索帮助