Hi guys.
Thanks for answers.
This group looks very active 8)
Today I assembled proper FTDI modification with tristate buffers.
STM32F103C8 was recognised and worked fine with this config file:
------------------------------------------------------------------------------------------------
interface ftdi
ftdi_vid_pid 0x0403 0x6010
ftdi_channel 0
ftdi_layout_init 0x0008 0x003f
ftdi_layout_signal SWD_EN -data 0
ftdi_layout_signal SWDIO_OE -ndata 0x0010
transport select swd
source [find target/stm32f1x.cfg]
init
reset init
------------------------------------------------------------------------------------------------
For NRF51822 I use hand made config based on target/nrf51_stlink.tcl:
------------------------------------------------------------------------------------------------
interface ftdi
ftdi_vid_pid 0x0403 0x6010
ftdi_channel 0
ftdi_layout_init 0x0008 0x003f
ftdi_layout_signal SWD_EN -data 0
ftdi_layout_signal SWDIO_OE -ndata 0x0010
#ftdi_layout_signal LED -ndata 0x0010
#ftdi_layout_signal STATUS -ndata 0x0020
transport select swd
#######################################
##-- swj-dp.tcl ----------------
global using_jtag
set using_jtag 1
proc swj_newdap {chip tag args} {
eval swd newdap $chip $tag $args; set using_jtag 0
}
##------------------------------
set _CHIPNAME nrf51
set _ENDIAN little
set _WORKAREASIZE 0x800
set _CPUTAPID 0x0bb11477
swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id
$_CPUTAPID
set _TARGETNAME $_CHIPNAME.cpu
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 $_CHIPNAME.flash nrf51 0x00000000 0 1 1 $_TARGETNAME
flash bank $_CHIPNAME.uicr nrf51 0x10001000 0 1 1 $_TARGETNAME
# JTAG speed should be <= F_CPU/6. F_CPU after reset is 8MHz, so use F_JTAG =
1MHz
adapter_khz 1000
adapter_nsrst_delay 100
# if srst is not fitted use SYSRESETREQ to
# perform a soft reset
cortex_m reset_config sysresetreq
###################################################
init
reset init
------------------------------------------------------------------------------------------------
When I run openocd with this config and it looks like nRF51 simple doesn’t
response to request command:
Debug: 223 192 ftdi.c:982 ftdi_swd_run_queue(): JUNK DP read reg 0 = ffffffff
I’ve check it with oscilloscope and it’s definitely FF on the SWDIO.
Here is detailed debug output:
Debug: 198 4 ftdi.c:625 ftdi_initialize(): ftdi interface using shortest path
jtag state transitions
Debug: 199 73 mpsse.c:363 mpsse_purge(): -
Debug: 200 73 mpsse.c:644 mpsse_loopback_config(): off
Debug: 201 73 mpsse.c:689 mpsse_set_frequency(): target 1000 Hz
Debug: 202 73 mpsse.c:681 mpsse_rtck_config(): off
Debug: 203 73 mpsse.c:670 mpsse_divide_by_5_config(): off
Debug: 204 73 mpsse.c:650 mpsse_set_divisor(): 29999
Debug: 205 73 mpsse.c:713 mpsse_set_frequency(): actually 1000 Hz
Debug: 206 73 ftdi.c:1096 ftdi_swd_switch_seq(): JTAG-to-SWD
Debug: 207 73 core.c:1614 adapter_khz_to_speed(): convert khz to interface
specific speed value
Debug: 208 73 core.c:1617 adapter_khz_to_speed(): have interface set up
Debug: 209 73 mpsse.c:689 mpsse_set_frequency(): target 1000000 Hz
Debug: 210 73 mpsse.c:681 mpsse_rtck_config(): off
Debug: 211 73 mpsse.c:670 mpsse_divide_by_5_config(): off
Debug: 212 73 mpsse.c:650 mpsse_set_divisor(): 29
Debug: 213 73 mpsse.c:713 mpsse_set_frequency(): actually 1000000 Hz
Debug: 214 73 core.c:1614 adapter_khz_to_speed(): convert khz to interface
specific speed value
Debug: 215 73 core.c:1617 adapter_khz_to_speed(): have interface set up
Info : 216 73 core.c:1403 adapter_init(): clock speed 1000 kHz
Debug: 217 73 openocd.c:132 handle_init_command(): Debug Adapter init complete
Debug: 218 74 command.c:145 script_debug(): command - ocd_command ocd_command
type ocd_transport init
Debug: 219 74 command.c:145 script_debug(): command - ocd_transport
ocd_transport init
Debug: 221 74 transport.c:240 handle_transport_init(): handle_transport_init
Debug: 222 74 ftdi.c:950 ftdi_swd_run_queue(): Executing 2 queued transactions
Debug: 223 192 ftdi.c:982 ftdi_swd_run_queue(): JUNK DP read reg 0 = ffffffff
Debug: 224 192 command.c:628 run_command(): Command failed with error code 7
User : 225 192 command.c:666 command_run_line(): in procedure 'init' called at
file "./nrf51_test.cfg", line 52
in procedure 'ocd_bouncer'
in procedure 'transport'
Debug: 226 192 command.c:628 run_command(): Command failed with error code -4
User : 227 192 command.c:666 command_run_line(): Runtime Error:
./nrf51_test.cfg:52:
in procedure 'script'
at file "embedded:startup.tcl", line 58
in procedure 'init' called at file "./nrf51_test.cfg", line 52
I lost…
Even more. I’ve tried Stlink V2 with Keil and it works just fine.
But once I try stink with openocd I got error:
> ./openocd -f interface/stlink-v2.cfg -f target/nrf51_stlink.tcl
Open On-Chip Debugger 0.9.0-dev-00098-ge03eb89 (2014-07-15-18:05)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Error: session's transport is not selected.
Info : session transport was not selected, defaulting to JTAG
Error: Debug adapter doesn't support 'jtag' transport
Runtime Error: embedded:startup.tcl:20:
in procedure 'script'
at file "embedded:startup.tcl", line 58
at file
"/Users/anpilog/apps/openocd-cmsis-dap/share/openocd/scripts/target/nrf51_stlink.tcl",
line 5
in procedure 'transport' called at file
"/Users/anpilog/apps/openocd-cmsis-dap/share/openocd/scripts/target/swj-dp.tcl",
line 23
in procedure 'ocd_bouncer'
at file "embedded:startup.tcl", line 20
I’ve played around with different options to set transport but failed.
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel