Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-06-23 Thread Liviu Ionescu

On May 22, 2012, at 13:23 , Liviu Ionescu wrote:

 ... the Segger GDB Server seems fine on Windows and Linux.

fyi, Segger finally released a functional version of the GDB Server for Mac OS 
X (v4.50i), and also updated the Linux version.

regards,

Liviu


--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-29 Thread Liviu Ionescu

On May 29, 2012, at 08:41 , Xiaofan Chen wrote:

 And it seems to me that V7/V6 work with or without the patch

did you keep track of the FW version for each test? 

I think that a statement like the above is too general, and you should always 
mention the FW version.

I don't know how Segger organised their development, but I guess that the FW 
version might be more relevant than the HW version, i.e. if a FW version runs 
on both V8 and V7, then the features (and bugs) would be similar.

 Firmware: J-Link ARM V6 compiled Feb  1 2011 14:28:14
 It seems to me this is already the latest for V6

do you know if V7 is still able to run the latest FW?

if so, it would be useful to test it with this latest version.

perhaps we could put all these findings in a table, with some recommandations 
for the user which is the latest tested version.

Liviu


--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-29 Thread Xiaofan Chen
On Tue, May 29, 2012 at 2:02 PM, Liviu Ionescu i...@livius.net wrote:

 On May 29, 2012, at 08:41 , Xiaofan Chen wrote:

 And it seems to me that V7/V6 work with or without the patch

 did you keep track of the FW version for each test?
Yes since I use the latest FW for the V6 and V7.

 I think that a statement like the above is too general, and you
 should always mention the FW version.

For V6/V7 and below, it seems to me Segger has not provided
FW change for more than a year. It is not that unreasonable
to ask V6/V7 J-Link users to update to the latest FW if some
old version does not work with OpenOCD but the recent FW
works with OpenOCD.

V8 is a bit different since it is a moving target and Segger
keeps updating the FW with some versions not working with
OpenOCD and some versions working with OpenOCD.
So we do need to track V8 J-Link.

 I don't know how Segger organised their development, but I guess
 that the FW version might be more relevant than the HW version,
 i.e. if a FW version runs on both V8 and V7, then the features
 (and bugs) would be similar.

As stated in the above, FW of V6/V7 has not been updated
for more than a year. FW of V8 keeps been updated.

 Firmware: J-Link ARM V6 compiled Feb  1 2011 14:28:14
 It seems to me this is already the latest for V6

 do you know if V7 is still able to run the latest FW?
I check my V7 and the latest FW of the same date as V6.
J-Link ARM V7 compiled Feb 15 2011 11:03:33

 if so, it would be useful to test it with this latest version.

 perhaps we could put all these findings in a table, with some
 recommendations for the user which is the latest tested version.


V8 FW is still being updated so we do need to keep track of it.
For V6/V7 or earlier versions, I do not think it is worth the
efforts unless Segger updates the FW for then again.


-- 
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-29 Thread Xiaofan Chen
On Mon, May 28, 2012 at 7:33 PM, Xiaofan Chen xiaof...@gmail.com wrote:
 On Mon, May 28, 2012 at 7:25 PM, Alexander Osipenko sip...@gmail.com wrote:
 I have tested V8 with latest firmware: result is OK.

 Yes this is in line with my test result. Your latest patch is okay
 for V3/V7/V8 based on my test. I will get a V6 to test as well.
 Most likely it is okay based on Spen's results.

Yes I can confirm it is okay with V6 for my test setup with STM32.

mymacmini:stm32 xiaofanc$ ~/binj2/bin/openocd -f openocd_jlink.cfg
Open On-Chip Debugger 0.6.0-dev-00597-gb4ce520-dirty (2012-05-28-18:34)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
1000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
cortex_m3 reset_config sysresetreq
libusbx: warning [darwin_cache_device_descriptor] could not retrieve
device descriptor 05ac:8281: device not responding. skipping device
Info : J-Link initialization started / target CPU reset initiated
Info : J-Link ARM V6 compiled Feb  1 2011 14:28:14
Info : J-Link caps 0x99ff7bbf
Info : J-Link hw version 6
Info : J-Link hw type J-Link
Info : J-Link max mem block 8864
Info : J-Link configuration
Info : USB-Address: 0x0
Info : Kickstart power on JTAG-pin 19: 0x
Info : Vref = 3.287 TCK = 1 TDI = 0 TDO = 1 TMS = 0 SRST = 0 TRST = 0
Info : J-Link JTAG Interface ready
Info : clock speed 1000 kHz
Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg:
0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32f1x.bs tap/device found: 0x16410041 (mfg: 0x020,
part: 0x6410, ver: 0x1)
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
1000 kHz
Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg:
0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32f1x.bs tap/device found: 0x16410041 (mfg: 0x020,
part: 0x6410, ver: 0x1)
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x0100 pc: 0x0800272c msp: 0x2810
8000 kHz
dumped 131072 bytes in 1.252086s (102.229 KiB/s)
verified 131072 bytes in 0.294941s (433.985 KiB/s)
Info : device id = 0x20036410
Info : flash size = 128kbytes
stm32x mass erase complete
wrote 131072 bytes from file dump.bin in 3.631953s (35.243 KiB/s)
verified 131072 bytes in 0.302226s (423.524 KiB/s)
20480 bytes written at address 0x2000
downloaded 20480 bytes in 0.166231s (120.314 KiB/s)
1000 kHz
Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg:
0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32f1x.bs tap/device found: 0x16410041 (mfg: 0x020,
part: 0x6410, ver: 0x1)
shutdown command invoked

-- 
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-29 Thread Xiaofan Chen
On Tue, May 29, 2012 at 6:36 PM, Xiaofan Chen xiaof...@gmail.com wrote:
 My colleague just bought a few Flasher ARM (J-Link V8 compatible)
 and it works withe your patch as well.

 The latest release of Segger DLL comes with the following
 FW for the Flasher ARM.
 J-Link ARM / Flasher ARM V3 compiled Apr 20 2012 17:36:24


Interestingly the Flasher ARM works with vanilla git version
of OpenOCD as well. I did unplug and plug the Flasher ARM
this time.

mymacmini:stm32 xiaofanc$ openocd -f openocd_jlink.cfg
Open On-Chip Debugger 0.6.0-dev-00595-g445a54a (2012-05-25-20:38)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Warn : Adapter driver 'jlink' did not declare which transports it
allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
1000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
cortex_m3 reset_config sysresetreq
libusbx: warning [darwin_cache_device_descriptor] could not retrieve
device descriptor 05ac:8281: device not responding. skipping device
Info : J-Link initialization started / target CPU reset initiated
Info : J-Link ARM / Flasher ARM V3 compiled Apr 20 2012 17:36:24
Info : J-Link caps 0xbfff7bbf
Info : J-Link hw version 203
Info : J-Link hw type Flasher
Info : J-Link max mem block 32744
Info : J-Link configuration
Info : USB-Address: 0x0
Info : Kickstart power on JTAG-pin 19: 0x
Info : Vref = 3.293 TCK = 1 TDI = 0 TDO = 1 TMS = 0 SRST = 0 TRST = 0
Info : J-Link JTAG Interface ready
Info : clock speed 1000 kHz
Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg:
0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32f1x.bs tap/device found: 0x16410041 (mfg: 0x020,
part: 0x6410, ver: 0x1)
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
1000 kHz
Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg:
0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32f1x.bs tap/device found: 0x16410041 (mfg: 0x020,
part: 0x6410, ver: 0x1)
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x0100 pc: 0x0800272c msp: 0x2810
8000 kHz
dumped 131072 bytes in 0.982017s (130.344 KiB/s)
verified 131072 bytes in 0.277907s (460.586 KiB/s)
Info : device id = 0x20036410
Info : flash size = 128kbytes
stm32x mass erase complete
wrote 131072 bytes from file dump.bin in 3.597987s (35.575 KiB/s)
verified 131072 bytes in 0.282505s (453.089 KiB/s)
20480 bytes written at address 0x2000
downloaded 20480 bytes in 0.129214s (154.782 KiB/s)
1000 kHz
Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg:
0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32f1x.bs tap/device found: 0x16410041 (mfg: 0x020,
part: 0x6410, ver: 0x1)
shutdown command invoked


-- 
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-29 Thread Alexander Osipenko
2012/5/29 Xiaofan Chen xiaof...@gmail.com:


 This is the output for V7 with the Segger utility using their
 beta Mac OS X version. You can see that V7 lacks
 certain functionality that Segger issues a warning to the user.


It is not really a problem, but only inefficiency.
OpenOCD also does not use internal jlink algo for DCC,
memory access etc, but emulates them from the host.


Regards,
Alex.

--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-29 Thread Xiaofan Chen
On Tue, May 29, 2012 at 6:43 PM, Peter Stuge pe...@stuge.se wrote:
 Xiaofan Chen wrote:
  I guess that the FW version might be more relevant than the HW version,
 ..
 Also HW revision is quite important.

 Please create two matrixes of recommended firmware versions for each
 hardware somewhere in the code:

 * lowest known good version
 * highest known bad version

 Make = highest known bad an error.

 Warn on highest known bad  current  lowest known good.

 Please don't build these matrixes using the mailing list. I'd suggest
 to first write some very simple skeleton code, maybe just some
 arrays, and then push some commits with changes according to test
 results.

I do not think this is strictly necessary for V7/V6 and below,
just ask the user to update to the latest Segger FW which
is included in the Segger software package.

For V8, there are too many versions to track.
http://www.segger.com/j-link-older-versions.html

Anything below 4.10 is not worth tracking, for example.
I would even argue that we do not need to track any
old version once the patch is integrated. Just track
from V4.46f onwards for V8 (current release version).

Right now we only know 4.22g does not work with
the patched version.




-- 
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-29 Thread Xiaofan Chen
On Tue, May 29, 2012 at 6:53 PM, Alexander Osipenko sip...@gmail.com wrote:
 2012/5/29 Xiaofan Chen xiaof...@gmail.com:


 This is the output for V7 with the Segger utility using their
 beta Mac OS X version. You can see that V7 lacks
 certain functionality that Segger issues a warning to the user.


 It is not really a problem, but only inefficiency.
 OpenOCD also does not use internal jlink algo for DCC,
 memory access etc, but emulates them from the host.


Yes I agree. Maybe just need to take note of that if
in the future someone wants to improve the V8 J-Link
performance using the capability.

-- 
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-29 Thread Peter Stuge
Xiaofan Chen wrote:
  Please create two matrixes of recommended firmware versions for each
  hardware somewhere in the code:
..
  Please don't build these matrixes using the mailing list.
 
 I do not think this is strictly necessary for V7/V6 and below,
 just ask the user to update to the latest Segger FW which
 is included in the Segger software package.
 
 For V8, there are too many versions to track.
 http://www.segger.com/j-link-older-versions.html
 
 Anything below 4.10 is not worth tracking, for example.
 I would even argue that we do not need to track any
 old version once the patch is integrated. Just track
 from V4.46f onwards for V8 (current release version).
 
 Right now we only know 4.22g does not work with
 the patched version.

I lost track of your intensive testing, I'm happy that you have the
overview! :)

The point is to please move the results into the code instead of
sending them to the mailing list.

You mention two versions so far: 4.46f and 4.22g. So someone please
add at least these into the code with appropriate warnings.

The talk about arrays/matrixes is because these checks must be added
in a way that makes it trivial for anyone who has done testing to
change the actual source code and push a commit with the updated
information, without having to create a horrible long list of if()
else if() statements. This is critical in order to keep the
information accurate.


//Peter

--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-29 Thread Liviu Ionescu

On May 29, 2012, at 14:01 , Xiaofan Chen wrote:

 For V8, there are too many versions to track.

for V8, at least based on my experience, it would be useful to mention in the 
manual which was the latest version tested.

the point is that after we release a version, Segger may release incompatible 
versions, and if something goes wrong, the user needs to know to whick of the 
many Segger versions to revert.

I just sent my first patch to the openocd.texi file, documenting the already 
implemented J-Link commands, I can add the version notice there too, if agreed.

Liviu


--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-29 Thread Xiaofan Chen
On Tue, May 29, 2012 at 8:13 PM, Liviu Ionescu i...@livius.net wrote:

 On May 29, 2012, at 14:01 , Xiaofan Chen wrote:

 For V8, there are too many versions to track.

 for V8, at least based on my experience, it would be useful to
 mention in the manual which was the latest version tested.

I do agree with you here. So we can say 4.46f is the latest
release version we tested. Since Segger does not archive
the beta version, there is no point to mention the beta version
(4.47h is the current beta version).

V8 4.46f: J-Link ARM V8 compiled May  3 2012 18:36:22

V8 4.22g is known to not work even with the patch.
4.22g FW version string: J-Link ARM V8 compiled JAN 31 2011 18:34:52

If needed, V6/V7 can be documented as well. I am not
so sure what is the corresponding version. But the
version stings are as following.

V6: J-Link ARM V6 compiled Feb  1 2011 14:28:14
V7: J-Link ARM V7 compiled Feb 15 2011 11:03:33

V3 can be documented as well.
V3: J-Link compiled Feb 20 2006 18:20:20 -- Update --

Spen: could you get the latest version FW string for
your V5, and double confirm my V6 string? Thanks.

I know you have the two working but they may not
be the latest version.
V6: J-Link ARM V6 compiled Jun 30 2009 11:04:04 - working
V5: J-Link compiled Jul 30 2008 11:24:37 ARM Rev.5 - working


 the point is that after we release a version, Segger may
  release incompatible versions, and if something goes wrong,
 the user needs to know to whick of the many Segger versions
 to revert.

Yes. This is good to have.

 I just sent my first patch to the openocd.texi file, documenting
 the already implemented J-Link commands, I can add the version
 notice there too, if agreed.

That is a good place to put. But I think Peter wants to have it
in the codes, say to put in the version check patch, that is
good proposal as well.



-- 
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-29 Thread Xiaofan Chen
On Tue, May 29, 2012 at 9:22 PM, Xiaofan Chen xiaof...@gmail.com wrote:
 On Tue, May 29, 2012 at 8:13 PM, Liviu Ionescu i...@livius.net wrote:

 On May 29, 2012, at 14:01 , Xiaofan Chen wrote:

 For V8, there are too many versions to track.

 for V8, at least based on my experience, it would be useful to
 mention in the manual which was the latest version tested.

 I do agree with you here. So we can say 4.46f is the latest
 release version we tested. Since Segger does not archive
 the beta version, there is no point to mention the beta version
 (4.47h is the current beta version).

 V8 4.46f: J-Link ARM V8 compiled May  3 2012 18:36:22

 V8 4.22g is known to not work even with the patch.
 4.22g FW version string: J-Link ARM V8 compiled JAN 31 2011 18:34:52

 If needed, V6/V7 can be documented as well. I am not
 so sure what is the corresponding version. But the
 version stings are as following.

 V6: J-Link ARM V6 compiled Feb  1 2011 14:28:14
 V7: J-Link ARM V7 compiled Feb 15 2011 11:03:33

 V3 can be documented as well.
 V3: J-Link compiled Feb 20 2006 18:20:20 -- Update --

 Spen: could you get the latest version FW string for
 your V5, and double confirm my V6 string? Thanks.

 I know you have the two working but they may not
 be the latest version.
 V6: J-Link ARM V6 compiled Jun 30 2009 11:04:04 - working
 V5: J-Link compiled Jul 30 2008 11:24:37 ARM Rev.5 - working

If that is too detailed, we can just say please use
version 4.46f to update the FW for V1-V7 since that
will update them to their latest FW version up to
(actually all before) 4.46f. 4.46f is not the first version
to get V6/V7 to the following state but it will update
the existing V6/V7 to the following version if they
are not already there.
 V6: J-Link ARM V6 compiled Feb  1 2011 14:28:14
 V7: J-Link ARM V7 compiled Feb 15 2011 11:03:33

 the point is that after we release a version, Segger may
  release incompatible versions, and if something goes wrong,
 the user needs to know to whick of the many Segger versions
 to revert.

 Yes. This is good to have.

BTW, since you have done quite extensive test on V8,
did you record the version string versus Segger software
version?

 I just sent my first patch to the openocd.texi file, documenting
 the already implemented J-Link commands, I can add the version
 notice there too, if agreed.

 That is a good place to put. But I think Peter wants to have it
 in the codes, say to put in the version check patch, that is
 good proposal as well.


-- 
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-29 Thread Spencer Oliver
On 29 May 2012 14:22, Xiaofan Chen xiaof...@gmail.com wrote:

 Spen: could you get the latest version FW string for
 your V5, and double confirm my V6 string? Thanks.

 I know you have the two working but they may not
 be the latest version.
 V6: J-Link ARM V6 compiled Jun 30 2009 11:04:04 - working
 V5: J-Link compiled Jul 30 2008 11:24:37 ARM Rev.5 - working


v5 (marked 5.3) was already at the latest:
J-Link compiled Jul 30 2008 11:24:37 ARM Rev.5

I updated the V6 to the latest version and it still works fine.
J-Link ARM V6 compiled Feb  1 2011 14:28:14

tested with/without patches.
Spen

--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-29 Thread Liviu Ionescu

On May 29, 2012, at 17:00 , Xiaofan Chen wrote:

 If that is too detailed...

I added a compatibility notice to the manual (http://openocd.zylin.com/#/c/680/)

it is minimal now, a table would probably be more appropriate.

if we need to go for tables, I would appreciate help from someone with more 
experience with tex to add tables to the document...

Liviu


--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-29 Thread Xiaofan Chen
On Tue, May 29, 2012 at 10:17 PM, Liviu Ionescu i...@livius.net wrote:

 On May 29, 2012, at 17:00 , Xiaofan Chen wrote:

 If that is too detailed...

 I added a compatibility notice to the manual
 (http://openocd.zylin.com/#/c/680/)

 it is minimal now, a table would probably be more appropriate.

What you have is already quite good to me. :-)
At least it points the user directly to a workable
solution.

 if we need to go for tables, I would appreciate help from
 someone with more experience with tex to add tables to
 the document...



-- 
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-29 Thread Peter Stuge
Liviu Ionescu wrote:
 I added a compatibility notice to the manual
 (http://openocd.zylin.com/#/c/680/)
 
 it is minimal now, a table would probably be more appropriate.
 
 if we need to go for tables, I would appreciate help from someone
 with more experience with tex to add tables to the document...

Please add it into the code. It will naturally be kept up to date
there in a way which is impossible for documentation.


//Peter

--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-28 Thread Xiaofan Chen
On Mon, May 28, 2012 at 4:55 PM, Alexander Osipenko sip...@gmail.com wrote:
 Hi,

 i have submit latest patches.
 The problem with pre-V6 should be fixed.

Thanks. Yes the latest patch set is good. I give it a +1 now. On
the other hand, maybe it is good to get some confirmation from
Spen as well.

I will also try to borrow a V6 to further test the new patch set.

Take note I also apply your patch here. I think that one should be
merged to the mainline git now.
http://openocd.zylin.com/#/c/670/

mymacmini:stm32 xiaofanc$ ~/binj2/bin/openocd -f openocd_jlink.cfg
Open On-Chip Debugger 0.6.0-dev-00597-gb4ce520-dirty (2012-05-28-18:34)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
1000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
cortex_m3 reset_config sysresetreq
[timestamp] [threadID] facility level [function call] message

[ 0.00] [0407] libusbx: warning
[darwin_cache_device_descriptor] could not retrieve device descriptor
05ac:8281: device not responding. skipping device
[ 0.203557] [0407] libusbx: warning [libusb_get_config_descriptor]
descriptor data still left
[ 0.265642] [0407] libusbx: warning [libusb_get_config_descriptor]
descriptor data still left
Info : J-Link initialization started / target CPU reset initiated
Info : J-Link compiled Feb 20 2006 18:20:20 -- Update --
Info : J-Link caps 0x3
Info : J-Link hw version 3
Info : J-Link hw type J-Link
Info : Vref = 3.286 TCK = 1 TDI = 1 TDO = 1 TMS = 1 SRST = 0 TRST = 255
Info : J-Link JTAG Interface ready
Info : clock speed 1000 kHz
Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg:
0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32f1x.bs tap/device found: 0x16410041 (mfg: 0x020,
part: 0x6410, ver: 0x1)
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
1000 kHz
Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg:
0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32f1x.bs tap/device found: 0x16410041 (mfg: 0x020,
part: 0x6410, ver: 0x1)
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x0100 pc: 0x0800272c msp: 0x2810
8000 kHz
dumped 131072 bytes in 1.045539s (122.425 KiB/s)
verified 131072 bytes in 0.286362s (446.987 KiB/s)
Info : device id = 0x20036410
Info : flash size = 128kbytes
stm32x mass erase complete
wrote 131072 bytes from file dump.bin in 3.618656s (35.372 KiB/s)
verified 131072 bytes in 0.292000s (438.356 KiB/s)
20480 bytes written at address 0x2000
downloaded 20480 bytes in 0.149020s (134.210 KiB/s)
1000 kHz
Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg:
0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32f1x.bs tap/device found: 0x16410041 (mfg: 0x020,
part: 0x6410, ver: 0x1)
shutdown command invoked


-- 
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-28 Thread Xiaofan Chen
On Mon, May 28, 2012 at 6:46 PM, Xiaofan Chen xiaof...@gmail.com wrote:
 On Mon, May 28, 2012 at 4:55 PM, Alexander Osipenko sip...@gmail.com wrote:
 Hi,

 i have submit latest patches.
 The problem with pre-V6 should be fixed.

 Thanks. Yes the latest patch set is good. I give it a +1 now. On
 the other hand, maybe it is good to get some confirmation from
 Spen as well.

 I will also try to borrow a V6 to further test the new patch set.

 Take note I also apply your patch here. I think that one should be
 merged to the mainline git now.
 http://openocd.zylin.com/#/c/670/

BTW, I also tested V7 and V8 J-Link and both work fine.

I need to return the V8 J-Link to my colleague so that I
can not test it again until the weekend. But I will get a
V6 for testing.

 mymacmini:stm32 xiaofanc$ ~/binj2/bin/openocd -f openocd_jlink.cfg
 Open On-Chip Debugger 0.6.0-dev-00597-gb4ce520-dirty (2012-05-28-18:34)
 Licensed under GNU GPL v2
 For bug reports, read
        http://openocd.sourceforge.net/doc/doxygen/bugs.html
 Info : only one transport option; autoselect 'jtag'
 1000 kHz
 adapter_nsrst_delay: 100
 jtag_ntrst_delay: 100
 cortex_m3 reset_config sysresetreq
 [timestamp] [threadID] facility level [function call] message
 
 [ 0.00] [0407] libusbx: warning
 [darwin_cache_device_descriptor] could not retrieve device descriptor
 05ac:8281: device not responding. skipping device
 [ 0.203557] [0407] libusbx: warning [libusb_get_config_descriptor]
 descriptor data still left
 [ 0.265642] [0407] libusbx: warning [libusb_get_config_descriptor]
 descriptor data still left
 Info : J-Link initialization started / target CPU reset initiated
 Info : J-Link compiled Feb 20 2006 18:20:20 -- Update --
 Info : J-Link caps 0x3
 Info : J-Link hw version 3
 Info : J-Link hw type J-Link
 Info : Vref = 3.286 TCK = 1 TDI = 1 TDO = 1 TMS = 1 SRST = 0 TRST = 255
 Info : J-Link JTAG Interface ready
 Info : clock speed 1000 kHz
 Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg:
 0x23b, part: 0xba00, ver: 0x3)
 Info : JTAG tap: stm32f1x.bs tap/device found: 0x16410041 (mfg: 0x020,
 part: 0x6410, ver: 0x1)
 Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
 1000 kHz
 Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg:
 0x23b, part: 0xba00, ver: 0x3)
 Info : JTAG tap: stm32f1x.bs tap/device found: 0x16410041 (mfg: 0x020,
 part: 0x6410, ver: 0x1)
 target state: halted
 target halted due to debug-request, current mode: Thread
 xPSR: 0x0100 pc: 0x0800272c msp: 0x2810
 8000 kHz
 dumped 131072 bytes in 1.045539s (122.425 KiB/s)
 verified 131072 bytes in 0.286362s (446.987 KiB/s)
 Info : device id = 0x20036410
 Info : flash size = 128kbytes
 stm32x mass erase complete
 wrote 131072 bytes from file dump.bin in 3.618656s (35.372 KiB/s)
 verified 131072 bytes in 0.292000s (438.356 KiB/s)
 20480 bytes written at address 0x2000
 downloaded 20480 bytes in 0.149020s (134.210 KiB/s)
 1000 kHz
 Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg:
 0x23b, part: 0xba00, ver: 0x3)
 Info : JTAG tap: stm32f1x.bs tap/device found: 0x16410041 (mfg: 0x020,
 part: 0x6410, ver: 0x1)
 shutdown command invoked

mymacmini:stm32 xiaofanc$ ~/binj2/bin/openocd -f openocd_jlink.cfg
Open On-Chip Debugger 0.6.0-dev-00597-gb4ce520-dirty (2012-05-28-18:34)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
1000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
cortex_m3 reset_config sysresetreq
[timestamp] [threadID] facility level [function call] message

[ 0.00] [0407] libusbx: warning
[darwin_cache_device_descriptor] could not retrieve device descriptor
05ac:8281: device not responding. skipping device
Info : J-Link initialization started / target CPU reset initiated
Info : J-Link ARM V7 compiled Feb 15 2011 11:03:33
Info : J-Link caps 0xb9ff7bbf
Info : J-Link hw version 7
Info : J-Link hw type J-Link
Info : J-Link max mem block 9000
Info : J-Link configuration
Info : USB-Address: 0x0
Info : Kickstart power on JTAG-pin 19: 0x
Info : Vref = 3.274 TCK = 1 TDI = 0 TDO = 1 TMS = 0 SRST = 0 TRST = 0
Info : J-Link JTAG Interface ready
Info : clock speed 1000 kHz
Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg:
0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32f1x.bs tap/device found: 0x16410041 (mfg: 0x020,
part: 0x6410, ver: 0x1)
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
1000 kHz
Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg:
0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32f1x.bs tap/device found: 0x16410041 (mfg: 0x020,
part: 0x6410, ver: 0x1)
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x0100 pc: 

Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-28 Thread Xiaofan Chen
On Mon, May 28, 2012 at 7:25 PM, Alexander Osipenko sip...@gmail.com wrote:
 I have tested V8 with latest firmware: result is OK.

