Hi Peter.

On Wed, 18 Jun 2014 16:35:14 +0200, Peter Stuge wrote:
> target/swj-dp.tcl:# on which transport is active.
> target/swj-dp.tcl:# based on the transport in use with this session.
> target/swj-dp.tcl:# for now, ignore non-JTAG and non-SWD transports
> target/swj-dp.tcl:set tran [transport select]
> 
> Ignoring all the comments the last one looks interesting.
> 
> openocd/tcl $ git grep swj-dp
> target/k40.cfg:source [find target/swj-dp.tcl]
> target/k60.cfg:source [find target/swj-dp.tcl]
> target/lpc17xx.cfg:source [find target/swj-dp.tcl]
> target/stellaris.cfg:source [find target/swj-dp.tcl]
> 
> Maybe OpenOCD spits out an error message even though the current
> transport is only being inquired.

That could be.

Recently, I flashed a LPC1751 using SWD by accident.
I changed the script, so it would use jtag.

Here's my 'Board.cfg':

---8<-----8<-----8<-----
echo "### Flashing/Board/Board.cfg"
transport select jtag
#transport select swd
source [find target/lpc1751.cfg]

# our board runs on an external crystal; we can handle 249 kHz, but will be 
alright with 225:
adapter_khz 225
--->8----->8----->8-----

-I *know* this worked before I build OpenOCD 0.9.0, so I wonder if the 
'transport select' handling changed somehow ?

No matter which of the "transport select" lines I enable, I get the same error:
Error: session's transport is already selected.

-But if I disable both, the board is programmed using jtag.

This is the -d3 log:
---8<-----8<-----8<-----
$ openocd -d3 -f interface/ftdi/jtag-lock-pick_tiny_2.cfg -f 
Flashing/Board/Board.cfg -c "flashNow output/SD-MMC-Test.elf"

