esirisc_flash: Rename PAGE_SIZE to FLASH_PAGE_SIZE
[openocd.git] / src / target / arm_dap.c
index 3be4d7199c1c9122d33d4ee7b335b36ade13cc55..fbcfe0d4df0b3b4fd588805f50b30525f1a6b0e8 100644 (file)
@@ -48,7 +48,7 @@ static void dap_instance_init(struct adiv5_dap *dap)
 {
        int i;
        /* Set up with safe defaults */
-       for (i = 0; i <= 255; i++) {
+       for (i = 0; i <= DP_APSEL_MAX; i++) {
                dap->ap[i].dap = dap;
                dap->ap[i].ap_num = i;
                /* memaccess_tck max is 255 */
@@ -56,7 +56,7 @@ static void dap_instance_init(struct adiv5_dap *dap)
                /* Number of bits for tar autoincrement, impl. dep. at least 10 */
                dap->ap[i].tar_autoincr_block = (1<<10);
                /* default CSW value */
-               dap->ap[i].csw_default = CSW_DEFAULT;
+               dap->ap[i].csw_default = CSW_AHB_DEFAULT;
        }
        INIT_LIST_HEAD(&dap->cmd_journal);
 }
@@ -313,20 +313,25 @@ COMMAND_HANDLER(handle_dap_info_command)
        struct adiv5_dap *dap = arm->dap;
        uint32_t apsel;
 
+       if (dap == NULL) {
+               LOG_ERROR("DAP instance not available. Probably a HLA target...");
+               return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
+       }
+
        switch (CMD_ARGC) {
                case 0:
                        apsel = dap->apsel;
                        break;
                case 1:
                        COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], apsel);
-                       if (apsel >= 256)
+                       if (apsel > DP_APSEL_MAX)
                                return ERROR_COMMAND_SYNTAX_ERROR;
                        break;
                default:
                        return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
-       return dap_info_command(CMD_CTX, &dap->ap[apsel]);
+       return dap_info_command(CMD, &dap->ap[apsel]);
 }
 
 static const struct command_registration dap_subcommand_handlers[] = {
@@ -368,6 +373,7 @@ static const struct command_registration dap_commands[] = {
                .mode = COMMAND_CONFIG,
                .help = "DAP commands",
                .chain = dap_subcommand_handlers,
+               .usage = "",
        },
        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)