Yes this is in line with my test result. Your latest patch is okay
for V3/V7/V8 based on my test. I will get a V6 to test as well.
Most likely it is okay based on Spen's results.

So far I think your other patch is not necessary, but we may
have to wait for more test results.
http://openocd.zylin.com/#/c/678/

Quote from Spen's test results which shows V5/V6 works
with or without your patch. And his V8 does not work with
either one.
++
current git head
J-Link ARM V8 compiled Jan 31 2011 18:34:52 - not working
J-Link ARM V6 compiled Jun 30 2009 11:04:04 - working
J-Link compiled Jul 30 2008 11:24:37 ARM Rev.5 - working

using Alexander jlink patches
J-Link ARM V8 compiled Jan 31 2011 18:34:52 - not working
J-Link ARM V6 compiled Jun 30 2009 11:04:04 - working
J-Link compiled Jul 30 2008 11:24:37 ARM Rev.5 - working
+

Maybe your latest patch works with his V8.


-- 
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-28 Thread Spencer Oliver
On 28 May 2012 12:33, Xiaofan Chen xiaof...@gmail.com wrote:
 On Mon, May 28, 2012 at 7:25 PM, Alexander Osipenko sip...@gmail.com wrote:
 I have tested V8 with latest firmware: result is OK.

 Yes this is in line with my test result. Your latest patch is okay
 for V3/V7/V8 based on my test. I will get a V6 to test as well.
 Most likely it is okay based on Spen's results.

 So far I think your other patch is not necessary, but we may
 have to wait for more test results.
 http://openocd.zylin.com/#/c/678/

 Quote from Spen's test results which shows V5/V6 works
 with or without your patch. And his V8 does not work with
 either one.

I have upgraded my jlink (v8) to latest release (4.46f - May  3 2012)
and it now works with Alexander's patches.

Before it was on Jan 31 2011 and failed with git HEAD and new patches.

Spen

--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-28 Thread Xiaofan Chen
On Mon, May 28, 2012 at 7:45 PM, Spencer Oliver s...@spen-soft.co.uk wrote:
 I have upgraded my jlink (v8) to latest release (4.46f - May  3 2012)
 and it now works with Alexander's patches.

Great.

 Before it was on Jan 31 2011 and failed with git HEAD and new patches.


Just wondering whether you know the corresponding Segger software
package version (4.xx).



-- 
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-28 Thread Spencer Oliver

 Just wondering whether you know the corresponding Segger software
 package version (4.xx).


4.22g

--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-28 Thread Xiaofan Chen
On Mon, May 28, 2012 at 7:53 PM, Spencer Oliver s...@spen-soft.co.uk wrote:

 Just wondering whether you know the corresponding Segger software
 package version (4.xx).


 4.22g

So I just tried 4.22g and indeed it has some problems with the
patch. It does not work at all with the current git. The patched
version is kind of interesting, the first run after plug-in does not
work, run it again and it seems to work. I tried a few times and
the result is consistent.

1) Downgrade the firmware under Windows.
SEGGER J-Link Commander V4.22g ('?' for help)
Compiled Feb  7 2011 16:13:26
DLL version V4.22g, compiled Feb  7 2011 16:13:12
Firmware: J-Link ARM V8 compiled May 24 2012 11:19:27
Hardware: V8.00
S/N: x
OEM: IAR
J-Linkexec invalidateFw
Info: Updating firmware:  J-Link ARM V8 compiled JAN 31 2011 18:34:52
Info: Replacing firmware: J-Link ARM V8 compiled May 24 2012 11:19:27
Info: Waiting for new firmware to boot
Info: New firmware booted successfully
J-Link

2) Tested under Mac OS X, vanilla git does not work at all.
It seems there are still issues with some other OpenOCD issue
with regard to this version of FW.

mymacmini:stm32 xiaofanc$ openocd -f openocd_jlink.cfg
Open On-Chip Debugger 0.6.0-dev-00595-g445a54a (2012-05-25-20:38)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Warn : Adapter driver 'jlink' did not declare which transports it
allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
1000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
cortex_m3 reset_config sysresetreq
libusbx: warning [darwin_cache_device_descriptor] could not retrieve
device descriptor 05ac:8281: device not responding. skipping device
Info : J-Link initialization started / target CPU reset initiated
Info : J-Link ARM V8 compiled JAN 31 2011 18:34:52
Info : J-Link caps 0xb9ff7bbf
Info : J-Link hw version 8
Info : J-Link hw type J-Link
Info : J-Link max mem block 8368
Info : J-Link configuration
Info : USB-Address: 0x0
Info : Kickstart power on JTAG-pin 19: 0xff01
Info : Vref = 3.293 TCK = 1 TDI = 0 TDO = 1 TMS = 0 SRST = 0 TRST = 0
Info : J-Link JTAG Interface ready
libusbx: error [darwin_transfer_status] transfer error: data overrun
Error: usb_bulk_read failed (requested=1, result=0)
Error: jlink_tap_execute, wrong result -107 (expected 1)
Info : clock speed 1000 kHz
libusbx: error [submit_bulk_transfer] bulk transfer failed (dir = In):
pipe is stalled (code = 0xe000404f)
Error: usb_bulk_read failed (requested=1, result=0)
Error: jlink_tap_execute, wrong result -107 (expected 1)
libusbx: error [submit_bulk_transfer] bulk transfer failed (dir = In):
pipe is stalled (code = 0xe000404f)
Error: usb_bulk_read failed (requested=1, result=0)
Error: jlink_tap_execute, wrong result -107 (expected 1)
in procedure 'transport'
Runtime Error: openocd_jlink.cfg:19:
in procedure 'script'
at file embedded:startup.tcl, line 58
in procedure 'init' called at file openocd_jlink.cfg, line 19


3) Unplug and then plug the J-Link and then try the patched
version. The first run does not work. The 2nd run seems to work
but there is a command failed.
J-Link command EMU_CMD_VERSION failed (0)

mymacmini:stm32 xiaofanc$ ~/binj2/bin/openocd -f openocd_jlink.cfg
Open On-Chip Debugger 0.6.0-dev-00597-gb4ce520-dirty (2012-05-28-18:34)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
1000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
cortex_m3 reset_config sysresetreq
libusbx: warning [darwin_cache_device_descriptor] could not retrieve
device descriptor 05ac:8281: device not responding. skipping device
Info : J-Link initialization started / target CPU reset initiated
Info : J-Link ARM V8 compiled JAN 31 2011 18:34:52
Info : J-Link caps 0xb9ff7bbf
Info : J-Link hw version 8
Info : J-Link hw type J-Link
Info : J-Link max mem block 8368
Info : J-Link configuration
Info : USB-Address: 0x0
Info : Kickstart power on JTAG-pin 19: 0xff01
Info : Vref = 3.293 TCK = 1 TDI = 0 TDO = 1 TMS = 0 SRST = 0 TRST = 0
Info : J-Link JTAG Interface ready
libusbx: error [darwin_transfer_status] transfer error: data overrun
Error: usb_bulk_read failed (requested=1, result=0)
Error: jlink_tap_execute, wrong result -107 (expected 1)
Info : clock speed 1000 kHz
libusbx: error [submit_bulk_transfer] bulk transfer failed (dir = In):
pipe is stalled (code = 0xe000404f)
Error: usb_bulk_read failed (requested=1, result=0)
Error: jlink_tap_execute, wrong result -107 (expected 1)
libusbx: error [submit_bulk_transfer] bulk transfer failed (dir = In):
pipe is stalled (code = 0xe000404f)
Error: usb_bulk_read failed (requested=1, result=0)
Error: jlink_tap_execute, wrong result -107 (expected 1)
in procedure 'transport'
Runtime Error: openocd_jlink.cfg:19:
in procedure 'script'
at file embedded:startup.tcl, line 58
in procedure 'init' called at file 

Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-27 Thread Xiaofan Chen
On Sun, May 27, 2012 at 1:49 PM, Liviu Ionescu i...@livius.net wrote:

 On May 27, 2012, at 08:12 , Xiaofan Chen wrote:

 The thing is that both my V7 and V8 also work under vanilla git
 now. So my test does not show problems with either your patch
 or vanilla git.

 according to my tests, the latest version that worked without the patch was 
 4.42c

        Info : J-Link ARM V8 compiled Feb  8 2012 14:30:39

 and the FW bug was introduced with version 4.44

        Info : J-Link ARM V8 compiled Mar 19 2012 10:24:49

 (older versions did not need to explicitly initialise the JTAG transport).

 based on some reports, it may be possible that around version 4.30 there
 was another FW bug, that Segger fixed some versions later, but I do not have
 accurate data for this.

Last time the data are like this. Based on your first post and other reports,
up to v4.14g works. v4.14h onwards no longer works. 4.33h beta works again
as per my test.
http://lists.berlios.de/pipermail/openocd-development/2011-August/020741.html

4.33h beta.
Info : J-Link initialization started / target CPU reset initiated
Info : J-Link ARM V8 compiled Aug 18 2011 19:52:49
Info : J-Link caps 0xb9ff7bbf
Info : J-Link hw version 8
Info : J-Link hw type J-Link
Info : J-Link max mem block 9424
Info : J-Link configuration
Info : USB-Address: 0x0
Info : Kickstart power on JTAG-pin 19: 0xff01
Info : Vref = 3.222 TCK = 1 TDI = 0 TDO = 1 TMS = 0 SRST = 0 TRST = 0

Last time I also tested 4.36e (20-Oct-2011) which also works.
And based on your test, up to 4.42c works, 4.44 doesn't.

 there is also a new 4.46g beta, that came out these days; it might be
 interesting to test it too.

I see there is a 4.47h beta and it does not change my test result.

SEGGER J-Link Commander V4.47h ('?' for help)
Compiled May 24 2012 18:28:13
Updating firmware:  J-Link ARM V8 compiled May 24 2012 11:19:27 (note:
4.46f release)
Replacing firmware: J-Link ARM V8 compiled May  3 2012 18:36:22
Waiting for new firmware to boot
New firmware booted successfully
DLL version V4.47h, compiled May 24 2012 18:27:55
Firmware: J-Link ARM V8 compiled May 24 2012 11:19:27
Hardware: V8.00
S/N: x
OEM: IAR

I just tried another target, Olimex's LPC-P2148 demo board
and a lpcusb test firmware (USB Isochronous Transfer). I have
a lot of difficulties with this board and OpenOCD since often
openocd will fail to find the jtag chain. But then both version
(vanilla git or with the J-Link patch) behave the same.

mymacmini:lpc2148 xiaofanc$ openocd -f openocd.cfg
Open On-Chip Debugger 0.6.0-dev-00595-g445a54a (2012-05-25-20:38)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Warn : Adapter driver 'jlink' did not declare which transports it
allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
Warning - assuming default core clock 12MHz! Flashing may fail if
actual core clock is different.
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
1500 kHz
Info : J-Link initialization started / target CPU reset initiated
Info : J-Link ARM V8 compiled May 24 2012 11:19:27
Info : J-Link caps 0xb9ff7bbf
Info : J-Link hw version 8
Info : J-Link hw type J-Link
Info : J-Link max mem block 9328
Info : J-Link configuration
Info : USB-Address: 0x0
Info : Kickstart power on JTAG-pin 19: 0xff01
Info : Vref = 3.287 TCK = 1 TDI = 0 TDO = 0 TMS = 0 SRST = 0 TRST = 0
Info : J-Link JTAG Interface ready
Info : clock speed 1500 kHz
Info : JTAG tap: lpc2148.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787,
part: 0xf1f0, ver: 0x4)
Info : Embedded ICE version 4
Info : lpc2148.cpu: hardware has 2 breakpoint/watchpoint units
fast memory access is enabled
dcc downloads are enabled
Info : JTAG tap: lpc2148.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787,
part: 0xf1f0, ver: 0x4)
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x00d3 pc: 0x
1500 kHz
flash 'lpc2000' found at 0x
erased sectors 0 through 26 on flash bank 0 in 0.448562s
Warn : Verification will fail since checksum in image (0xe1a0) to
be written to flash is different from calculated vector checksum
(0xb9205f84).
Warn : To remove this warning modify build tools on developer PC to
inject correct LPC vector checksum.
wrote 8634 bytes from file lpcusbisoc.hex in 0.382038s (22.070 KiB/s)
Info : JTAG tap: lpc2148.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787,
part: 0xf1f0, ver: 0x4)
target state: halted
target halted in ARM state due to debug-request, current mode: System
cpsr: 0x805f pc: 0x08a4
dumped 262144 bytes in 5.564141s (46.009 KiB/s)
verified 262144 bytes in 0.520811s (491.541 KiB/s)
Info : JTAG tap: lpc2148.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787,
part: 0xf1f0, ver: 0x4)
shutdown command invoked

