aboutsummaryrefslogtreecommitdiffstats
path: root/app/Makefile
diff options
context:
space:
mode:
authorroot <root@ka-ata-killa.ourano.james.local>2021-03-03 15:24:13 +0000
committerroot <root@ka-ata-killa.ourano.james.local>2021-03-03 16:03:28 +0000
commit49148e76706e5e24c2ba7f6ccc1d7ec4736ab2f3 (patch)
treef65cb7440711ea1708c25fe78819e9986b2d8566 /app/Makefile
parent129a103238d69bd90b4fe9a44bbed943b9488fc2 (diff)
downloadserial_over_dp-49148e76706e5e24c2ba7f6ccc1d7ec4736ab2f3.tar.gz
serial_over_dp-49148e76706e5e24c2ba7f6ccc1d7ec4736ab2f3.tar.bz2
serial_over_dp-49148e76706e5e24c2ba7f6ccc1d7ec4736ab2f3.zip
support cheap chinese blue pill boards, make usb dfu compatible with dfuse
Diffstat (limited to 'app/Makefile')
-rw-r--r--app/Makefile29
1 files changed, 26 insertions, 3 deletions
diff --git a/app/Makefile b/app/Makefile
index dc5503b..e264ad4 100644
--- a/app/Makefile
+++ b/app/Makefile
@@ -24,7 +24,7 @@ PROG=serial_over_dp
V=1
default: ${PROG}.elf
-CSRCS= main.c cdcacm.c dfu.c i2c_bb.c vuart.c ring.c usart.c i2c_hw.c ticker.c ddc.c
+CSRCS= main.c cdcacm.c dfu.c i2c_bb.c vuart.c ring.c usart.c i2c_hw.c ticker.c ddc.c dummy_kb.c usb.c
HSRCS = project.h
@@ -38,14 +38,37 @@ VID=$(shell printf '\#include "id.h"\nID_VENDOR' | ${CC} -I.. -E - | grep -v ^\#
INCLUDES += -I..
-dfu:${PROG}.dfu
- dfu-util -R -a 0 -d ${VID}:${DID} -s 0x08002000:leave -D $<
+
+%.bin: %.elf
+ $(Q)$(OBJCOPY) -Obinary $(*).elf $(*).bin
+
+%.dfu:%.bin
+ ../tools/dfuse-pack.py -D 0x483:0xff03 -b 0x08002000:$< $@
+
+dfu:${PROG}.bin
+ dfu-util -R -a 0 -d 0483:ff03,0483:df11 -s 0x08002000:leave -D $<
program: ${PROG}.elf
echo halt | nc -t localhost 4444
echo flash write_image erase ${PWD}/$< 0x2000 | nc -t localhost 4444
echo reset run | nc -t localhost 4444
+ds:
+ $(Q)$(OOCD) -f $(OOCD_INTERFACE) \
+ -f $(OOCD_BOARD) \
+
+debug: ${PROG}.elf
+ ${PREFIX}-gdb -x gdb.script ${PROG}.elf
+
+reset:
+ $(Q)$(OOCD) -f $(OOCD_INTERFACE) \
+ -f $(OOCD_BOARD) \
+ -c "init" -c "reset run" \
+ -c shutdown
+
+
+
+
protos:
echo -n > prototypes.h
${CPROTO} $(INCLUDES) $(DEFINES) -e -v ${CSRCS} > prototypes.h.tmp