diff --git a/boards/cc2650-launchpad/Makefile.include b/boards/cc2650-launchpad/Makefile.include index 6453ba1dd5..3533a21c86 100644 --- a/boards/cc2650-launchpad/Makefile.include +++ b/boards/cc2650-launchpad/Makefile.include @@ -1,6 +1,4 @@ XDEBUGGER = XDS110 -OPENOCD_CONFIG ?= $(BOARDDIR)/dist/openocd.cfg - # configure the flash tool include $(RIOTBOARD)/common/cc26xx_cc13xx/Makefile.include diff --git a/boards/cc2650-launchpad/dist/openocd.cfg b/boards/cc2650-launchpad/dist/openocd.cfg deleted file mode 100644 index 0fa4600351..0000000000 --- a/boards/cc2650-launchpad/dist/openocd.cfg +++ /dev/null @@ -1,43 +0,0 @@ -# Config for Texas Instruments low power SoC CC26xx family - -adapter_khz 100 - -source [find target/icepick.cfg] -source [find target/ti-cjtag.cfg] - -if { [info exists CHIPNAME] } { - set _CHIPNAME $CHIPNAME -} else { - set _CHIPNAME cc26xx -} - -# -# Main DAP -# -if { [info exists DAP_TAPID] } { - set _DAP_TAPID $DAP_TAPID -} else { - set _DAP_TAPID 0x4BA00477 -} -jtag newtap $_CHIPNAME dap -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_DAP_TAPID -disable -jtag configure $_CHIPNAME.dap -event tap-enable "icepick_c_tapenable $_CHIPNAME.jrc 0" - -# -# ICEpick-C (JTAG route controller) -# -if { [info exists JRC_TAPID] } { - set _JRC_TAPID $JRC_TAPID -} else { - set _JRC_TAPID 0x1B99A02F -} -jtag newtap $_CHIPNAME jrc -irlen 6 -ircapture 0x1 -irmask 0x3f -expected-id $_JRC_TAPID -ignore-version -# A start sequence is needed to change from cJTAG (Compact JTAG) to -# 4-pin JTAG before talking via JTAG commands -jtag configure $_CHIPNAME.jrc -event setup "jtag tapenable $_CHIPNAME.dap" -jtag configure $_CHIPNAME.jrc -event post-reset "ti_cjtag_to_4pin_jtag $_CHIPNAME.jrc" - -# -# Cortex M3 target -# -set _TARGETNAME $_CHIPNAME.cpu -target create $_TARGETNAME cortex_m -chain-position $_CHIPNAME.dap diff --git a/boards/cc2650stk/Makefile.include b/boards/cc2650stk/Makefile.include index 6453ba1dd5..3533a21c86 100644 --- a/boards/cc2650stk/Makefile.include +++ b/boards/cc2650stk/Makefile.include @@ -1,6 +1,4 @@ XDEBUGGER = XDS110 -OPENOCD_CONFIG ?= $(BOARDDIR)/dist/openocd.cfg - # configure the flash tool include $(RIOTBOARD)/common/cc26xx_cc13xx/Makefile.include diff --git a/boards/cc2650stk/dist/openocd.cfg b/boards/cc2650stk/dist/openocd.cfg deleted file mode 100644 index 0fa4600351..0000000000 --- a/boards/cc2650stk/dist/openocd.cfg +++ /dev/null @@ -1,43 +0,0 @@ -# Config for Texas Instruments low power SoC CC26xx family - -adapter_khz 100 - -source [find target/icepick.cfg] -source [find target/ti-cjtag.cfg] - -if { [info exists CHIPNAME] } { - set _CHIPNAME $CHIPNAME -} else { - set _CHIPNAME cc26xx -} - -# -# Main DAP -# -if { [info exists DAP_TAPID] } { - set _DAP_TAPID $DAP_TAPID -} else { - set _DAP_TAPID 0x4BA00477 -} -jtag newtap $_CHIPNAME dap -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_DAP_TAPID -disable -jtag configure $_CHIPNAME.dap -event tap-enable "icepick_c_tapenable $_CHIPNAME.jrc 0" - -# -# ICEpick-C (JTAG route controller) -# -if { [info exists JRC_TAPID] } { - set _JRC_TAPID $JRC_TAPID -} else { - set _JRC_TAPID 0x1B99A02F -} -jtag newtap $_CHIPNAME jrc -irlen 6 -ircapture 0x1 -irmask 0x3f -expected-id $_JRC_TAPID -ignore-version -# A start sequence is needed to change from cJTAG (Compact JTAG) to -# 4-pin JTAG before talking via JTAG commands -jtag configure $_CHIPNAME.jrc -event setup "jtag tapenable $_CHIPNAME.dap" -jtag configure $_CHIPNAME.jrc -event post-reset "ti_cjtag_to_4pin_jtag $_CHIPNAME.jrc" - -# -# Cortex M3 target -# -set _TARGETNAME $_CHIPNAME.cpu -target create $_TARGETNAME cortex_m -chain-position $_CHIPNAME.dap diff --git a/boards/common/cc26xx_cc13xx/Makefile.include b/boards/common/cc26xx_cc13xx/Makefile.include index d084a98107..2b6ab2ad2b 100644 --- a/boards/common/cc26xx_cc13xx/Makefile.include +++ b/boards/common/cc26xx_cc13xx/Makefile.include @@ -13,5 +13,30 @@ PROGRAMMERS_SUPPORTED += openocd uniflash # embedded debugger of these launchpad boards. TTY_BOARD_FILTER := --model XDS110 --iface-num 0 -OPENOCD_CONFIG ?= $(RIOTBOARD)/common/cc26xx_cc13xx/dist/openocd.cfg UNIFLASH_CONFIG ?= $(RIOTBOARD)/common/cc26xx_cc13xx/dist + +OPENOCD_DEBUG_ADAPTER ?= xds110 + +ifneq (,$(filter cc13x0%,$(CPU_MODEL))) + DEFAULT_OPENOCD_CONFIG := $(RIOTBASE)/boards/common/cc26xx_cc13xx/dist/openocd_cc13x0.cfg +endif +ifneq (,$(filter cc13x2%,$(CPU_MODEL))) + DEFAULT_OPENOCD_CONFIG := $(RIOTBASE)/boards/common/cc26xx_cc13xx/dist/openocd_cc13x2.cfg +endif +ifneq (,$(filter cc26x0%,$(CPU_MODEL))) + DEFAULT_OPENOCD_CONFIG := $(RIOTBASE)/boards/common/cc26xx_cc13xx/dist/openocd_cc26x0.cfg +endif +ifneq (,$(filter cc26x2%,$(CPU_MODEL))) + DEFAULT_OPENOCD_CONFIG := $(RIOTBASE)/boards/common/cc26xx_cc13xx/dist/openocd_cc26x2.cfg +endif + +# if no openocd specific configuration file, check for default locations: +# 1. Using the default dist/openocd.cfg (automatically set by openocd.sh) +# 2. Using the common cpu specific config file +ifeq (,$(OPENOCD_CONFIG)) + # if no openocd default configuration is provided by the board, + # use the default cc26xx / cc13xx config + ifeq (0,$(words $(wildcard $(BOARDDIR)/dist/openocd.cfg))) + OPENOCD_CONFIG := $(DEFAULT_OPENOCD_CONFIG) + endif +endif diff --git a/boards/common/cc26xx_cc13xx/dist/openocd.cfg b/boards/common/cc26xx_cc13xx/dist/openocd.cfg deleted file mode 100644 index 64d69c2f33..0000000000 --- a/boards/common/cc26xx_cc13xx/dist/openocd.cfg +++ /dev/null @@ -1,11 +0,0 @@ -source [find interface/xds110.cfg] - -transport select jtag -gdb_memory_map enable -gdb_flash_program enable - -source [find target/ti_cc26x2.cfg] - -adapter_nsrst_assert_width 250 -adapter_nsrst_delay 400 -adapter_khz 1000 \ No newline at end of file diff --git a/boards/common/cc26xx_cc13xx/dist/openocd_cc13x0.cfg b/boards/common/cc26xx_cc13xx/dist/openocd_cc13x0.cfg new file mode 100644 index 0000000000..aca2d1c06f --- /dev/null +++ b/boards/common/cc26xx_cc13xx/dist/openocd_cc13x0.cfg @@ -0,0 +1 @@ +source [find target/ti_cc13x0.cfg] diff --git a/boards/common/cc26xx_cc13xx/dist/openocd_cc13x2.cfg b/boards/common/cc26xx_cc13xx/dist/openocd_cc13x2.cfg new file mode 100644 index 0000000000..cea0d04a9c --- /dev/null +++ b/boards/common/cc26xx_cc13xx/dist/openocd_cc13x2.cfg @@ -0,0 +1 @@ +source [find target/ti_cc13x2.cfg] diff --git a/boards/common/cc26xx_cc13xx/dist/openocd_cc26x0.cfg b/boards/common/cc26xx_cc13xx/dist/openocd_cc26x0.cfg new file mode 100644 index 0000000000..1a86f0bc99 --- /dev/null +++ b/boards/common/cc26xx_cc13xx/dist/openocd_cc26x0.cfg @@ -0,0 +1 @@ +source [find target/ti_cc26x0.cfg] diff --git a/boards/common/cc26xx_cc13xx/dist/openocd_cc26x2.cfg b/boards/common/cc26xx_cc13xx/dist/openocd_cc26x2.cfg new file mode 100644 index 0000000000..3d7bfff7cf --- /dev/null +++ b/boards/common/cc26xx_cc13xx/dist/openocd_cc26x2.cfg @@ -0,0 +1 @@ +source [find target/ti_cc26x2.cfg]