Re: [Openocd-development] ST-Link with OpenOCD?

2010-08-24 Thread Andrew Rogers
On Mon, 2010-08-23 at 22:38 +0100, Spencer Oliver wrote:
 On 23/08/2010 22:21, Peter Stuge wrote:
  Spencer Oliver wrote:
  ST sent me the api, it is based on mass storage device.
  They are happy for openocd to support it.
 
  Any chance of a copy of the API?
 
  The actual api was sent under nda, so i cannot send it on. It
  contains a lot more info about the interface (eg. dfu) that they do
  not want published.
 
  Then I would personally ignore them and focus on doing business with
  companies with a more sane attitude to their documentation.
 
 
 They just do not want some parts of the stlink to be known.
 It is not a problem to publish info on the jtag/swd access layer, just 
 happens to be all in one document.
 
 
  The stlink does have dfu capability, it is documented in the info i
  was sent.
 
  If it is actually standards compliant DFU (that is a USB class spec)
  then maybe you can use the dfu-updater software to reprogram the
  firmware.
 
 
 It is dfu wrapped in a mass storage cmd block.
 If you just need to reprogram then any tool can do that, although you 
 will loose the stlink bootloader.
 
If I understand mass storage class correctly SCSI commands are wrapped
in mass storage cmd blocks (called CBW in
http://www.usb.org/developers/devclass_docs/usbmassbulk_10.pdf ). The
first byte of the SCSI command is the opcode. Does ST-Link use vendor
specific opcodes?

Using lsusb -v tells me it's interface sub-class is SCSI. It doesn't
have a partition table, but does has a FAT16 filesystem. I can mount it
and see three files on it. 

If my guess about vendor-specific SCSI opcodes is right then I might get
somewhere but generating opcodes from 0xc0 to 0xff, defined in SCSI as
vendor-specific. http://www.t10.org/lists/op-num.htm

Problem is that if I do succeed in writing flash then I would probably
brick the ST-Link. It is likely there is some sequence of commands to
enable flash write that would be difficult to stumble up on. However, I
do expect to be able to read RAM easily enough, assuming there is a
command to do this. See which opcodes return data. 

Regards
Andrew


___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] ST-Link with OpenOCD?

2010-08-23 Thread Andrew Rogers
On Tue, 2010-03-23 at 14:01 +, Spencer Oliver wrote:
 On 23/03/2010 10:12, simon qian wrote:
  ST doesn't open the protocol of ST-Link, so it's impossible to support
  it in OpenOCD.
  I have 2 ST-Link sent by vendor of ST, but now, they are Versaloon.
 

 ST sent me the api, it is based on mass storage device.
 They are happy for openocd to support it.
 
I think the firmware of the ST-link can be updated as there is update
software available. I reckon that there will be hooks to allow writing
to the RAM on the STM32F103C8T6. We could execute firmware from RAM to
perform low-level JTAG.

Any chance of a copy of the API?

 The current issue is that it is high level access only, eg.
 Step Core, Read registers etc. So some changes are required to support 
 this kind of dongle.
 
 Cheers
 Spen
 ___
 Openocd-development mailing list
 Openocd-development@lists.berlios.de
 https://lists.berlios.de/mailman/listinfo/openocd-development


___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] ST-Link with OpenOCD?

2010-08-23 Thread Spencer Oliver

On 23/08/2010 22:21, Peter Stuge wrote:

Spencer Oliver wrote:

ST sent me the api, it is based on mass storage device.
They are happy for openocd to support it.



Any chance of a copy of the API?


The actual api was sent under nda, so i cannot send it on. It
contains a lot more info about the interface (eg. dfu) that they do
not want published.


Then I would personally ignore them and focus on doing business with
companies with a more sane attitude to their documentation.



They just do not want some parts of the stlink to be known.
It is not a problem to publish info on the jtag/swd access layer, just 
happens to be all in one document.





The stlink does have dfu capability, it is documented in the info i
was sent.


If it is actually standards compliant DFU (that is a USB class spec)
then maybe you can use the dfu-updater software to reprogram the
firmware.



It is dfu wrapped in a mass storage cmd block.
If you just need to reprogram then any tool can do that, although you 
will loose the stlink bootloader.



Of course that doesn't help for debugging.



The problem is that the stlink does not have any low level jtag/swd
access,


What do you want to use openocd for with this device then?



Because it is very low cost (£15) and supports stm32.
It is supported by higher level cmds, eg. stop, reset, resume etc. This 
is why i said to openocd it behaves more like a target.


Cheers
Spen
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


[Openocd-development] ST-Link with OpenOCD?

2010-03-23 Thread Sammy Omari
Hi,
As far as I know, the ST-Link dongle is not yet supported by OpenOCD.
According to STs homepage (
http://www.st.com/mcu/contentid-126-110-ST_LINK.html) only the Attolic
toolset, the TrueSTUDIO, the IAR toolset EWARM and the Keil toolset
officially support the dongle. Unfortunately, these are all closed-source
toolchains with certain restrictions when it comes to debugging etc...

Has anybody got the dongle working in an opensource toolchain? Preferably
with OpenOCD?

best,
Sammy Omari
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] ST-Link with OpenOCD?

2010-03-23 Thread Austin, Alex
At that level, it may make sense to build a separate GDB server.
The GDB remote protocol is not very difficult, and I've done it
in HL languages. Contact me off-list if you'd like help doing so.

- Alex

 -Original Message-
 From: openocd-development-boun...@lists.berlios.de [mailto:openocd-
 development-boun...@lists.berlios.de] On Behalf Of Spencer Oliver
 Sent: Tuesday, March 23, 2010 9:02 AM
 To: simon qian
 Cc: openocd-development@lists.berlios.de
 Subject: Re: [Openocd-development] ST-Link with OpenOCD?
 
 On 23/03/2010 10:12, simon qian wrote:
  ST doesn't open the protocol of ST-Link, so it's impossible to
 support
  it in OpenOCD.
  I have 2 ST-Link sent by vendor of ST, but now, they are Versaloon.
 
 
 ST sent me the api, it is based on mass storage device.
 They are happy for openocd to support it.
 
 The current issue is that it is high level access only, eg.
 Step Core, Read registers etc. So some changes are required to support
 this kind of dongle.
 
 Cheers
 Spen
 ___
 Openocd-development mailing list
 Openocd-development@lists.berlios.de
 https://lists.berlios.de/mailman/listinfo/openocd-development
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development