Karl Palsson [Tue, 15 Nov 2011 19:56:14 +0000 (19:56 +0000)]
Fix merge problem with flash verify for F4
The F4 code had #ifdefd out the verification, as the page/sector size can be
too large to read in via a single transfer. Pull the verification out to a
separate function, the flash write was getting far too large anyway.
Karl Palsson [Tue, 15 Nov 2011 00:57:09 +0000 (00:57 +0000)]
Merge branch 'tmaster' into future
This branch should work for F1 and F4 devices. It has currently been tested
with F1 value line, (a VL discovery board) programmed via gdb via both an
stlinkv1 and an stlinkv2.
Karl Palsson [Mon, 14 Nov 2011 03:52:19 +0000 (03:52 +0000)]
Start up stlinkv1 faster.
Now that we're not using sg, and we've told the kernel to ignore the device in
usb-mass storage, we don't need to close and wait 5 seconds. We can just
immediately issue the command to switch modes.
Karl Palsson [Mon, 7 Nov 2011 22:00:13 +0000 (22:00 +0000)]
Restructure libs source to support multi platform
The "libstm32l_discovery" was actually the ST std periph library, plus the
CMSIS core files. Renamed it as such, and restructured the directories and
naming to make this easier to contain the std periph drivers for more than
just one board.
Verified with the LCD demo makefile, and loading it in sram again.
Karl Palsson [Mon, 14 Nov 2011 02:25:31 +0000 (02:25 +0000)]
Don't try reading device params in bad USB modes.
You cannot read device params when we're not in debug mode and trying to will fill the USB buffer with garbage, and you will have to
unplug and replug and start again. (which will fail, because, you're in the
wrong mode... :)
Karl Palsson [Mon, 14 Nov 2011 01:25:56 +0000 (01:25 +0000)]
Fix flash writing for VL cores.
The change from run->step breaks the VL cores. Need to double check that this
still works for L cores. The whole flash writing needs to be better
abstracted.
Karl Palsson [Sat, 12 Nov 2011 20:36:43 +0000 (20:36 +0000)]
Move all the flash size mapping from gdb server into core.
All the device params like flash size and page size should all be in the core open routines, not
_only_ in the gdbserver. (This should stop it from ending up duplicated in the core, and get rid of
some of the hacks that were turning up. All of this is chip specific!)
Karl Palsson [Thu, 3 Nov 2011 23:40:27 +0000 (23:40 +0000)]
Remove device names, we now just find it via USB ids.
In the future, we might actually want device names back again, if you have multiple stlink's
connected. But that would be a new device name, not scanning for /dev/sgX looking for scsi
devices.
Karl Palsson [Thu, 3 Nov 2011 21:28:19 +0000 (21:28 +0000)]
Use the libusb based sense and status reading from afaerber
Before, I could a single operation (get version) after plugging in, now I can issue two at least
:) I suspect there are two problems still. 1, I'm not using tags properly, as the original
sg-utils code seemed to skip that. 2) I'm pretty sure I need to be sending variable lengths for
the cdb field.
Karl Palsson [Thu, 3 Nov 2011 03:45:23 +0000 (03:45 +0000)]
Read stlink version info via libusb.
Hooray! Stage 1 complete. The stlink version can now be read by sending the scsi
commands via libusb directly, instead of using sg-utils. It's very very prototype code
however, but should come together from here.
Major bugs: Only works when the device has been first plugged in. I'm clearly not
resetting some usb state somewhere.
Now that libusb is being used directly, you can use linux usb-storage quirks to
completely IGNORE the device as mass storage. We'll just grab it via libusb when we
want it.
Karl Palsson [Thu, 3 Nov 2011 00:35:19 +0000 (00:35 +0000)]
Remove sg-utils test output
More bulk cleanup on the path to removing sg-utils dependencies. Trying to make
test-sg as simple as possible so I can use it reliably to test on both master and my
killsg branch