-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eliminate SCSI pass through, fix F1 targets again, valgrind all the goodies #29
Conversation
Signed-off-by: Karl Palsson <[email protected]>
Signed-off-by: Karl Palsson <[email protected]>
Signed-off-by: Karl Palsson <[email protected]>
Signed-off-by: Karl Palsson <[email protected]>
Conflicts: src/stlink-usb.c
Supports setting the gdb listen port Supports setting which version of stlink to use Supports setting the device to use (in case autoprobing doesn't work)
Less mucking around with make parameters, it's a tiny build. Verified with a VL and L board. Removed the old obsolete bin file
No idea why this was added, but it's not necessary for anything I've found.
We're starting on integration from github.com/afaerber So, instead of scanning all the usb devices, just open what we want.
Also flag out some places where code appears unused.
I needed some sanity...
%Ld works for size_t only on 64 bit, the correct conversion is %zd
Better support for F4, or anything else that appears as an stlinkv2
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
Remove duplication of stlink version decoding, and put the decoded version information into the stlink object itself.
Conflicts: src/stlink-common.c src/test_sg.c Conflicts were only in changes to logging.
Very very raw, this just finds the device and opens the usb handle.
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.
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.
These libraries IGNORE assert_param. Maybe later.
It compiles, but I've got bugs preventing me from running this yet :(
And update some of the logging to be a bit tidier
in the top level, make clean cleans all stlink code. in an application level, it only cleans that application
Lots of the debug code is far too verbose for anything but usb tracing. Likewise, remove all the old scsi code that was simply ifdefd out.
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.
And remove dead/duplicate code that is included in the opening of the device
Thanks valgrind
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. F4 has _not_ yet been tested on this branch Conflicts: .gitignore doc/tutorial/tutorial.pdf example/blink/main.c gdbserver/Makefile gdbserver/gdb-server.c src/stlink-common.c src/stlink-common.h src/stlink-usb.c
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.
Also, to the best of my knowledge, this pull request fixes all outstanding issues currently open on stlink. |
Eliminate SCSI pass through, fix F1 targets again, valgrind all the goodies
Hi, Thank for those contributions. I merge them without checking, and I will My best regards, Fabien. 2011/11/15 Karl Palsson
|
The bulk of this change is in the elimination of the scsi pass through for the stlinkv1 hardware. This all seems to be working well now, after a few initial hiccups. Documentation has mostly been updated to cover this, but as always, could do with more :)
I had hoped to get this merged in earlier, but the flurry of activity around the F4 support got in the way a little bit.
This branch has been tested by jnosky and csamuelson on F4 boards, myself and jpa on F1VL and F1 boards, with a mixture of stlinkv1 and stlinkv2 hardware.