Skip to content

Commit

Permalink
feat(Makefile.posix): Impl {startdebug,debug-gdbinit}.stlinkv2
Browse files Browse the repository at this point in the history
  • Loading branch information
wldhx committed Feb 10, 2017
1 parent 24a1cd2 commit 838f8a1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions make/Makefile.posix
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,26 @@ from-scratch: all flash.jlink flash-softdevice
$(MAKE_BUILD_FOLDER)
$(JLINK) $(OUTPUT_PATH)flash.jlink

startdebug: debug-gdbinit
startdebug: startdebug.jlink

startdebug.jlink: debug-gdbinit.jlink
$(TERMINAL) "$(JLINKGDBSERVER) -port $(GDB_PORT_NUMBER)"
sleep 1
$(TERMINAL) "$(GDB) $(ELF)"

startdebug.stlinkv2: debug-gdbinit.stlinkv2
$(GDB) $(ELF)

startrtt:
$(TERMINAL) "JLinkExe -device nrf51822 -if swd -speed 1000 -AutoConnect 1"
sleep 1
$(TERMINAL) "$(JLINKRTTCLIENT)"

debug-gdbinit:
debug-gdbinit.jlink:
printf "target remote localhost:$(GDB_PORT_NUMBER)\nload\nmon reset\nbreak main\n" > .gdbinit

debug-gdbinit.stlinkv2:
printf "target remote | $(OPENOCD) -c 'gdb_port pipe; log_output openocd.log'" > .gdbinit


.PHONY: flash flash-softdevice erase-all startdebug test-softdevice flash.jlink

0 comments on commit 838f8a1

Please sign in to comment.