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.
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... :)
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.
Lots more informational debug.
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!)
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.
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.
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.
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