mymacmini:lpc2148 xiaofanc$ ~/binj/bin/openocd -f openocd.cfg
Open On-Chip Debugger 0.6.0-dev-00593-gdd14d84 

Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-27 Thread Alexander Osipenko
Hi Xiaofan,

Notice to switch of JLink power to check operation of vanilla / patched version.
JLink remembers last selected interface (at least untill switched off),

The most interesting right now is patch operation with V7.
Taking special care of V7 may introduce a bugs in future, when someone
decide to implement SWD.
Such specific should be avoided whenever possible.

I wil split the patch into two parts: basic V8 and special care of V7
so we can decide to merge any of them.


2012/5/27 Xiaofan Chen xiaof...@gmail.com:
 On Sun, May 27, 2012 at 12:25 PM, Xiaofan Chen xiaof...@gmail.com wrote:
 On Fri, May 25, 2012 at 10:13 PM, Xiaofan Chen xiaof...@gmail.com wrote:
 On Fri, May 25, 2012 at 5:39 PM, Xiaofan Chen xiaof...@gmail.com wrote:
 On Fri, May 25, 2012 at 3:08 PM, Alexander Osipenko sip...@gmail.com 
 wrote:
 Thanks Liviu for valuable comments!

 I have pushed patches to gerrit, and check them on fresh branch.

  http://openocd.zylin.com/666
  http://openocd.zylin.com/667


 Great. I borrowed an V8 J-Link from colleague and I can carry out
 some tests on the V8. I will also test if the patches will affect existing
 older revisions as well (V3, V7 and I can borrow V6 as well).


 It seems to cause some problems for my V7.

 You can see that in reality it still worked in the end. The above
 is under my Mac Mini running Mac OS X 10.7.4.

 I then tried the same setup under Ubuntu Linux 12.04 with
 another PC (6-year old Dell GX620 desktop) and actually it works
 without a problem.

 Open On-Chip Debugger 0.6.0-dev-00593-gdd14d84 (2012-05-27-10:56)
 Licensed under GNU GPL v2
 For bug reports, read
        http://openocd.sourceforge.net/doc/doxygen/bugs.html
 Info : only one transport option; autoselect 'jtag'
 1000 kHz
 adapter_nsrst_delay: 100
 jtag_ntrst_delay: 100
 cortex_m3 reset_config sysresetreq
 Info : J-Link initialization started / target CPU reset initiated
 Info : J-Link ARM V7 compiled Feb 15 2011 11:03:33
 Info : J-Link caps 0xb9ff7bbf
 Info : J-Link hw version 7
 Info : J-Link hw type J-Link
 Info : J-Link max mem block 9000
 Info : J-Link configuration
 Info : USB-Address: 0x0
 Info : Kickstart power on JTAG-pin 19: 0x
 Info : Vref = 3.274 TCK = 1 TDI = 0 TDO = 1 TMS = 0 SRST = 0 TRST = 0
 Info : J-Link JTAG Interface ready
 Info : clock speed 1000 kHz
 Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg:
 0x23b, part: 0xba00, ver: 0x3)
 Info : JTAG tap: stm32f1x.bs tap/device found: 0x16410041 (mfg: 0x020,
 part: 0x6410, ver: 0x1)
 Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
 1000 kHz
 Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg:
 0x23b, part: 0xba00, ver: 0x3)
 Info : JTAG tap: stm32f1x.bs tap/device found: 0x16410041 (mfg: 0x020,
 part: 0x6410, ver: 0x1)
 target state: halted
 target halted due to debug-request, current mode: Thread
 xPSR: 0x0100 pc: 0x0800272c msp: 0x2810
 8000 kHz
 Info : device id = 0x20036410
 Info : flash size = 128kbytes
 stm32x mass erase complete
 wrote 10048 bytes from file LCD_demo.bin in 0.595868s (16.468 KiB/s)
 verified 10048 bytes in 0.281748s (34.827 KiB/s)
 dumped 131072 bytes in 1.150646s (111.242 KiB/s)
 verified 131072 bytes in 0.468557s (273.179 KiB/s)
 stm32x mass erase complete
 wrote 131072 bytes from file dump_LCD_demo.bin in 3.826826s (33.448 KiB/s)
 verified 131072 bytes in 0.472781s (270.738 KiB/s)
 10048 bytes written at address 0x2000
 downloaded 10048 bytes in 0.087205s (112.522 KiB/s)
 1000 kHz
 Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg:
 0x23b, part: 0xba00, ver: 0x3)
 Info : JTAG tap: stm32f1x.bs tap/device found: 0x16410041 (mfg: 0x020,
 part: 0x6410, ver: 0x1)
 shutdown command invoked

 Then I tested the vanilla git with V7 and it works as expected.

 The V7 seems to have the latest firmware already since Segger
 tools under Windows does not prompt for firmware updates.

 I also tested your patch with V8 and it works as expected.

 Now it is strange. The vanilla git also works under my Ubuntu 12.04
 with the V8 and latest release firmware.

 I can not explain the differences now. Maybe my Mac's behavior is
 a bit strange.

 mcuee@GX620Ubuntu:~/Desktop/build/openocd/stm32$ openocd -f
 openocd_jlink.cfgOpen On-Chip Debugger 0.6.0-dev-00595-g445a54a
 (2012-05-27-10:22)
 Licensed under GNU GPL v2
 For bug reports, read
        http://openocd.sourceforge.net/doc/doxygen/bugs.html
 Warn : Adapter driver 'jlink' did not declare which transports it
 allows; assuming legacy JTAG-only
 Info : only one transport option; autoselect 'jtag'
 1000 kHz
 adapter_nsrst_delay: 100
 jtag_ntrst_delay: 100
 cortex_m3 reset_config sysresetreq
 Info : J-Link initialization started / target CPU reset initiated
 Info : J-Link ARM V8 compiled May  3 2012 18:36:22
 Info : J-Link caps 0xb9ff7bbf
 Info : J-Link hw version 8
 Info : J-Link hw type J-Link
 Info : J-Link max mem block 9336
 Info : J-Link configuration
 Info : USB-Address: 0x0
 Info : Kickstart 

Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-27 Thread Xiaofan Chen
On Mon, May 28, 2012 at 6:42 AM, Alexander Osipenko sip...@gmail.com wrote:
 Hi Xiaofan,

 Notice to switch of JLink power to check operation of vanilla / patched 
 version.
 JLink remembers last selected interface (at least untill switched off),

Ah, that is why the vanilla un-patched version works for me. Once
I follow your advice to switch off the power between tests, the
vanilla git version no longer works but the patched version works.

mymacmini:lpc2148 xiaofanc$ openocd -f openocd.cfg
Open On-Chip Debugger 0.6.0-dev-00595-g445a54a (2012-05-25-20:38)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Warn : Adapter driver 'jlink' did not declare which transports it
allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
Warning - assuming default core clock 12MHz! Flashing may fail if
actual core clock is different.
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
1500 kHz
[timestamp] [threadID] facility level [function call] message

[ 0.00] [0407] libusbx: warning
[darwin_cache_device_descriptor] could not retrieve device descriptor
05ac:8281: device not responding. skipping device
Info : J-Link initialization started / target CPU reset initiated
Info : J-Link ARM V8 compiled May 24 2012 11:19:27
Info : J-Link caps 0xb9ff7bbf
Info : J-Link hw version 8
Info : J-Link hw type J-Link
Info : J-Link max mem block 9328
Info : J-Link configuration
Info : USB-Address: 0x0
Info : Kickstart power on JTAG-pin 19: 0xff01
Info : Vref = 3.287 TCK = 0 TDI = 1 TDO = 0 TMS = 1 SRST = 0 TRST = 1
Info : J-Link JTAG Interface ready
Info : clock speed 1500 kHz
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: lpc2148.cpu: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : Embedded ICE version 0
Error: unknown EmbeddedICE version (comms ctrl: 0x)
Info : lpc2148.cpu: hardware has 2 breakpoint/watchpoint units
fast memory access is enabled
dcc downloads are enabled
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: lpc2148.cpu: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
Error: timed out while waiting for target halted
TARGET: lpc2148.cpu - Not halted

Runtime Error: openocd.cfg:7:
in procedure 'script'
at file embedded:startup.tcl, line 58
in procedure 'reset' called at file openocd.cfg, line 7

mymacmini:lpc2148 xiaofanc$ ~/binj/bin/openocd -f openocd.cfg
Open On-Chip Debugger 0.6.0-dev-00593-gdd14d84 (2012-05-25-21:10)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Warning - assuming default core clock 12MHz! Flashing may fail if
actual core clock is different.
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
1500 kHz
[timestamp] [threadID] facility level [function call] message

[ 0.00] [0407] libusbx: warning
[darwin_cache_device_descriptor] could not retrieve device descriptor
05ac:8281: device not responding. skipping device
Info : J-Link initialization started / target CPU reset initiated
Info : J-Link ARM V8 compiled May 24 2012 11:19:27
Info : J-Link caps 0xb9ff7bbf
Info : J-Link hw version 8
Info : J-Link hw type J-Link
Info : J-Link max mem block 9328
Info : J-Link configuration
Info : USB-Address: 0x0
Info : Kickstart power on JTAG-pin 19: 0xff01
Info : Vref = 3.293 TCK = 0 TDI = 1 TDO = 0 TMS = 1 SRST = 0 TRST = 1
Info : J-Link JTAG Interface ready
Info : clock speed 1500 kHz
Info : JTAG tap: lpc2148.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787,
part: 0xf1f0, ver: 0x4)
Info : Embedded ICE version 4
Info : lpc2148.cpu: hardware has 2 breakpoint/watchpoint units
fast memory access is enabled
dcc downloads are enabled
Info : JTAG tap: lpc2148.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787,
part: 0xf1f0, ver: 0x4)
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x00d3 pc: 0x
1500 kHz
flash 'lpc2000' found at 0x
erased sectors 0 through 26 on flash bank 0 in 0.476376s
Warn : Verification will fail since checksum in image (0xe1a0) to
be written to flash is different from calculated vector checksum
(0xb9205f84).
Warn : To remove this warning modify build tools on developer PC to
inject correct LPC vector checksum.
wrote 8634 bytes from file lpcusbisoc.hex in 0.676193s (12.469 KiB/s)
Info : 

Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-27 Thread Xiaofan Chen
On Mon, May 28, 2012 at 8:53 AM, Xiaofan Chen xiaof...@gmail.com wrote:
 Take note V3 does not support SWD. That is why the
 following error message comes out.
 Error: J-Link command EMU_CMD_SELECT_IF failed (0)

 V1/V2/V3/V4 are using Renesas MCU and not the Atmel MCU
 used by later J-Link and they only support up to 4MHz JTAG

They are using 16bit CISC MCU and supports up to
8MHz.

 frequency. The later ones support 12MHz. V6 onwards
 support SWD. I once found a web page comparing different
 version of J-Link in terms of HW/FW but I could not find it
 any more.

The older version of the Segger user guide has the HW
revision info up to V5.2.
Eg: http://www.tiasur.ru/include/images/ware/pdf/EK66144.PDF

SWD is only supported by V6 and above.


-- 
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-26 Thread Alexander Osipenko
I have added Jan 31 2011 to the list of unsupported.

Although I've tested CAPS bits incorrectly, the V7 caps has bit 17 set
 (EMU_CAP_SELECT_IF=17)

Info : J-Link ARM V7 compiled Feb 15 2011 11:03:33
Info : J-Link caps 0xb9ff7bbf
Info : J-Link hw version 7
Info : J-Link hw type J-Link

Thus I decided to check additionaly for V8 version, and skip SELECT_IF
for earlier hardware.

It would be interesting to see USB trace (by usbmon program) of the V7.

Any other ideas?

I will submit patches on monday, after check on hardware.

Regards,
Alex.


2012/5/25 Spencer Oliver s...@spen-soft.co.uk:
 On 25 May 2012 15:19, Xiaofan Chen xiaof...@gmail.com wrote:
 On Fri, May 25, 2012 at 10:13 PM, Xiaofan Chen xiaof...@gmail.com wrote:
 On Fri, May 25, 2012 at 5:39 PM, Xiaofan Chen xiaof...@gmail.com wrote:
 On Fri, May 25, 2012 at 3:08 PM, Alexander Osipenko sip...@gmail.com 
 wrote:
 Thanks Liviu for valuable comments!

 I have pushed patches to gerrit, and check them on fresh branch.

  http://openocd.zylin.com/666
  http://openocd.zylin.com/667



 I have just run a  few tests with some jlinks i have about, results
 are the same.

 current git head
 J-Link ARM V8 compiled Jan 31 2011 18:34:52 - not working
 J-Link ARM V6 compiled Jun 30 2009 11:04:04 - working
 J-Link compiled Jul 30 2008 11:24:37 ARM Rev.5 - working

 using Alexander jlink patches
 J-Link ARM V8 compiled Jan 31 2011 18:34:52 - not working
 J-Link ARM V6 compiled Jun 30 2009 11:04:04 - working
 J-Link compiled Jul 30 2008 11:24:37 ARM Rev.5 - working

 as you can see the software is old in all of them, we use ulink-pro at work.
 I may run a git bisect as i am sure the v8 worked last time i used it
 with OpenOCD.

 If i get time i will try and update the firmware in the V8

 Cheers
 Spen

