Remove st-term from the list of the targets for MinGW.
st-term uses termios and would require a rewrite to have
it compile on MinGW. Also remove cleanup signal handlers
in gdb-server for MinGW to compile.
'-n' in st-util will cause it to skip the reset step, and thus allow you
to begin debugging at whatever point the code may currently be at.
Adding this feature required changing the stlink_open functions to
accept a reset flag that tells them whether or not to reset after
connecting. Skipping reset does not seem to have any adverse effects on
stlink usb devices. Unfortunately, I have to stlink v1 devices to test.
When stopping st-util under Eclipse as an external tool the st-util
receives a SIGTERM signal, and would not return the device to
usb mass storage mode. This change now calls cleanup in the SIGTERM handler too!!
SIGINT causes st-util to immediately exit, without closing the open
stlink. This leaves devices (at least the F4 Discovery) in a state
where they are unable to reset. st-util could still connect and control
them, but a power cycle was required before they could reset on their
own.
A signal handler is added for SIGINT, which performs cleanup and closing
of the open stlink device, allowing it to function normally on
disconnect.
When started with -m, or connected with 'target extended-remote', the
GDB server will not terminate upon disconnection from GDB, instead it
will begin listening for conenctions again.
Starting with extended-remote also has the advantage of allowing 'run'
to be used to reset the target and begin again. Unfortunately, 'start'
is not working properly, as it does not send a reset packet (R), so it
complains when it tries to access memory before it is connected to the
target.
The extra registers added in my previous commit can now be modified from
within GDB. Since the ST-LINK does not support accessing these
registers, a workaround was used from reading an writing to them.
That is, the Debug Core Register Selector Register (DCRSR) can be written
with the register requested, and it will be read/written to/from the
Debug Core Register Data Register (DCRDR). The standard ST-LINK memory
access functions are used to make these accesses.
A target descriptor XML file is sent to GDB from the server, which tells
GDB which registers exist on the target.
This is only supported for the STM32F4, and has only been tested on the
STM32F4DISCOVERY. I tested st-util on an STM32L-DISCOVERY and my
changes did not seem to interfere with its operation.
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
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.