adapter: Improve three adapter-related prints 69/7269/3
authorJan Matyas <matyas@codasip.com>
Mon, 17 Oct 2022 06:24:05 +0000 (08:24 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sun, 15 Jan 2023 14:57:25 +0000 (14:57 +0000)
- Do not warn the user about adapter speed not being set
  if the selected adapter does not support configurable speed.
  This would be confusing to users.

- Minor reword in the "adapter speed is not selected" warning.

- Print the adapter name in the "adapter doesn't support
  configurable speed" log entry

- Another minor reword: autoselect --> autoselecting

Signed-off-by: Jan Matyas <matyas@codasip.com>
Change-Id: I4c198b547544fd8199921f092153562c5f159134
Reviewed-on: https://review.openocd.org/c/openocd/+/7269
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
src/jtag/adapter.c
src/transport/transport.c

index b7feac5751f24cbdf62d37256ad319d9234c9756..eb73fcb9a3d3b2e835d594d4296e5e0f4e04a197 100644 (file)
@@ -136,9 +136,11 @@ int adapter_init(struct command_context *cmd_ctx)
 
        int retval;
 
-       if (adapter_config.clock_mode == CLOCK_MODE_UNSELECTED) {
+       /* If the adapter supports configurable speed but the speed is not configured,
+        * provide a hint to the user. */
+       if (adapter_driver->speed && adapter_config.clock_mode == CLOCK_MODE_UNSELECTED) {
                LOG_WARNING("An adapter speed is not selected in the init scripts."
-                       " OpenOCD will try to run the adapter at the low speed (%d kHz)",
+                       " OpenOCD will try to run the adapter at very low speed (%d kHz).",
                        DEFAULT_CLOCK_SPEED_KHZ);
                LOG_WARNING("To remove this warnings and achieve reasonable communication speed with the target,"
                    " set \"adapter speed\" or \"jtag_rclk\" in the init scripts.");
@@ -153,7 +155,7 @@ int adapter_init(struct command_context *cmd_ctx)
        adapter_config.adapter_initialized = true;
 
        if (!adapter_driver->speed) {
-               LOG_INFO("This adapter doesn't support configurable speed");
+               LOG_INFO("Note: The adapter \"%s\" doesn't support configurable speed", adapter_driver->name);
                return ERROR_OK;
        }
 
index d72a48baa9bcb5a17f51debc2f5525fc28d0b88c..c05db3f005f5ac1e503aeccd6c72ccc0bd1de65e 100644 (file)
@@ -104,7 +104,7 @@ int allow_transports(struct command_context *ctx, const char * const *vector)
 
        /* autoselect if there's no choice ... */
        if (!vector[1]) {
-               LOG_INFO("only one transport option; autoselect '%s'", vector[0]);
+               LOG_INFO("only one transport option; autoselecting '%s'", vector[0]);
                return transport_select(ctx, vector[0]);
        }
 

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)