add support for debugserver
Change-Id: Ib22d9c06ba7816c3b870973d16e1c25229f31e1f Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
3cf1d29d34
commit
54634d6a43
2 changed files with 22 additions and 0 deletions
10
Makefile.inc
10
Makefile.inc
|
@ -72,6 +72,16 @@ endif
|
|||
flash: $(DOTCONFIG)
|
||||
$(Q)$(call zephyrmake,$(O),$@)
|
||||
|
||||
ifeq ($(MAKECMDGOALS),debugserver)
|
||||
-include $(ZEPHYR_BASE)/boards/$(BOARD)/Makefile.board
|
||||
-include $(ZEPHYR_BASE)/scripts/Makefile.toolchain.$(ZEPHYR_GCC_VARIANT)
|
||||
BOARD_NAME = $(BOARD)
|
||||
export BOARD_NAME
|
||||
endif
|
||||
debugserver: FORCE
|
||||
$(Q)$(CONFIG_SHELL) $(ZEPHYR_BASE)/scripts/support/$(FLASH_SCRIPT) debugserver
|
||||
|
||||
|
||||
initconfig: $(DOTCONFIG)
|
||||
|
||||
menuconfig: initconfig
|
||||
|
|
12
scripts/support/openocd.sh
Normal file → Executable file
12
scripts/support/openocd.sh
Normal file → Executable file
|
@ -41,6 +41,15 @@ do_flash() {
|
|||
echo 'Done flashing'
|
||||
}
|
||||
|
||||
do_debugserver() {
|
||||
test_config
|
||||
test_ports
|
||||
# start OpenOCD as GDB server
|
||||
sh -c "${OPENOCD_CMD} -f '${OPENOCD_CONFIG}' \
|
||||
-c 'init' \
|
||||
-c 'targets' \
|
||||
-c 'reset halt'"
|
||||
}
|
||||
|
||||
CMD="$1"
|
||||
shift
|
||||
|
@ -50,4 +59,7 @@ case "${CMD}" in
|
|||
echo "Flashing Target Device"
|
||||
do_flash "$@"
|
||||
;;
|
||||
debugserver)
|
||||
do_debugserver "$@"
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue