Previously, even with the reset enabled, st-util would not connect
to a target if it was running. This change will reset the chip
when opening the connection, which allows st-util to connect
successfully.
Signed-off-by: Greg Meiste <w30289@motorola.com>
Previously when running the program, reading the chip version
would fail. Running the program a second time worked. This
sequence is repeated the next time st-flash/st-util is run.
Giving reset 10ms to complete before trying to read the chip
version resolves the issue.
Signed-off-by: Greg Meiste <w30289@motorola.com>
This patch handles the cache on the cortex-m7 stm32f7 cpu.
When gdb inserts a soft breakpoint (which is the default for
code in RAM), it replaces an instruction with a breakpoint
instruction. But if the caches are enabled, the replacement
may be made only in the D-cache. To reach the I-cache, the
D-cache must be flushed and the I-cache invalidated.
This implementation is coarse: it cleans the whole D-cache
and invalidate the whole I-cache. It is possible to
track which cache lines have to be cleaned and invalidated.
Hello, checked this board with stink. It communicates without flaw with the board:
```
2015-12-15T14:47:03 INFO src/stlink-common.c: Loading device parameters....
2015-12-15T14:47:03 INFO src/stlink-common.c: Device connected is: L0x3 device, id 0x10086417
2015-12-15T14:47:03 INFO src/stlink-common.c: SRAM size: 0x2000 bytes (8 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 128 bytes
2015-12-15T14:47:03 INFO gdbserver/gdb-server.c: Chip ID is 00000417, Core ID is 0bc11477.
2015-12-15T14:47:03 INFO gdbserver/gdb-server.c: Target voltage is 3264 mV.
2015-12-15T14:47:03 INFO gdbserver/gdb-server.c: Listening at *:4242...
```
When I launch GDB and connect to the server, I get :
```
2015-12-15T14:51:41 ERROR gdbserver/gdb-server.c: [FP_CTRL] = 0x00000041 expecting 0x00000261
2015-12-15T14:51:41 INFO gdbserver/gdb-server.c: GDB connected.
```
on the st-util side and :
```
Cannot access memory at address 0xffffffff
```
on the GDB side
Reading and writing to memory and registers works however I get
```
Cannot access memory at address 0xffffffff
```
Each time I write to the memory or to a register
This adds a parameter to the function stlink_open_usb and to the binary
st-flash to specify one of multiple connected stlinks.
As the identifier the iSerial of the stlink is used.
If no serial is given the function and binary behave as before.