Added the hot plug option to st-flash

pull/1124/head
anton 2021-04-05 21:15:18 +05:00
rodzic 4334ce48b2
commit 9a8e0aa645
3 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -9,7 +9,7 @@
| --opt | st-flash | Optimisation can be enabled in order to skip flashing empty (0x00 or 0xff) bytes at the end of binary file.<br />This may cause some garbage data left after a flash operation. This option was enabled by default in earlier releases. | v1.6.1 |
| --reset | st-flash | Trigger a reset both before and after flashing. The default uses the hardware reset through `NRST` pin.<br />A software reset (via `AIRCR`; since v1.5.1) is used, if the hardware reset failed (`NRST` pin not connected). | v1.0.0 |
| --connect-under-reset | st-info<br />st-flash | Connect under reset. Option makes it possible to connect to the device before code execution. This is useful<br />when the target contains code that lets the device go to sleep, disables debug pins or other special code. | v1.6.1 |
| --hot-plug | st-info<br />st-util | Connect to the target without reset. | v1.6.2 |
| --hot-plug | st-info<br />st-flash<br />st-util | Connect to the target without reset. | v1.6.2 |
| --probe | st-info | Display hardware information about the connected programmer and target MCU. | v1.2.0 |
| --version | st-info<br />st-flash<br />st-util | Print version information. | v1.3.0 |
| --help | st-flash<br />st-util | Print list of available commands. | |

Wyświetl plik

@ -26,8 +26,8 @@ static void cleanup(int signum) {
}
static void usage(void) {
puts("command line: ./st-flash [--debug] [--reset] [--connect-under-reset] [--opt] [--serial <serial>] [--format <format>] [--flash=<fsize>] [--freq=<KHz>] [--area=<area>] {read|write} [path] [addr] [size]");
puts("command line: ./st-flash [--debug] [--connect-under-reset] [--freq=<KHz>] [--serial <serial>] erase");
puts("command line: ./st-flash [--debug] [--reset] [--connect-under-reset] [--hot-plug] [--opt] [--serial <serial>] [--format <format>] [--flash=<fsize>] [--freq=<KHz>] [--area=<area>] {read|write} [path] [addr] [size]");
puts("command line: ./st-flash [--debug] [--connect-under-reset] [--hot-plug] [--freq=<KHz>] [--serial <serial>] erase");
puts("command line: ./st-flash [--debug] [--freq=<KHz>] [--serial <serial>] reset");
puts(" <addr>, <serial> and <size>: Use hex format.");
puts(" <fsize>: Use decimal, octal or hex (prefix 0xXXX) format, optionally followed by k=KB, or m=MB (eg. --flash=128k)");

Wyświetl plik

@ -193,6 +193,8 @@ int flash_get_opts(struct flash_opts* o, int ac, char** av) {
}
} else if (strcmp(av[0], "--connect-under-reset") == 0) {
o->connect = CONNECT_UNDER_RESET;
} else if (strcmp(av[0], "--hot-plug") == 0) {
o->connect = CONNECT_HOT_PLUG;
} else {
break; // non-option found