On Thu, May 10, 2012 at 7:38 AM, Xiaofan Chen <[email protected]> wrote:
> On Thu, May 10, 2012 at 4:18 AM, Andreas Fritiofson
> <[email protected]> wrote:
>> Using the built-in adapter, you only get ones, but with the external
>> adapter you can at least read the idcode correctly. I've taken a look
>> at the schematics of the EK-LM3S1968 board and it seems like the I/O
>> config and init in interface/ftdi/luminary{,_icdi}.cfg is wrong. It
>> initializes SRSTN (FT2232 ADBUS5) as an input which
>> makes the internal signal between the FT2232 and the
>> CPLD floating. Also, it uses the
>> FTDI pin as an open-drain output as if it directly controls target
>> nSRST even though it's buffered with a CPLD. Strangely, the layout
>> code in the old driver does the same thing, that's where I copied the
>> info from. Can you try the attached luminary.cfg to see if you can at
>> least read the idcode?
>
> Now it actually generate a segfault. But I think you are getting
> closer.
>
> mymacmini:lm3s1968 xiaofanc$ ~/bin/bin/openocd -f
> ~/bin/share/openocd/scripts/board/ek-lm3s1968_mpsse_icdi.cfg
> Open On-Chip Debugger 0.6.0-dev-00448-gac053a2 (2012-05-09-19:01)
> Licensed under GNU GPL v2
> For bug reports, read
>        http://openocd.sourceforge.net/doc/doxygen/bugs.html
> Info : only one transport option; autoselect 'jtag'
> 500 kHz
> Info : clock speed 500 kHz
> Error: interface can't tri-state 'nSRST'
> Info : JTAG tap: lm3s1968.cpu tap/device found: 0x3ba00477 (mfg:
> 0x23b, part: 0xba00, ver: 0x3)
> Segmentation fault: 11
>

A bit try and error here. If I only follow your first modification
to luminar.cfg and not the 2nd modification, no more hang.

mymacmini:ftdi xiaofanc$ pwd
/Users/xiaofanc/bin/share/openocd/scripts/interface/ftdi

mymacmini:ftdi xiaofanc$ cat luminary.cfg
#
# Luminary Micro Stellaris Evaluation Kits
#
# http://www.luminarymicro.com/products/evaluation_kits.html
#
# There are a number of evaluation kits for Stellaris Cortex-M3 chips.
# Currently they all bundle ftdi based debug support.  When that is
# used (instead of an external adapter), use this config file in one
# of these two modes:
#
# - Eval board debug ... debug of the Stellaris chip via port A.
#
# - Other board debug ... same thing, but the board acts as a debug
#   adapter for another board (using a standard ARM JTAG connector).
#   The Stellaris chip stays in reset.
#
# Those support both JTAG and SWD.  SWD is an ARM-only two-wire debug
# protocol; in 2009, OpenOCD does not support SWD.
#
# Port B of the ftdi chip is normally used as a serial link to the
# Stellaris chip.  On most boards (but not older LM3S811 eval boards),
# when SWD is used Port B may instead be used to read low-bandwidth
# "SWO trace" data, including so-called "printf style" output from
# firmware via the ITM module as well as profile data.
#

interface ftdi
ftdi_device_desc "Stellaris Evaluation Board"
ftdi_vid_pid 0x0403 0xbcd9

ftdi_layout_init 0x00a8 0x00eb
ftdi_layout_signal nSRST -data 0x0020 -oe 0x0020

mymacmini:lm3s1968 xiaofanc$ ~/bin/bin/openocd -f
~/bin/share/openocd/scripts/board/ek-lm3s1968_mpsse_icdi.cfg
Open On-Chip Debugger 0.6.0-dev-00448-gac053a2 (2012-05-09-19:01)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
500 kHz
Info : clock speed 500 kHz
Info : JTAG tap: lm3s1968.cpu tap/device found: 0xffffffff (mfg:
0x7ff, part: 0xffff, ver: 0xf)
Warn : JTAG tap: lm3s1968.cpu       UNEXPECTED: 0xffffffff (mfg:
0x7ff, part: 0xffff, ver: 0xf)
Error: JTAG tap: lm3s1968.cpu  expected 1 of 1: 0x0ba00477 (mfg:
0x23b, part: 0xba00, ver: 0x0)
Warn : Unexpected idcode after end of chain: 608 0x7fffffff
Error: double-check your JTAG setup (interface, speed, missing TAPs, ...)
Error: Trying to use configured scan chain anyway...
Error: lm3s1968.cpu: IR capture error; saw 0x0f not 0x01
Warn : Bypassing JTAG setup events due to errors
Warn : Invalid ACK 0x7 in JTAG-DP transaction
Polling target failed, GDB will be halted. Polling again in 100ms
Polling target failed, GDB will be halted. Polling again in 300ms
Polling target failed, GDB will be halted. Polling again in 700ms
Polling target failed, GDB will be halted. Polling again in 1500ms
Polling target failed, GDB will be halted. Polling again in 3100ms
^C
mymacmini:lm3s1968 xiaofanc$ ~/bin/bin/openocd -f
~/bin/share/openocd/scripts/board/ek-lm3s1968_mpsse_icdi.cfg
Open On-Chip Debugger 0.6.0-dev-00448-gac053a2 (2012-05-09-19:01)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
500 kHz
Info : clock speed 500 kHz
Info : JTAG tap: lm3s1968.cpu tap/device found: 0xffffffff (mfg:
0x7ff, part: 0xffff, ver: 0xf)
Warn : JTAG tap: lm3s1968.cpu       UNEXPECTED: 0xffffffff (mfg:
0x7ff, part: 0xffff, ver: 0xf)
Error: JTAG tap: lm3s1968.cpu  expected 1 of 1: 0x0ba00477 (mfg:
0x23b, part: 0xba00, ver: 0x0)
Warn : Unexpected idcode after end of chain: 608 0x7fffffff
Error: double-check your JTAG setup (interface, speed, missing TAPs, ...)
Error: Trying to use configured scan chain anyway...
Error: lm3s1968.cpu: IR capture error; saw 0x0f not 0x01
Warn : Bypassing JTAG setup events due to errors
Warn : Invalid ACK 0x7 in JTAG-DP transaction
Polling target failed, GDB will be halted. Polling again in 100ms
Polling target failed, GDB will be halted. Polling again in 300ms
Polling target failed, GDB will be halted. Polling again in 700ms
Polling target failed, GDB will be halted. Polling again in 1500ms
Polling target failed, GDB will be halted. Polling again in 3100ms
^C


-- 
Xiaofan

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to