ARM7/ARM9: help/usage updates
[openocd.git] / src / target / arm7_9_common.c
index 5563a4e028f7e5c9dcbf37c028cfcc30e443f006..2f4c408ce8124cda4547acb14535d3eb58b144bb 100644 (file)
@@ -889,34 +889,11 @@ int arm7_9_poll(struct target *target)
                }
                if ((target->state == TARGET_RUNNING) || (target->state == TARGET_RESET))
                {
-                       int check_pc = 0;
-                       if (target->state == TARGET_RESET)
-                       {
-                               if (target->reset_halt)
-                               {
-                                       enum reset_types jtag_reset_config = jtag_get_reset_config();
-                                       if ((jtag_reset_config & RESET_SRST_PULLS_TRST) == 0)
-                                       {
-                                               check_pc = 1;
-                                       }
-                               }
-                       }
-
                        target->state = TARGET_HALTED;
 
                        if ((retval = arm7_9_debug_entry(target)) != ERROR_OK)
                                return retval;
 
-                       if (check_pc)
-                       {
-                               struct reg *reg = register_get_by_name(target->reg_cache, "pc", 1);
-                               uint32_t t=*((uint32_t *)reg->value);
-                               if (t != 0)
-                               {
-                                       LOG_ERROR("PC was not 0. Does this target need srst_pulls_trst?");
-                               }
-                       }
-
                        if (arm_semihosting(target, &retval) != 0)
                                return retval;
 
@@ -2362,10 +2339,6 @@ int arm7_9_read_memory(struct target *target, uint32_t address, uint32_t size, u
                                }
                        }
                        break;
-               default:
-                       LOG_ERROR("BUG: we shouldn't get here");
-                       exit(-1);
-                       break;
        }
 
        if (!is_arm_mode(armv4_5->core_mode))
@@ -2546,10 +2519,6 @@ int arm7_9_write_memory(struct target *target, uint32_t address, uint32_t size,
                                num_accesses += thisrun_accesses;
                        }
                        break;
-               default:
-                       LOG_ERROR("BUG: we shouldn't get here");
-                       exit(-1);
-                       break;
        }
 
        /* Re-Set DBGACK */
@@ -2828,6 +2797,12 @@ COMMAND_HANDLER(handle_arm7_9_semihosting_command)
 
                COMMAND_PARSE_ENABLE(CMD_ARGV[0], semihosting);
 
+               if (!target_was_examined(target))
+               {
+                       LOG_ERROR("Target not examined yet");
+                       return ERROR_FAIL;
+               }
+
                if (arm7_9->has_vector_catch) {
                        struct reg *vector_catch = &arm7_9->eice_cache
                                        ->reg_list[EICE_VEC_CATCH];
@@ -2889,32 +2864,32 @@ int arm7_9_init_arch_info(struct target *target, struct arm7_9_common *arm7_9)
 static const struct command_registration arm7_9_any_command_handlers[] = {
        {
                "dbgrq",
-               .handler = &handle_arm7_9_dbgrq_command,
+               .handler = handle_arm7_9_dbgrq_command,
                .mode = COMMAND_ANY,
-               .usage = "<enable|disable>",
+               .usage = "['enable'|'disable']",
                .help = "use EmbeddedICE dbgrq instead of breakpoint "
                        "for target halt requests",
        },
        {
                "fast_memory_access",
-               .handler = &handle_arm7_9_fast_memory_access_command,
+               .handler = handle_arm7_9_fast_memory_access_command,
                .mode = COMMAND_ANY,
-               .usage = "<enable|disable>",
+               .usage = "['enable'|'disable']",
                .help = "use fast memory accesses instead of slower "
                        "but potentially safer accesses",
        },
        {
                "dcc_downloads",
-               .handler = &handle_arm7_9_dcc_downloads_command,
+               .handler = handle_arm7_9_dcc_downloads_command,
                .mode = COMMAND_ANY,
-               .usage = "<enable | disable>",
+               .usage = "['enable'|'disable']",
                .help = "use DCC downloads for larger memory writes",
        },
        {
                "semihosting",
-               .handler = &handle_arm7_9_semihosting_command,
+               .handler = handle_arm7_9_semihosting_command,
                .mode = COMMAND_EXEC,
-               .usage = "<enable | disable>",
+               .usage = "['enable'|'disable']",
                .help = "activate support for semihosting operations",
        },
        COMMAND_REGISTRATION_DONE

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)