--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-26 Thread Liviu Ionescu

On May 26, 2012, at 18:14 , Alexander Osipenko wrote:

 Thus I decided to check additionaly for V8 version, and skip SELECT_IF
 for earlier hardware.

you mean the corresponding CAPS bit is set, you isued the SELECT_IF interface, 
you did not receive an error, but the device still does not work?

that's probably another bug in older firmware.

regarding the SELECT_IF command, did you notice that you have to first test if 
JTAG is available before selecting it?

although this is probably true for all existing probes, it is still a good idea 
to do it, for just in case Segger will design future SWD only probes.

regards,

Liviu


--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-26 Thread Alexander Osipenko
2012/5/26 Liviu Ionescu i...@livius.net:

 On May 26, 2012, at 18:14 , Alexander Osipenko wrote:

 Thus I decided to check additionaly for V8 version, and skip SELECT_IF
 for earlier hardware.

 you mean the corresponding CAPS bit is set, you isued the SELECT_IF 
 interface, you did not receive an error, but the device still does not work?

Yes, this problem was reported for V7 hardware by Xiaofan Chen earlier
in this thread.



 that's probably another bug in older firmware.

 regarding the SELECT_IF command, did you notice that you have to first test 
 if JTAG is available before selecting it?

 although this is probably true for all existing probes, it is still a good 
 idea to do it, for just in case Segger will design future SWD only probes.
Ok.


 regards,

 Liviu


--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-26 Thread Xiaofan Chen
On Sun, May 27, 2012 at 12:25 PM, Xiaofan Chen xiaof...@gmail.com wrote:
 On Fri, May 25, 2012 at 10:13 PM, Xiaofan Chen xiaof...@gmail.com wrote:
 On Fri, May 25, 2012 at 5:39 PM, Xiaofan Chen xiaof...@gmail.com wrote:
 On Fri, May 25, 2012 at 3:08 PM, Alexander Osipenko sip...@gmail.com 
 wrote:
 Thanks Liviu for valuable comments!

 I have pushed patches to gerrit, and check them on fresh branch.

  http://openocd.zylin.com/666
  http://openocd.zylin.com/667


 Great. I borrowed an V8 J-Link from colleague and I can carry out
 some tests on the V8. I will also test if the patches will affect existing
 older revisions as well (V3, V7 and I can borrow V6 as well).


 It seems to cause some problems for my V7.

 First run is with your patches. The 2nd run is with vanilla git which
 works fine with my V7.

 mymacmini:stm32 xiaofanc$ ~/binj/bin/openocd -f openocd_jlink.cfg
 Open On-Chip Debugger 0.6.0-dev-00593-gdd14d84 (2012-05-25-21:10)
 Licensed under GNU GPL v2
 For bug reports, read
        http://openocd.sourceforge.net/doc/doxygen/bugs.html
 Info : only one transport option; autoselect 'jtag'
 1000 kHz
 adapter_nsrst_delay: 100
 jtag_ntrst_delay: 100
 cortex_m3 reset_config sysresetreq

 Info : J-Link initialization started / target CPU reset initiated
 Info : J-Link ARM V7 compiled Feb 15 2011 11:03:33
 Info : J-Link caps 0xb9ff7bbf
 Info : J-Link hw version 7
 Info : J-Link hw type J-Link
 Info : J-Link max mem block 9000
 Info : J-Link configuration
 Info : USB-Address: 0xff
 Info : Kickstart power on JTAG-pin 19: 0x
 Info : Vref = 3.267 TCK = 1 TDI = 0 TDO = 1 TMS = 0 SRST = 0 TRST = 0
 Info : J-Link JTAG Interface ready
 Info : clock speed 1000 kHz
 Info : JTAG tap: stm32f1x.cpu tap/device found: 0x03003fff (mfg:
 0x7ff, part: 0x3003, ver: 0x0)
 Warn : JTAG tap: stm32f1x.cpu       UNEXPECTED: 0x03003fff (mfg:
 0x7ff, part: 0x3003, ver: 0x0)
 Error: JTAG tap: stm32f1x.cpu  expected 1 of 1: 0x3ba00477 (mfg:
 0x23b, part: 0xba00, ver: 0x3)
 Info : TAP stm32f1x.bs does not have IDCODE
 Warn : JTAG tap: stm32f1x.bs       UNEXPECTED: 0x (mfg: 0x000,
 part: 0x, ver: 0x0)
 Error: JTAG tap: stm32f1x.bs  expected 1 of 9: 0x06412041 (mfg: 0x020,
 part: 0x6412, ver: 0x0)
 Error: JTAG tap: stm32f1x.bs  expected 2 of 9: 0x06410041 (mfg: 0x020,
 part: 0x6410, ver: 0x0)
 Error: JTAG tap: stm32f1x.bs  expected 3 of 9: 0x16410041 (mfg: 0x020,
 part: 0x6410, ver: 0x1)
 Error: JTAG tap: stm32f1x.bs  expected 4 of 9: 0x06420041 (mfg: 0x020,
 part: 0x6420, ver: 0x0)
 Error: JTAG tap: stm32f1x.bs  expected 5 of 9: 0x06414041 (mfg: 0x020,
 part: 0x6414, ver: 0x0)
 Error: JTAG tap: stm32f1x.bs  expected 6 of 9: 0x06418041 (mfg: 0x020,
 part: 0x6418, ver: 0x0)
 Error: JTAG tap: stm32f1x.bs  expected 7 of 9: 0x06430041 (mfg: 0x020,
 part: 0x6430, ver: 0x0)
 Error: JTAG tap: stm32f1x.bs  expected 8 of 9: 0x06420041 (mfg: 0x020,
 part: 0x6420, ver: 0x0)
 Error: JTAG tap: stm32f1x.bs  expected 9 of 9: 0x06428041 (mfg: 0x020,
 part: 0x6428, ver: 0x0)
 Warn : Unexpected idcode after end of chain: 33 0x
 Warn : Unexpected idcode after end of chain: 65 0x03fe
 Warn : Unexpected idcode after end of chain: 97 0x01ff
 Warn : Unexpected idcode after end of chain: 129 0x80fe
 Warn : Unexpected idcode after end of chain: 161 0x807f
 Warn : Unexpected idcode after end of chain: 193 0x807f
 Warn : Unexpected idcode after end of chain: 225 0x807f
 Warn : Unexpected idcode after end of chain: 257 0x807f
 Warn : Unexpected idcode after end of chain: 289 0x807f
 Warn : Unexpected idcode after end of chain: 321 0x807f
 Warn : Unexpected idcode after end of chain: 353 0x807f
 Warn : Unexpected idcode after end of chain: 385 0x807f
 Warn : Unexpected idcode after end of chain: 417 0x807f
 Warn : Unexpected idcode after end of chain: 449 0x807f
 Warn : Unexpected idcode after end of chain: 481 0x807f
 Warn : Unexpected idcode after end of chain: 513 0x807f
 Warn : Unexpected idcode after end of chain: 545 0x807f
 Warn : Unexpected idcode after end of chain: 577 0x807f
 Error: double-check your JTAG setup (interface, speed, missing TAPs, ...)
 Error: Trying to use configured scan chain anyway...
 Warn : Bypassing JTAG setup events due to errors
 Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
 1000 kHz
 Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg:
 0x23b, part: 0xba00, ver: 0x3)
 Info : JTAG tap: stm32f1x.bs tap/device found: 0x16410041 (mfg: 0x020,
 part: 0x6410, ver: 0x1)
 target state: halted
 target halted due to debug-request, current mode: Thread
 xPSR: 0x0100 pc: 0x0800272c msp: 0x2810
 8000 kHz
 dumped 131072 bytes in 1.276839s (100.248 KiB/s)
 verified 131072 bytes in 0.294065s (435.278 KiB/s)
 Info : device id = 0x20036410
 Info : flash size = 128kbytes
 stm32x mass erase complete
 wrote 131072 bytes from file dump.bin in 3.634734s (35.216 KiB/s)
 verified 131072 bytes in 0.300868s (425.436 

Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-26 Thread Liviu Ionescu

On May 27, 2012, at 08:12 , Xiaofan Chen wrote:

 The thing is that both my V7 and V8 also work under vanilla git
 now. So my test does not show problems with either your patch
 or vanilla git.

according to my tests, the latest version that worked without the patch was 
4.42c

Info : J-Link ARM V8 compiled Feb  8 2012 14:30:39

and the FW bug was introduced with version 4.44

Info : J-Link ARM V8 compiled Mar 19 2012 10:24:49

(older versions did not need to explicitly initialise the JTAG transport).

based on some reports, it may be possible that around version 4.30 there was 
another FW bug, that Segger fixed some versions later, but I do not have 
accurate data for this.

there is also a new 4.46g beta, that came out these days; it might be 
interesting to test it too.

regards,

Liviu


--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-25 Thread Alexander Osipenko
Thanks Liviu for valuable comments!

I have pushed patches to gerrit, and check them on fresh branch.

  http://openocd.zylin.com/666
  http://openocd.zylin.com/667

Best regards,
Alex.

--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-25 Thread Vaclav Peroutka
   A debugger should always select the appropriate target interface before 
   it
  starts communicating with the target,
   since otherwise it could also happen that a previous session with another
  debugger had selected SWD and the interface was not switched again by
  OpenOCD.
 
  Hi,
 
  does it mean that OpenOCD and JLink can now support SWD as well ? Is there
 any
  plan to add transport jlink_jtag and jlink_swd into OpenOCD ?
 
 
 No, it means Segger J-Link supports JTAG and SWD with Segger tools
 (and IAR, etc). But OpenOCD does not support SWD on J-Link.
 

Hi, I did not write that OpenOCD did it. But if JLink already has SWD support, 
OpenOCD _can_ (in the future) support this transport with JLink, as well. And 
my question was, if there were any plans to extend this support. Or JLink SWD 
commands are not publicly available from Segger ?


--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-25 Thread Alexander Osipenko
Hi Liviu,

Could you help to clarify with SEGGER protocol documentation issue:

According to Segger's document RM08001-R7 Date: October 8, 2010,
http://www.segger.com/admin/uploads/productDocs/RM08001_JLinkUSBProtocol.pdf
section 5.5.3 EMU_CMD_SELECT_IF

 SubCmd 1..31 to select interface (0..31)

The table below states:
  0 TIF_JTAG
  1 TIF_SWD

This obviously means that to select TIF_JTAG one should write SubCmd = 1.

In fact, JTAG interface operates when SubCmd=0

It looks like a typo in documentation, because interfaces 0..31 could not
be selected by 1..31 range command.




2012/5/24 Liviu Ionescu i...@livius.net:

 On May 24, 2012, at 19:50 , Liviu Ionescu wrote:

 I will inform Segger about this new finding.

 here is the reply from Segger:

 From: SEGGER - Support J-Link (AG) support_jl...@segger.com
 Subject: Re: Possible J-Link firmware bug starting with V4.44?
 Date: May 24, 2012 20:04:29 GMT+03:00
 To: Liviu Ionescu i...@livius.net
 Reply-To: support_jl...@segger.com

 Hi Liviu,

 Alright, we were not aware of that OpenOCD does not select the interface 
 before it starts communicating with the target.
 A debugger should always select the appropriate target interface before it 
 starts communicating with the target,
 since otherwise it could also happen that a previous session with another 
 debugger had selected SWD and the interface was not switched again by 
 OpenOCD.


 Best regards
 Alex



--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-25 Thread Liviu Ionescu

On May 25, 2012, at 13:15 , Vaclav Peroutka wrote:

 ... And my question was, if there were any plans to extend this support.

if you are not telling to anyone, and without commiting yet to the task, I 
confess that I planned to spend some time to estimate the work needed to add 
swd support to the jlink driver.

unfortunately I don't think this will be possible before 1-2 weeks.

my goal is to add support for swo tracing, similar to the one implemented in 
the Segger GDB Server (a separate socket to telnet into, where the stream of 
tracing bytes is echoed), and to integrate it in the second edition of my other 
project, the GNU ARM Eclipse Plug-in.

 Or JLink SWD commands are not publicly available from Segger ?

the article 1.2 of the Segger manual dedicated to the USB protocol states:

The purpose of this document is to allow developers of open source software 
such as OpenOCD to write software which uses J-Link as debug interface.

so, even if the manual is incomplete, I think that Segger will not refuse us 
any further information related to the protocol. current experience with them 
was good, they replied in the same day, and I have nothing to complain about.

I have no problem to act in close liason with Segger, if needed.

regards,

Liviu


--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-25 Thread Liviu Ionescu

On May 25, 2012, at 13:31 , Xiaofan Chen wrote:

 The whole J-Link documentation (include JTAG)  is not complete
 from Segger's documentation,

as said before, even if the documentation is not complete, I don't think they 
deliberately hide anything from us, so let's be optimistic.

 that is not a problem though as
 reverse-engineering can be done.

sure, I used quite successfuly a USB tracer on Windows to be sure they did not 
change the protocol recently, and I also have a nice logic analyser in case we 
need to go down to the hardware level, so I think that we can do it.

but I think this is a different subject, and need to be discussed in a separate 
thread. 

regards,

Liviu


--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-25 Thread Spencer Oliver
On 25 May 2012 16:28, Spencer Oliver s...@spen-soft.co.uk wrote:

 For info just tested my v8 jlink with commit
 88b5c6da2a2a59fcb1eb3da22ed5339b8e0f35cd and it is working fine, so
 looks like a git bisect session :-)