Open On-Chip Debugger 0.9.0-dev-00038-gae3baa9 (2014-06-11-10:24)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.sourceforge.net/doc/doxygen/bugs.html
User : 13 9 command.c:546 command_print(): debug_level: 3
Debug: 14 9 options.c:98 add_default_dirs(): bindir=/usr/local/bin
Debug: 15 9 options.c:99 add_default_dirs(): pkgdatadir=/usr/local/share/openocd
Debug: 16 9 options.c:100 add_default_dirs(): run_prefix=
Debug: 17 9 configuration.c:44 add_script_search_dir(): adding 
/Users/jens/.openocd
Debug: 18 9 configuration.c:44 add_script_search_dir(): adding 
/usr/local/share/openocd/site
Debug: 19 9 configuration.c:44 add_script_search_dir(): adding 
/usr/local/share/openocd/scripts
Debug: 20 10 configuration.c:84 find_file(): found 
/usr/local/share/openocd/scripts/interface/ftdi/jtag-lock-pick_tiny_2.cfg
Debug: 21 11 command.c:145 script_debug(): command - ocd_command ocd_command 
type ocd_interface ftdi
Debug: 22 11 command.c:145 script_debug(): command - interface ocd_interface 
ftdi
Debug: 24 11 command.c:366 register_command_handler(): registering 
'ocd_ftdi_device_desc'...
Debug: 25 11 command.c:366 register_command_handler(): registering 
'ocd_ftdi_serial'...
Debug: 26 11 command.c:366 register_command_handler(): registering 
'ocd_ftdi_channel'...
Debug: 27 11 command.c:366 register_command_handler(): registering 
'ocd_ftdi_layout_init'...
Debug: 28 11 command.c:366 register_command_handler(): registering 
'ocd_ftdi_layout_signal'...
Debug: 29 12 command.c:366 register_command_handler(): registering 
'ocd_ftdi_set_signal'...
Debug: 30 12 command.c:366 register_command_handler(): registering 
'ocd_ftdi_vid_pid'...
Info : 31 12 transport.c:118 allow_transports(): only one transport option; 
autoselect 'jtag'
Debug: 32 12 command.c:366 register_command_handler(): registering 
'ocd_jtag_flush_queue_sleep'...
Debug: 33 12 command.c:366 register_command_handler(): registering 
'ocd_jtag_rclk'...
Debug: 34 12 command.c:366 register_command_handler(): registering 
'ocd_jtag_ntrst_delay'...
Debug: 35 12 command.c:366 register_command_handler(): registering 
'ocd_jtag_ntrst_assert_width'...
Debug: 36 12 command.c:366 register_command_handler(): registering 
'ocd_scan_chain'...
Debug: 37 12 command.c:366 register_command_handler(): registering 
'ocd_jtag_reset'...
Debug: 38 12 command.c:366 register_command_handler(): registering 
'ocd_runtest'...
Debug: 39 12 command.c:366 register_command_handler(): registering 
'ocd_irscan'...
Debug: 40 12 command.c:366 register_command_handler(): registering 
'ocd_verify_ircapture'...
Debug: 41 12 command.c:366 register_command_handler(): registering 
'ocd_verify_jtag'...
Debug: 42 12 command.c:366 register_command_handler(): registering 
'ocd_tms_sequence'...
Debug: 43 12 command.c:366 register_command_handler(): registering 
'ocd_wait_srst_deassert'...
Debug: 44 12 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 45 12 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 46 12 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 47 12 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 48 13 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 49 13 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 50 13 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 51 13 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 52 13 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 53 13 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 54 13 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 55 13 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 56 13 command.c:366 register_command_handler(): registering 'ocd_jtag'...
Debug: 57 13 command.c:366 register_command_handler(): registering 'ocd_svf'...
Debug: 58 15 command.c:366 register_command_handler(): registering 'ocd_xsvf'...
Debug: 59 15 command.c:145 script_debug(): command - ocd_command ocd_command 
type ocd_ftdi_device_desc JTAG-lock-pick Tiny 2
Debug: 60 15 command.c:145 script_debug(): command - ftdi_device_desc 
ocd_ftdi_device_desc JTAG-lock-pick Tiny 2
Debug: 62 16 command.c:145 script_debug(): command - ocd_command ocd_command 
type ocd_ftdi_vid_pid 0x0403 0x8220
Debug: 63 16 command.c:145 script_debug(): command - ftdi_vid_pid 
ocd_ftdi_vid_pid 0x0403 0x8220
Debug: 65 16 command.c:145 script_debug(): command - ocd_command ocd_command 
type ocd_ftdi_layout_init 0x8c28 0xff3b
Debug: 66 16 command.c:145 script_debug(): command - ftdi_layout_init 
ocd_ftdi_layout_init 0x8c28 0xff3b
Debug: 68 16 command.c:145 script_debug(): command - ocd_command ocd_command 
type ocd_ftdi_layout_signal nTRST -data 0x0100 -noe 0x0400
Debug: 69 16 command.c:145 script_debug(): command - ftdi_layout_signal 
ocd_ftdi_layout_signal nTRST -data 0x0100 -noe 0x0400
Debug: 71 16 command.c:145 script_debug(): command - ocd_command ocd_command 
type ocd_ftdi_layout_signal nSRST -data 0x0200 -noe 0x0800
Debug: 72 17 command.c:145 script_debug(): command - ftdi_layout_signal 
ocd_ftdi_layout_signal nSRST -data 0x0200 -noe 0x0800
Debug: 74 17 command.c:145 script_debug(): command - ocd_command ocd_command 
type ocd_ftdi_layout_signal LED -ndata 0x8000
Debug: 75 17 command.c:145 script_debug(): command - ftdi_layout_signal 
ocd_ftdi_layout_signal LED -ndata 0x8000
Debug: 77 17 configuration.c:84 find_file(): found Flashing/Board/Board.cfg
Debug: 78 17 command.c:145 script_debug(): command - ocd_command ocd_command 
type ocd_echo ### Flashing/Board/Board.cfg
Debug: 79 17 command.c:145 script_debug(): command - echo ocd_echo ### 
Flashing/Board/Board.cfg
User : 81 17 command.c:763 jim_echo(): ### Flashing/Board/Board.cfg
Debug: 82 17 command.c:145 script_debug(): command - ocd_command ocd_command 
type ocd_transport select jtag
Debug: 83 17 command.c:145 script_debug(): command - ocd_transport 
ocd_transport select jtag
Error: 84 17 transport.c:290 jim_transport_select(): session's transport is 
already selected.
User : 85 18 command.c:666 command_run_line(): Runtime Error: 
embedded:startup.tcl:20: 
in procedure 'script' 
at file "embedded:startup.tcl", line 58
in procedure 'transport' called at file "Flashing/Board/Board.cfg", line 13
in procedure 'ocd_bouncer' 
at file "embedded:startup.tcl", line 20

--->8----->8----->8-----

Notice the "Info" line (31) tells us very early that the transport has been 
auto-selected already.
In 82, I attempt to set the transport.

I'm getting the feeling that the transport is selected, as soon as the 
interface is selected.
-But that theory does not sound correct to me either, because that would mean 
that "transport select" would be completely broken.


Love
Jens

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to