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