sorry wrong version jlink plugged in - does not work with v8.

Spen

--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-24 Thread Alexander Osipenko
I've done similar comparison on my dongles.
There is no obvious problems like timeouts and buffer overruns (at
least under Linux).
First differences, as already mentioned, in version string and
interface voltage.
My testboard currently have 2 cores, so scan length 6 instead of 5.

After that TRST/SRTS reset goes equal (although, nothing was readback)

Debug: 476 287 transport.c:240 handle_transport_init(): handle_transport_init
Debug: 477 287 jlink.c:307 jlink_execute_reset(): reset trst: 0 srst 0
Debug: 478 287 jlink.c:571 jlink_reset(): trst: 0, srst: 0
Debug: 479 287 jlink.c:591 jlink_simple_command(): 0xdd
Debug: 480 288 jlink.c:1534 jlink_usb_write(): jlink_usb_write,
out_length = 1, result = 1
Debug: 481 288 jlink.c:1581 jlink_debug_buffer():  dd
Debug: 482 288 jlink.c:591 jlink_simple_command(): 0xdf
Debug: 483 289 jlink.c:1534 jlink_usb_write(): jlink_usb_write,
out_length = 1, result = 1
Debug: 484 289 jlink.c:1581 jlink_debug_buffer():  df
Debug: 485 289 core.c:719 jtag_add_reset(): SRST line released
Debug: 486 289 core.c:743 jtag_add_reset(): TRST line released
Debug: 487 289 core.c:323 jtag_call_event_callbacks(): jtag event: TAP reset


Debug: 494 1496 core.c:1412 jtag_init_inner(): Init JTAG chain
Debug: 495 1496 core.c:323 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 496 1496 jlink.c:269 jlink_execute_statemove(): statemove end in 15
Debug: 497 1496 jlink.c:490 jlink_state_move(): tap_set_state(RESET)
Debug: 498 1496 interface.c:406 jtag_debug_state_machine(): TAP/SM:
START state: RESET
Debug: 499 1496 interface.c:412 jtag_debug_state_machine(): TAP/SM:
TMS bits: 7 (bytes: 1)
Debug: 500 1496 interface.c:454 jtag_debug_state_machine(): TAP/SM:
 RESET - RESET TMS: 111TDI: 000
Debug: 501 1496 interface.c:457 jtag_debug_state_machine(): TAP/SM:
FINAL state: RESET
Debug: 502 1498 jlink.c:1534 jlink_usb_write(): jlink_usb_write,
out_length = 6, result = 6
Debug: 503 1498 jlink.c:1581 jlink_debug_buffer():  cf 00 07 00 7f 00
Debug: 504 1499 jlink.c:1546 jlink_usb_read(): jlink_usb_read, result = 1
Debug: 505 1499 jlink.c:1581 jlink_debug_buffer():  00
Debug: 506 1500 jlink.c:1559 jlink_usb_read_emu_result():
jlink_usb_read_result, result = 1
Debug: 507 1500 jlink.c:1581 jlink_debug_buffer():  00

Everything goes equal, however readback value is 0

Debug: 508 1500 core.c:1048 jtag_examine_chain(): DR scan
interrogation for IDCODE/BYPASS
Debug: 509 1500 core.c:323 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 510 1500 jlink.c:291 jlink_execute_scan(): scan end in DRPAUSE
Debug: 511 1500 commands.c:184 jtag_build_buffer(): DRSCAN num_fields: 1
Debug: 512 1500 commands.c:195 jtag_build_buffer():
fields[0].out_value[640]: 0x00FF00FF
Debug: 513 1500 jlink.c:296 jlink_execute_scan(): scan input, length = 640
Debug: 514 1500 jlink.c:1581 jlink_debug_buffer():  ff 00 00 00 ff
00 00 00 ff 00 00 00 ff 00 00 00
Debug: 515 1500 jlink.c:1581 jlink_debug_buffer(): 0010 ff 00 00 00 ff
00 00 00 ff 00 00 00 ff 00 00 00
Debug: 516 1500 jlink.c:1581 jlink_debug_buffer(): 0020 ff 00 00 00 ff
00 00 00 ff 00 00 00 ff 00 00 00
Debug: 517 1500 jlink.c:1581 jlink_debug_buffer(): 0030 ff 00 00 00 ff
00 00 00 ff 00 00 00 ff 00 00 00
Debug: 518 1500 jlink.c:1581 jlink_debug_buffer(): 0040 ff 00 00 00 ff
00 00 00 ff 00 00 00 ff 00 00 00
Debug: 519 1500 jlink.c:490 jlink_state_move(): tap_set_state(DRSHIFT)
Debug: 520 1500 jlink.c:563 jlink_scan(): tap_set_state(DRPAUSE)
Debug: 521 1500 jlink.c:269 jlink_execute_statemove(): statemove end in 15
Debug: 522 1500 jlink.c:490 jlink_state_move(): tap_set_state(RESET)
Debug: 523 1500 interface.c:406 jtag_debug_state_machine(): TAP/SM:
START state: RESET
Debug: 524 1500 interface.c:412 jtag_debug_state_machine(): TAP/SM:
TMS bits: 655 (bytes: 82)
(  goes equal TAP/SM )

Debug: 557 1501 jlink.c:1534 jlink_usb_write(): jlink_usb_write,
out_length = 168, result = 168
Debug: 558 1501 jlink.c:1581 jlink_debug_buffer():  cf 00 8f 02 17
00 00 00 00 00 00 00 00 00 00 00
Debug: 559 1501 jlink.c:1581 jlink_debug_buffer(): 0010 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00
Debug: 560 1501 jlink.c:1581 jlink_debug_buffer(): 0020 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00
Debug: 561 1501 jlink.c:1581 jlink_debug_buffer(): 0030 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00
Debug: 562 1501 jlink.c:1581 jlink_debug_buffer(): 0040 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00
Debug: 563 1501 jlink.c:1581 jlink_debug_buffer(): 0050 00 00 00 00 40
7f 80 7f 00 00 80 7f 00 00 80 7f
Debug: 564 1501 jlink.c:1581 jlink_debug_buffer(): 0060 00 00 80 7f 00
00 80 7f 00 00 80 7f 00 00 80 7f
Debug: 565 1501 jlink.c:1581 jlink_debug_buffer(): 0070 00 00 80 7f 00
00 80 7f 00 00 80 7f 00 00 80 7f
Debug: 566 1501 jlink.c:1581 jlink_debug_buffer(): 0080 00 00 80 7f 00
00 80 7f 00 00 80 7f 00 00 80 7f
Debug: 567 1501 jlink.c:1581 jlink_debug_buffer(): 0090 00 00 80 7f 00
00 80 7f 00 00 80 7f 00 00 80 7f
Debug: 568 1501 jlink.c:1581 

Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-24 Thread Alexander Osipenko
Thanks, Peter!

Alex.

2012/5/23 Peter Stuge pe...@stuge.se:
 Alexander Osipenko wrote:
 How can I export a patch from a set of local commits?

 git checkout -b myjlinkbranch origin/master
 git cherry-pick firstlocalcommit..lastlocalcommit
 git rebase -i origin/master # change pick to squash or fixup as neccessary
 git format-patch -1 # or push to gerrit: git push gerrit 
 myjlinkbranch:refs/for/master


 //Peter

 --
 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
 OpenOCD-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/openocd-devel

--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-24 Thread Liviu Ionescu

On May 24, 2012, at 11:47 , Alexander Osipenko wrote:

 I've done similar comparison on my dongles.

in case you need it, here is my test config:

(I use the repository version, with all debug messages enabled)
$ cd /Users/ilg//openocd

(plug the working version)
$ src/openocd -s tcl -f interface/jlink.cfg -f board/olimex_stm32_h103.cfg -c 
shutdown -d 3 /Users/ilg/.../J-Link/442-o.txt 21

(plug the unsupported version)
$ src/openocd -s tcl -f interface/jlink.cfg -f board/olimex_stm32_h103.cfg -c 
shutdown -d 3 /Users/ilg/.../J-Link/446-o.txt 21

$ cd /Users/ilg//J-Link

$ sh clean-openocd-logs.sh 442-o.txt  442-o-sed.txt
$ sh clean-openocd-logs.sh 446-o.txt  446-o-sed.txt

$ opendiff 442-o-sed.txt 446-o-sed.txt

where 'clean-openocd-logs.sh' is a short shell script:
cat $1 \
| sed -e '/^libusb:/d' \
| sed -e 's/^\([A-Z][A-Za-z ]*:\) [0-9][0-9]* [0-9][0-9]* \(.*\)$/\1 \2/'

and opendiff starts a graphical OS X diff application.

the test board is a small olimex_stm32_h103. 

 Error: 587 1608 core.c:941 jtag_examine_chain_check(): JTAG scan chain
 interrogation failed: all zeroes
 ...
 All zeroes returned, all time after the reset.

ok, so exactly the opposite, zeroes not ones.

however, in my case, the last byte is 7F, not FF.

 This could happen, if the TAP remains in the reset state.

probably this is what it happens, the TAP remains in a reset state, and the 
level is given by external resistors.

I already sent a report to Segger, I can provide them additional information 
based on your findings.

Liviu



--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-24 Thread Paul Fertser
Hi,

On Thu, May 24, 2012 at 07:24:31PM +0400, Alexander Osipenko wrote:
 I've added EMU_CMD_SELECT_IF command to the jlink_init().
 At least initial setup steps are passed now, my cores is detected normally.

Cool, congratulations!

 I have problem connecting to gerrit from behind firewall;
 using http[s]://openocd.zylin.com/p/openocd.git
 asks username/password, and not accepting ssh keys and http password
 from the zylin's control panel.

I tried pushing over http too and it sort of works but chances of
failure pushing due to a timeout are too high for this method to be
practically usable. I think that needs more testing/investigation.

 If sometimes I will happen to connect,
 - should such chained patches be uploaded as separate push operations,
   or as single push of a branch containing all of them ?
 - may I use a local branch, or must go to 'origin/master' before
 push?

The logic is this: when you push any branch to Gerrit, then all the
patches in this branch after the last one that's already in the main
repository are creating a separate entry in the patches list. And the
last one is set to depend on the previous one and the previous
depends on the previous and so on.

It doesn't matter how the branch that you're pushing is called in your
local repository.

And when you want to update a patch that's already pushed to Gerrit,
you shouldn't create a new commit, rather amend an existing one. If
that's your last local commit, then just make your changes and do git
commit --amend and _keep_ the Change-Id line in your commit
message. If you're working on a patch series, then i suggest to use
git rebase -i (and of course keep the Change-Id lines when
editing). Then simply push again, and Gerrit will automatically update
the existing patch entry (or entries).

HTH
-- 
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercer...@gmail.com

--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-24 Thread Liviu Ionescu

On May 24, 2012, at 18:24 , Alexander Osipenko wrote:

 At least one problem have been caught: latest FW does not select JTAG
 transport by default.

congratulations, Alexander!

 I've added EMU_CMD_SELECT_IF command to the jlink_init().
 At least initial setup steps are passed now, my cores is detected normally.

great, I confirm this, with the initialisation added I was able to program the 
flash, to run a debug session, with stepping, run, halt, etc.

I think the problem was fixed.

I will inform Segger about this new finding. they should fix their inits, but 
this is no longer urgent, OpenOCD will run even with existing firmware.

 The second patch is on top of previous, unsupported versions

I think the first patch should be updated, the code can be preserved, but the 
two entries should be removed, with the second patch those versions are no 
longer to be marked as unsupported.


I have two more observations:

- in the jlink_check_supported() function, the pointer definition triggers a 
warning, which turns into an error with the current build settings.

instead of:

const char **p = unsupported_versions;

I suggest:

const char * const *p = unsupported_versions;


- there is a small error in a comment:

instead of:

* Some versions of Segger's software does not select JTAG interface by 
default.

I suggest:

* Some versions of Segger's software do not select the JTAG interface 
by default.


regards,

Liviu


--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-24 Thread Liviu Ionescu

On May 24, 2012, at 19:50 , Liviu Ionescu wrote:

 I will inform Segger about this new finding.

here is the reply from Segger:

 From: SEGGER - Support J-Link (AG) support_jl...@segger.com
 Subject: Re: Possible J-Link firmware bug starting with V4.44?
 Date: May 24, 2012 20:04:29 GMT+03:00
 To: Liviu Ionescu i...@livius.net
 Reply-To: support_jl...@segger.com
 
 Hi Liviu,
 
 Alright, we were not aware of that OpenOCD does not select the interface 
 before it starts communicating with the target.
 A debugger should always select the appropriate target interface before it 
 starts communicating with the target,
 since otherwise it could also happen that a previous session with another 
 debugger had selected SWD and the interface was not switched again by OpenOCD.
 
 
 Best regards
 Alex



