Post Go back to editing

EVAL-ADICUP360 & Crosscore Embedded Studio OpenOCD issue

Category: Software
Product Number: EVAL-ADICUP360
Software Version: CCES 2.11.1, ADuCM36x DFP CMSIS Pack version 1.0.4

Hi,

I am trying to get an EVAL-ADICUP360 up and running with CCES 2.11.1. This was downloaded and installed today along with the ADuCM36x DFP CMSIS Pack version 1.0.4 per the guide in the Wiki here:

https://wiki.analog.com/resources/eval/user-guides/eval-adicup360/tools/cces_setup_guide

https://wiki.analog.com/resources/eval/user-guides/eval-adicup360/tools/cces_user_guide

I also have the generic ARM CMSIS pack installed 5.9.0

After doing this I imported the example projects from Github per these instructions:
https://wiki.analog.com/resources/eval/user-guides/eval-adicup360/tools/cces_user_guide#how_to_import_existing_projects_from_the_git_repository

I am able to build the Blinky example project, however I am unable to download and debug on the hardware. The supplied Openocd aducm36x.cfg file appears to use deprecated config items. This is the output I get when I try and download:

Open On-Chip Debugger (Analog Devices CCES 2.11.1) OpenOCD 0.10.0 (2022-09-07-13:55)
Licensed under GNU GPL v2
Report bugs to <processor.tools.support@analog.com>
0
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
DEPRECATED! use 'adapter speed' not 'adapter_khz'
C:/Analog Devices/CrossCore Embedded Studio 2.11.1/ARM/packs/AnalogDevices/ADuCM36x_DFP/1.0.4/openocd/scripts/target/aducm36x.cfg:38: Error: target requires -dap parameter instead of -chain-position!
in procedure 'script'
at file "embedded:startup.tcl", line 26
at file "C:/Analog Devices/CrossCore Embedded Studio 2.11.1/ARM/packs/AnalogDevices/ADuCM36x_DFP/1.0.4/openocd/scripts/target/aducm36x.cfg", line 38

I have modified the config file with what I think are the correct fixes and I can get a bit further but the device eventually times out waiting for the device to halt:

Open On-Chip Debugger (Analog Devices CCES 2.11.1) OpenOCD 0.10.0 (2022-09-07-13:55)
Licensed under GNU GPL v2
Report bugs to <processor.tools.support@analog.com>
0
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: FW Version = 1.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x2ba01477
Info : DAP aducm360.cpu DPIDR indicates ADIv5 protocol is being used
Info : SWD DPIDR 0x2ba01477
Info : aducm360.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for aducm360.cpu on 3333
Info : Listening on port 3333 for gdb connections

Error: timed out while waiting for target halted
Warn : Flash driver of aducm360.flash does not support free_driver_priv()
Info : Halt timed out, wake up GDB.

For some reason it won't let me attach the modified file so here it is in line:

# Analog Devices ADuCM36x

source [find target/swj-dp.tcl]

if { [info exists CHIPNAME] } {
   set _CHIPNAME $CHIPNAME
} else {
   set _CHIPNAME aducm360
}

if { [info exists ENDIAN] } {
   set _ENDIAN $ENDIAN
} else {
   # This config file was defaulting to big endian..
   set _ENDIAN little
}

if { [info exists WORKAREASIZE] } {
   set _WORKAREASIZE $WORKAREASIZE
} else {
   set _WORKAREASIZE 0x1000
}

if { [info exists CPUTAPID] } {
   set _CPUTAPID $CPUTAPID
} else {
   set _CPUTAPID 0x2ba01477
}

swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID

adapter speed 1000

##
## Target configuration
##
set _TARGETNAME $_CHIPNAME.cpu
dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
target create $_TARGETNAME cortex_m -endian $_ENDIAN -dap $_CHIPNAME.dap
#target create $_TARGETNAME cortex_m -endian $_ENDIAN -chain-position $_TARGETNAME

$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0

# flash size will be probed
set _FLASHNAME $_CHIPNAME.flash
flash bank $_FLASHNAME aducm360 0x00 0 0 0 $_TARGETNAME

adapter srst delay 100
cortex_m reset_config vectreset

init
halt
flash probe 0 
proc peek32 {address} {
	mem2array t 32 $address 1
	return $t(0)
}

arm semihosting enable

#implement ADI Halt after bootkernel
proc init_reset {mode} {
	echo "RESET: ADI halt after bootkernel"
	set rvec [peek32 0x4]
	set emcr [peek32 0xe000edfc]
	set hcsr [peek32 0xe000edf0]
	bp $rvec 2 hw
	mww 0xe000edf0 0xA05F0003
	mww 0xe000edfc 0x1000500
	mww 0xE000ED0C 0x05FA0004
	mww 0xe000edfc $emcr
	mww 0xe000edf0 $hcsr
	rbp $rvec

	if { $mode == "run" } {
	   resume
	}
}

The board does appear as an MBED flash drive in windows, and I can see activity on the SWDIO & SDCLK lines on the board whilst it is attempting to connect so most of the debug chain is working. 

I would appreciate guidance on how to proceed with this? 

Thanks

Jonathan