0
\$\begingroup\$

I am trying to connect CEC1702 (ARM Cortex M4F) to SWD port of FT2232H.

My adapter script:

interface ftdi
transport select swd
ftdi_vid_pid 0x0403 0x6010
ftdi_channel 0
ftdi_serial "524D58"
ftdi_layout_init 0x0018 0x05fb
ftdi_layout_signal SWD_EN -data 0
ftdi_layout_signal nSRST -data 0x0010

My target script

source [find target/swj-dp.tcl]  
adapter_khz 500
set _CHIPNAME cec1702
set _ENDIAN little
set _M3_JTAG_TAPID 0x2ba01477
swj_newdap $_CHIPNAME m3 -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_M3_JTAG_TAPID
set _TARGETNAME $_CHIPNAME.m3
target create $_TARGETNAME cortex_m -endian $_ENDIAN -chain-position $_TARGETNAME

if {![using_hla]} {
   adapter_nsrst_delay 100
   cortex_m reset_config sysresetreq
}
init 

When I run openocd, everything looks good!

Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
Info : FTDI SWD mode enabled
0
adapter speed: 500 kHz
adapter_nsrst_delay: 100
cortex_m reset_config sysresetreq
Info : clock speed 500 kHz
Info : SWD DPIDR 0x2ba01477
Info : cec1702.m3: hardware has 6 breakpoints, 4 watchpoints

I can read registers (reg command), but I when I attempt to reset the target (telnet localhost 4444 in separte terminal, then "reset halt" ), it got stalled:

Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
> reset halt
DP initialisation failed
TARGET: cec1702.m3 - Not halted
in procedure 'reset' 
in procedure 'ocd_bouncer'


Polling target cec1702.m3 failed, trying to reexamine
Could not initialize the debug port
Examination failed, GDB will be halted. Polling again in 100ms
Polling target cec1702.m3 failed, trying to reexamine
Could not initialize the debug port
Examination failed, GDB will be halted. Polling again in 300ms
Polling target cec1702.m3 failed, trying to reexamine
Could not initialize the debug port
Examination failed, GDB will be halted. Polling again in 700ms
Polling target cec1702.m3 failed, trying to reexamine

I used the similar scripts with st-link-v2 or st-link-v2-1, debugging worked well.

I wired everything according to this nice article: https://www.allaboutcircuits.com/technical-articles/getting-started-with-openocd-using-ft2232h-adapter-for-swd-debugging/

I also tried actually used FTDI's wiring with another ARM (STM32f072), it worked well, so I believe my wiring is good. Only ftdi SWD openocd seems to have problems to configure CEC1702's DAP after reset..?

Thanks for a help.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.