--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-23 Thread Alexander Osipenko
I'm unfamiliar with git,
the function body should be:

static void jlink_check_supported(const char *str)
{
const char **p = unsupported_versions;
while (*p) {
if (NULL != strstr(str, *p)) {
LOG_ERROR(Unsupported J-Link firmware version.);
return;
}
p++;
}
}

How can I export a patch from a set of local commits?

Regards,
Alex.

2012/5/23 Alexander Osipenko sip...@gmail.com:
 Just error message:

 Info : J-Link initialization started / target CPU reset initiated
 Info : J-Link ARM V8 compiled May  3 2012 18:36:22
 Error: Unsupported J-Link firmware version.
 Info : J-Link caps 0xb9ff7bbf
 Info : J-Link hw version 8


 2012/5/23 Liviu Ionescu i...@livius.net:

 On May 23, 2012, at 18:08 , Alexander Osipenko wrote:

 Patch attached.
 For now, I have added only the latest version,
 it's easy to add more.

 I don't have the full image, do you just issue the warning and proceed, or 
 you exit openocd?

 I was afraid to apply the patch, to be sure I still have an environment to 
 chase for the bug.

 Liviu


--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-23 Thread Alexander Osipenko
I have re-created (and re-verified) the patch.

Regards,
Alex.

diff --git a/src/jtag/drivers/jlink.c b/src/jtag/drivers/jlink.c
index 35c1a5c..c3efb05 100644
--- a/src/jtag/drivers/jlink.c
+++ b/src/jtag/drivers/jlink.c
@@ -738,6 +738,23 @@ static int jlink_set_config(struct jlink_config *cfg)
return ERROR_OK;
 }

+/* List of unsupported version string markers */
+static const char * const unsupported_versions[] = {
+May  3 2012, /* J-Link ARM V8 compiled May  3 2012 18:36:22 */
+0 };
+
+static void jlink_check_supported(const char *str)
+{
+   const char **p = unsupported_versions;
+   while (*p) {
+   if (NULL != strstr(str, *p)) {
+   LOG_ERROR(Unsupported J-Link firmware version.);
+   return;
+   }
+   p++;
+   }
+}
+
 static int jlink_get_version_info(void)
 {
int result;
@@ -767,6 +784,7 @@ static int jlink_get_version_info(void)

usb_in_buffer[result] = 0;
LOG_INFO(%s, (char *)usb_in_buffer);
+   jlink_check_supported((char *)usb_in_buffer);

/* query hardware capabilities */
jlink_simple_command(EMU_CMD_GET_CAPS);
-- 

2012/5/23 Alexander Osipenko sip...@gmail.com:
 Patch attached.
 For now, I have added only the latest version,
 it's easy to add more.

 Regards,
 Alex.

 diff --git a/src/jtag/drivers/jlink.c b/src/jtag/drivers/jlink.c
 index 35c1a5c..bacea7a 100644
 --- a/src/jtag/drivers/jlink.c
 +++ b/src/jtag/drivers/jlink.c
 @@ -738,6 +738,21 @@ static int jlink_set_config(struct jlink_config *cfg)
        return ERROR_OK;
  }

 +/* List of unsupported version string markers */
 +static const char * const unsupported_versions[] = {
 +May  3 2012, /* J-Link ARM V8 compiled May  3 2012 18:36:22 */
 +0 };
 +
 +static void jlink_check_supported(const char *str)
 +{
 +       const char **p = unsupported_versions;
 +       while (*p)
 +               if (NULL != strstr(str, *p)) {
 +                       LOG_ERROR(Unsupported J-Link firmware version.);
 +                       return;
 +               }
 +}
 +
  static int jlink_get_version_info(void)
  {
        int result;
 @@ -767,6 +782,7 @@ static int jlink_get_version_info(void)

        usb_in_buffer[result] = 0;
        LOG_INFO(%s, (char *)usb_in_buffer);
 +       jlink_check_supported((char *)usb_in_buffer);

        /* query hardware capabilities */
        jlink_simple_command(EMU_CMD_GET_CAPS);
 --


 2012/5/22 Antonio Borneo borneo.anto...@gmail.com:
 It would be nice to have OpenOCD reading the date of J-Link firmware
 and print error message for firmware version unsupported. Eventually
 with a suggestion to re-flash J-Link with the latest working firmware.

 In the past we already had a set of versions not working (I should dig
 in mail archive to find it), from a certain date till when Segger
 fixed the issue with a new firmware.
 I think that till now, OpenOCD does not support those versions.
 The check on firmware date should include this range too.

 Any volunteer willing to write such patch?

 Best Regards,
 Antonio

 --
 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
 OpenOCD-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/openocd-devel


0001-Unsupported-firmware-version-check.patch
Description: Binary data
--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-23 Thread Peter Stuge
Alexander Osipenko wrote:
 How can I export a patch from a set of local commits?

git checkout -b myjlinkbranch origin/master
git cherry-pick firstlocalcommit..lastlocalcommit
git rebase -i origin/master # change pick to squash or fixup as neccessary
git format-patch -1 # or push to gerrit: git push gerrit 
myjlinkbranch:refs/for/master


//Peter

--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-23 Thread Liviu Ionescu

another diff session, this time on the openocd logs, reveled a difference in 
the way two firmware versions respond to a certain EMU_CMD_HW_JTAG3 (0xCF) 
command issued by openocd:

Debug: 399 977 jlink.c:1516 jlink_usb_write(): jlink_usb_write, 
out_length = 168, result = 168
Debug: 400 977 jlink.c:1563 jlink_debug_buffer():  cf 00 8f 02 17 
00 00 00 00 00 00 00 00 00 00 00
Debug: 401 977 jlink.c:1563 jlink_debug_buffer(): 0010 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00
Debug: 402 977 jlink.c:1563 jlink_debug_buffer(): 0020 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00
Debug: 403 977 jlink.c:1563 jlink_debug_buffer(): 0030 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00
Debug: 404 977 jlink.c:1563 jlink_debug_buffer(): 0040 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00
Debug: 405 977 jlink.c:1563 jlink_debug_buffer(): 0050 00 00 00 00 40 
7f 80 7f 00 00 80 7f 00 00 80 7f
Debug: 406 977 jlink.c:1563 jlink_debug_buffer(): 0060 00 00 80 7f 00 
00 80 7f 00 00 80 7f 00 00 80 7f
Debug: 407 977 jlink.c:1563 jlink_debug_buffer(): 0070 00 00 80 7f 00 
00 80 7f 00 00 80 7f 00 00 80 7f
Debug: 408 977 jlink.c:1563 jlink_debug_buffer(): 0080 00 00 80 7f 00 
00 80 7f 00 00 80 7f 00 00 80 7f
Debug: 409 977 jlink.c:1563 jlink_debug_buffer(): 0090 00 00 80 7f 00 
00 80 7f 00 00 80 7f 00 00 80 7f
Debug: 410 977 jlink.c:1563 jlink_debug_buffer(): 00a0 00 00 80 7f 00 
00 00 00

with the 4.42 firmware, the result looks like this:

Debug: 411 978 jlink.c:1528 jlink_usb_read(): jlink_usb_read, result = 
82
Debug: 412 978 jlink.c:1563 jlink_debug_buffer():  ff 3b 02 d0 9d 
20 80 20 8b 7f 00 00 80 7f 00 00
Debug: 413 978 jlink.c:1563 jlink_debug_buffer(): 0010 80 7f 00 00 80 
7f 00 00 80 7f 00 00 80 7f 00 00
Debug: 414 978 jlink.c:1563 jlink_debug_buffer(): 0020 80 7f 00 00 80 
7f 00 00 80 7f 00 00 80 7f 00 00
Debug: 415 978 jlink.c:1563 jlink_debug_buffer(): 0030 80 7f 00 00 80 
7f 00 00 80 7f 00 00 80 7f 00 00
Debug: 416 978 jlink.c:1563 jlink_debug_buffer(): 0040 80 7f 00 00 80 
7f 00 00 80 7f 00 00 80 7f 00 00
Debug: 417 978 jlink.c:1563 jlink_debug_buffer(): 0050 80 7f

Debug: 418 978 jlink.c:1541 jlink_usb_read_emu_result(): 
jlink_usb_read_result, result = 1
Debug: 419 978 jlink.c:1563 jlink_debug_buffer():  00
Debug: 420 978 jlink.c:1323 jlink_tap_execute(): pending scan result, 
length = 640
Debug: 421 978 jlink.c:1563 jlink_debug_buffer():  77 04 a0 3b 41 
00 41 16 ff 00 00 00 ff 00 00 00
Debug: 422 978 jlink.c:1563 jlink_debug_buffer(): 0010 ff 00 00 00 ff 
00 00 00 ff 00 00 00 ff 00 00 00
Debug: 423 978 jlink.c:1563 jlink_debug_buffer(): 0020 ff 00 00 00 ff 
00 00 00 ff 00 00 00 ff 00 00 00
Debug: 424 978 jlink.c:1563 jlink_debug_buffer(): 0030 ff 00 00 00 ff 
00 00 00 ff 00 00 00 ff 00 00 00
Debug: 425 978 jlink.c:1563 jlink_debug_buffer(): 0040 ff 00 00 00 ff 
00 00 00 ff 00 00 00 ff 00 00 00
Debug: 426 978 commands.c:238 jtag_read_buffer(): 
fields[0].in_value[640]: 0x164100413BA00477
Info : 427 978 core.c:951 jtag_examine_chain_display(): JTAG tap: 
stm32f1x.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : 428 978 core.c:951 jtag_examine_chain_display(): JTAG tap: 
stm32f1x.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)
Debug: 429 978 core.c:1208 jtag_validate_ircapture(): IR capture 
validation scan

with the 4.46 firmware, the result is all 1:

Debug: 411 995 jlink.c:1528 jlink_usb_read(): jlink_usb_read, result = 
82
Debug: 412 995 jlink.c:1563 jlink_debug_buffer():  ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff
Debug: 413 995 jlink.c:1563 jlink_debug_buffer(): 0010 ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff
Debug: 414 995 jlink.c:1563 jlink_debug_buffer(): 0020 ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff
Debug: 415 995 jlink.c:1563 jlink_debug_buffer(): 0030 ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff
Debug: 416 995 jlink.c:1563 jlink_debug_buffer(): 0040 ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff
Debug: 417 995 jlink.c:1563 jlink_debug_buffer(): 0050 ff 7f

Debug: 418 996 jlink.c:1541 jlink_usb_read_emu_result(): 
jlink_usb_read_result, result = 1
Debug: 419 996 jlink.c:1563 jlink_debug_buffer():  00
Debug: 420 996 jlink.c:1323 jlink_tap_execute(): pending scan result, 
length = 640
Debug: 421 996 jlink.c:1563 jlink_debug_buffer():  ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff
Debug: 422 996 jlink.c:1563 jlink_debug_buffer(): 0010 ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff
Debug: 423 996 jlink.c:1563 jlink_debug_buffer(): 0020 ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff
Debug: 424 996 jlink.c:1563 jlink_debug_buffer(): 0030 

Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-23 Thread Xiaofan Chen
On Thu, May 24, 2012 at 4:01 AM, Liviu Ionescu i...@livius.net wrote:

 another diff session, this time on the openocd logs, reveled a
 difference in the way two firmware versions respond to a
 certain EMU_CMD_HW_JTAG3 (0xCF) command issued by openocd:
 ...
 my first thought is a bug in the new firmware, that in this configuration 
 fails.

 Q1: any idea where does this long JTAG sequence come from?
 can we shorten it? (since other long transactions seem to work,
 only this particular one fails).

I am not so familiar with the OpenOCD internals. I contribute mainly
by testing. Hopefully others can give you the answer.


 Q2: can you imagine an erroneous condition in our code
 (the usb stack?) that could lead to such a situation?

I am thinking that OpenOCD codes may be able to be fixed
by following what Segger tool does. So you may want to
compare the sequences of what Segger tool does and what
OpenOCD does.

 if not, I will report this to Segger.

I think that is a good idea anyway.



-- 
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-23 Thread Liviu Ionescu

On May 23, 2012, at 18:08 , Alexander Osipenko wrote:

 Patch attached.
 For now, I have added only the latest version,
 it's easy to add more.

according to my tests, the first FW version no longer working is 4.44:

Info : J-Link ARM V8 compiled Mar 19 2012 10:24:49

I guess all other versions from 4.44 to the latest 4.46 behave the same.

so all versions from 'Mar 19 2012' to 'May 3 2012' must be marked as 
unsupported.

perhaps, instead of maintaining a list of dates you could maintain a list of 
ranges (obviously this requires to parse the dates and compare numerical 
values, which is a little bit more complicated than a strstr()).

regards,

Liviu


--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-23 Thread Liviu Ionescu

On May 24, 2012, at 01:58 , Xiaofan Chen wrote:

 I am thinking that OpenOCD codes may be able to be fixed
 by following what Segger tool does. So you may want to
 compare the sequences of what Segger tool does and what
 OpenOCD does.

I did, but they are quite different. however we have a big advantage, while in 
the Segger software the configurations are fixed, in OpenOCD (almost) 
everything is configurable, so we don't need to recompile to accomodate some 
changes.

 if not, I will report this to Segger.
 
 I think that is a good idea anyway.

