1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:32:45 +01:00

makefiles/tools/avrdude: Improved debug handling

- Choose correct debug protocol for ATmega328P (which supports debugWIRE instead
  of JTAG)
- Allow overwriting debugger device via AVR_DEBUGDEVICE environment variable,
  default to the Atmel-ICE (least expensive, supports most AVR devices)
This commit is contained in:
Marian Buschsieweke 2019-03-27 15:59:29 +01:00
parent edd93411fe
commit f2edcf9674
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F
2 changed files with 13 additions and 5 deletions

View File

@ -5,7 +5,4 @@ BAUD ?= 115200
# Use EDBG (xplainedpro) programmer with avrdude
PROGRAMMER ?= xplainedpro
# Use edbg interface for debugging
DEBUGSERVER_INTERFACE ?= --edbg
include $(RIOTBOARD)/common/atmega/Makefile.include

View File

@ -3,8 +3,19 @@ DIST_PATH = $(BOARDSDIR)/$(BOARD)/dist
AVARICE_PATH = $(RIOTTOOLS)/avarice
DEBUGSERVER_PORT = 4242
DEBUGSERVER = $(AVARICE_PATH)/debug_srv.sh
DEBUGSERVER_INTERFACE ?=
DEBUGSERVER_FLAGS = "-g -j usb $(DEBUGSERVER_INTERFACE) :$(DEBUGSERVER_PORT)"
# Allow choosing debugger hardware via AVR_DEBUGDEVICE, default to Atmel ICE,
# which is compatible to all AVR devices and since the AVR Dragon is no longer
# produced, the least expensive option
AVR_DEBUGDEVICE ?= --edbg
AVR_DEBUGINTERFACE ?= usb
ifneq (,$(filter $(CPU),atmega328p))
# Use debugWIRE as protocol for debugging (ATmega328P does not support JTAG)
DEBUGPROTO := -w
else
# Use JTAG as protocol for debugging
DEBUGPROTO := -j $(AVR_DEBUGINTERFACE)
endif
DEBUGSERVER_FLAGS = "$(AVR_DEBUGDEVICE) $(DEBUGPROTO) :$(DEBUGSERVER_PORT)"
DEBUGGER_FLAGS = "-x $(AVARICE_PATH)/gdb.conf $(ELFFILE)"
DEBUGGER = "$(AVARICE_PATH)/debug.sh" $(DEBUGSERVER_FLAGS) $(AVARICE_PATH) $(DEBUGSERVER_PORT)