ok, I did this, I'll keep you posted on the progress.

regards,

Liviu


--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-22 Thread Xiaofan Chen
On Tue, May 22, 2012 at 1:25 PM, Liviu Ionescu i...@livius.net wrote:
 I'd be happy if Segger would just disclose the changes in
  the USB protocol, so we don't have to reverse engineer it.

I do not think that will happen...

 do we have any contacts at Segger?

 I would first write to Segger and try to get an official statement from them.

You can try, there is an email address in the thread.
http://lists.berlios.de/pipermail/openocd-development/2011-August/020741.html
support_jlink at segger.com

 Last time Segger did spend time to fix the issue and when I tried it,
 4.33h beta firmware solved the problem

 there are no 4.33[a-z] at all on the Segger site
 (http://www.segger.com/j-link-older-versions.html), from 4.32b they jump to 
 4.34.

Then you can try 4.34 release to see if that helps.

 I currently have two J-Link V8 probes, one running the latest v6.46f and the
 other running the old 4.14g, so it is relatively simple to run comparison 
 tests.

 any other comments on how to proceed?

1) Try 4.34 release and later versions to establish which version works
and which FW version does not work with OpenOCD.

http://lists.berlios.de/pipermail/openocd-development/2011-August/020651.html
We knew that 4.10i and below seem to work, 4.20 to 4.30 does not work.

2) Reverse engineering, compare the Segger tools and OpenOCD

3) Come out with the fix if it is possible.

-- 
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-22 Thread Xiaofan Chen
On Tue, May 22, 2012 at 1:25 PM, Liviu Ionescu i...@livius.net wrote:

 anyway, I don't think we should expect Segger to update their
 firmware to work with OpenOCD, we should update OpenOCD to
 make it work with all Segger firware versions.

You can always try to get Segger to help if their firmware updates
solved the problem.

On the other hand, this was my take on the issue and my view does not change.

+
http://lists.berlios.de/pipermail/openocd-development/2011-August/020695.html

To be fair to Segger, I think they do not intentionally change anything in
the firmware. After all, the firmware needs to be compatible with their own
utility under Windows and Linux. On the other hand, they probably did
not test OpenOCD since that was not their focus.

From the usbmon log, Segger's Linux utility are consistent through
different versions of J-Link. The main issue is that OpenOCD's J-Link
initialization sequence is not the same as Segger's utility, as shown
in Eric's previous email. I think Gary is probably correct that
whatever is wrong (in OpenOCD) is probably minor.
++

We just need to iron out the minor issues in OpenOCD to solve
the problem.

-- 
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-22 Thread Alexander Osipenko
It would be nice to print a warning message about unsupported firmware.

2012/5/22 Xiaofan Chen xiaof...@gmail.com:
 On Tue, May 22, 2012 at 1:25 PM, Liviu Ionescu i...@livius.net wrote:

 anyway, I don't think we should expect Segger to update their
 firmware to work with OpenOCD, we should update OpenOCD to
 make it work with all Segger firware versions.

 You can always try to get Segger to help if their firmware updates
 solved the problem.

 On the other hand, this was my take on the issue and my view does not change.

 +
 http://lists.berlios.de/pipermail/openocd-development/2011-August/020695.html

 To be fair to Segger, I think they do not intentionally change anything in
 the firmware. After all, the firmware needs to be compatible with their own
 utility under Windows and Linux. On the other hand, they probably did
 not test OpenOCD since that was not their focus.

 From the usbmon log, Segger's Linux utility are consistent through
 different versions of J-Link. The main issue is that OpenOCD's J-Link
 initialization sequence is not the same as Segger's utility, as shown
 in Eric's previous email. I think Gary is probably correct that
 whatever is wrong (in OpenOCD) is probably minor.
 ++

 We just need to iron out the minor issues in OpenOCD to solve
 the problem.

 --
 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
 OpenOCD-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/openocd-devel

--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-22 Thread Antonio Borneo
It would be nice to have OpenOCD reading the date of J-Link firmware
and print error message for firmware version unsupported. Eventually
with a suggestion to re-flash J-Link with the latest working firmware.

In the past we already had a set of versions not working (I should dig
in mail archive to find it), from a certain date till when Segger
fixed the issue with a new firmware.
I think that till now, OpenOCD does not support those versions.
The check on firmware date should include this range too.

Any volunteer willing to write such patch?

Best Regards,
Antonio

--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-22 Thread Liviu Ionescu

On May 22, 2012, at 12:51 , Peter Stuge wrote:

 It depends on what your goal is. If your goal is to make OpenOCD
 support the newest J-Link firmware,

sorry, I don't want to enter in open source versus proprietary solutions 
discussions. 

for various reasons I preffer the J-Link probe, and for my users that require 
commercial solutions, the Segger GDB Server seems fine on Windows and Linux.

for users who preffer open source solutions (myself included), OpenOCD is the 
obvious solution.

so, yes, from this perspective, my goal is to update OpenOCD to support the 
newest J-Link firmware.

 Go for it! The patches will of course be very welcome,

ok, thank you.

Liviu


--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-22 Thread Liviu Ionescu

On May 22, 2012, at 11:14 , Xiaofan Chen wrote:

 On Tue, May 22, 2012 at 1:25 PM, Liviu Ionescu i...@livius.net wrote:
 I'd be happy if Segger would just disclose the changes in
 the USB protocol, so we don't have to reverse engineer it.
 
 I do not think that will happen...

I'm a bit puzzled, Peter also mentioned that the J-Link driver in OpenOCD 
[was] built by reverse-engineering a proprietary product.

however, the J-Link USB protocol is described quite in detail in the publicly 
available document:

http://www.segger.com/admin/uploads/productDocs/RM08001_JLinkUSBProtocol.pdf

am I missing something here?

 support_jlink at segger.com

ok

On May 22, 2012, at 11:19 , Xiaofan Chen wrote:

 ...

 To be fair to Segger, I think they do not intentionally change anything in
 the firmware. ...
 From the usbmon log, Segger's Linux utility are consistent through
 different versions of J-Link. The main issue is that OpenOCD's J-Link
 initialization sequence is not the same as Segger's utility, as shown
 in Eric's previous email. I think Gary is probably correct that
 whatever is wrong (in OpenOCD) is probably minor.

that is really helpful.

in this case I'll first try to look in the code and check if it conforms with 
the specs in the Segger manual.


regards,

Liviu


--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-22 Thread Xiaofan Chen
On Tue, May 22, 2012 at 7:11 PM, Liviu Ionescu i...@livius.net wrote:
 On May 22, 2012, at 11:14 , Xiaofan Chen wrote:
 On Tue, May 22, 2012 at 1:25 PM, Liviu Ionescu i...@livius.net wrote:
 I'd be happy if Segger would just disclose the changes in
 the USB protocol, so we don't have to reverse engineer it.

 I do not think that will happen...

 I'm a bit puzzled, Peter also mentioned that the J-Link
 driver in OpenOCD [was] built by reverse-engineering
 a proprietary product.

 however, the J-Link USB protocol is described quite in detail in the
 publicly available document:

 http://www.segger.com/admin/uploads/productDocs/RM08001_JLinkUSBProtocol.pdf

 am I missing something here?

That document of course help, but it is not complete at all, many
commands are undocumented.


-- 
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-22 Thread Liviu Ionescu

On May 22, 2012, at 11:14 , Xiaofan Chen wrote:

 1) Try 4.34 release and later versions to establish which version works
 and which FW version does not work with OpenOCD.

as already reported, 4.42c works, 4.44 doesn't, and probably none up to 4.46f

 2) Reverse engineering, compare the Segger tools and OpenOCD

I would run a usbmon log comparison between 4.42c and 4.46f, for the latest 
Segger software, to check if there are any changes in the protocol.

I don't expect major changes, but if there are, then at least I'll have an well 
documented reason to contact Segger.

if not, I'll check the OpenOCD sources, and compare the actual protocol with 
the one specified in the manual.

any other ideas are welcome!


Liviu


--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-22 Thread Liviu Ionescu

On May 22, 2012, at 14:26 , Xiaofan Chen wrote:

 http://www.segger.com/admin/uploads/productDocs/RM08001_JLinkUSBProtocol.pdf
 
 am I missing something here?
 
 That document of course help, but it is not complete at all, many
 commands are undocumented.

unfortunately :-(

I did a usb sniff compare between version 4.42c and 4.46f, using exactly the 
same device; the program sniffed was JLink.exe.

as expected, there are several commands not documented in the Segger specs, 
some with differences between the two versions.

further investigations to come.


Liviu





--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-21 Thread Peter Stuge
Liviu Ionescu wrote:
 Any comments?

Buy a known good dongle. The Versaloon is 30 USD plus shipping, any
number of cheap FTDI based dongles can also be used, in particular
thanks to Andreas' work on the new ftdi driver.


//Peter

--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-21 Thread Xiaofan Chen
On Tue, May 22, 2012 at 4:43 AM, Liviu Ionescu i...@livius.net wrote:
 I recently purchased a J-Link probe, and, to my surprise, after
 upgrading to the latest SEGGER firmware, it does not work with
 0.5.0 (nor with the latest repository version).

 Although it was manufactured in 2012, the probe originally
 came with 2 years old firmware:

 Info : J-Link ARM V8 compiled May 20 2010 17:07:46
 Info : J-Link caps 0xb9ff7bbf
 Info : J-Link hw version 8
 Info : J-Link hw type J-Link

 OpenOCD had no problems with this version.

 It took me a while to test many previous versions. The latest
 I could make it work again was the FW version from December 1st,
 2009, included in the J-Link packages from v1.10i to v4.14g.
 (v4.14h no longer works).

Hmm, I believe the issue has been solved by updating to the latest
Segger firmware. What is the version you are updating to?

Last time Segger did spend time to fix the issue and when I tried it,
4.33h beta firmware solved the problem and the latest release version
is newer than that.
http://lists.berlios.de/pipermail/openocd-development/2011-August/020741.html

I have not tried J-Link for a while, I will try it later.

-- 
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-21 Thread Xiaofan Chen
On Tue, May 22, 2012 at 5:12 AM, Peter Stuge pe...@stuge.se wrote:
 Liviu Ionescu wrote:
 Any comments?

 Buy a known good dongle. The Versaloon is 30 USD plus shipping, any
 number of cheap FTDI based dongles can also be used, in particular
 thanks to Andreas' work on the new ftdi driver.

That is one option but the OP has already a Segger J-Link so I am not
so sure the above is a good suggestion or not...

Segger J-Link is one of the best supported JTAG tool for ARM MCU/MPU
development (supported by major toolchain like IAR, Keil, etc)
and we use it extensively here at work (together with IAR
toolchain, for ARM7, ARM9, Cortex M3, etc).


-- 
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-21 Thread Liviu Ionescu

On May 22, 2012, at 04:14 , Xiaofan Chen wrote:

 On Tue, May 22, 2012 at 5:12 AM, Peter Stuge pe...@stuge.se wrote:
 Liviu Ionescu wrote:
 Any comments?
 
 Buy a known good dongle.

sorry, but this does not help much.

 Segger J-Link is one of the best supported JTAG tool for ARM MCU/MPU

fully agree.

I already have several probes and still prefer the J-Link.

anyone else interested in making it work with OpenOCD?

other suggestions?


Liviu


--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] J-Link v8 with FW newer than May 20, 2010?

2012-05-21 Thread Liviu Ionescu

On May 22, 2012, at 04:11 , Xiaofan Chen wrote:

 Hmm, I believe the issue has been solved by updating to the latest
 Segger firmware. What is the version you are updating to?

the latest, May 3, 2012, packed within Setup_JLinkARM_V446f.zip

Info : J-Link initialization started / target CPU reset initiated
Info : J-Link ARM V8 compiled May  3 2012 18:36:22
Info : J-Link caps 0xb9ff7bbf
Info : J-Link hw version 8
Info : J-Link hw type J-Link
Info : J-Link max mem block 9336
Info : J-Link configuration
Info : USB-Address: 0x0
Info : Kickstart power on JTAG-pin 19: 0x
Info : Vref = 3.274 TCK = 1 TDI = 1 TDO = 1 TMS = 1 SRST = 0 TRST = 1
Info : J-Link JTAG Interface ready
Info : clock speed 1000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: stm32.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

there is also a V446g beta, but I did not try it.

anyway, I don't think we should expect Segger to update their firmware to work 
with OpenOCD, we should update OpenOCD to make it work with all Segger firware 
versions.

I'd be happy if Segger would just disclose the changes in the USB protocol, so 
we don't have to reverse engineer it.

do we have any contacts at Segger?

I would first write to Segger and try to get an official statement from them.

 Last time Segger did spend time to fix the issue and when I tried it,
 4.33h beta firmware solved the problem

there are no 4.33[a-z] at all on the Segger site 
(http://www.segger.com/j-link-older-versions.html), from 4.32b they jump to 
4.34.

I currently have two J-Link V8 probes, one running the latest v6.46f and the 
other running the old 4.14g, so it is relatively simple to run comparison tests.

any other comments on how to proceed?

regards,

Liviu





--
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
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel