flash/nor: use command_print() in command "flash banks"
[openocd.git] / src / flash / nor / pic32mx.c
index 1f148fd73935dd00af72f9ecc123065e2f37525d..81ffdc400c2640b61498df24124f4fc031991466 100644 (file)
@@ -620,7 +620,7 @@ static int pic32mx_write(struct flash_bank *bank, const uint8_t *buffer, uint32_
                return ERROR_TARGET_NOT_HALTED;
        }
 
-       LOG_DEBUG("writing to flash at address 0x%08" PRIx32 " at offset 0x%8.8" PRIx32
+       LOG_DEBUG("writing to flash at address " TARGET_ADDR_FMT " at offset 0x%8.8" PRIx32
                        " count: 0x%8.8" PRIx32 "", bank->base, offset, count);
 
        if (offset & 0x3) {
@@ -858,7 +858,7 @@ COMMAND_HANDLER(pic32mx_handle_pgm_word_command)
                return retval;
 
        if (address < bank->base || address >= (bank->base + bank->size)) {
-               command_print(CMD_CTX, "flash address '%s' is out of bounds", CMD_ARGV[0]);
+               command_print(CMD, "flash address '%s' is out of bounds", CMD_ARGV[0]);
                return ERROR_OK;
        }
 
@@ -870,9 +870,9 @@ COMMAND_HANDLER(pic32mx_handle_pgm_word_command)
                res = ERROR_FLASH_OPERATION_FAILED;
 
        if (res == ERROR_OK)
-               command_print(CMD_CTX, "pic32mx pgm word complete");
+               command_print(CMD, "pic32mx pgm word complete");
        else
-               command_print(CMD_CTX, "pic32mx pgm word failed (status = 0x%x)", status);
+               command_print(CMD, "pic32mx pgm word failed (status = 0x%x)", status);
 
        return ERROR_OK;
 }
@@ -885,7 +885,7 @@ COMMAND_HANDLER(pic32mx_handle_unlock_command)
        int timeout = 10;
 
        if (CMD_ARGC < 1) {
-               command_print(CMD_CTX, "pic32mx unlock <bank>");
+               command_print(CMD, "pic32mx unlock <bank>");
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
@@ -907,7 +907,7 @@ COMMAND_HANDLER(pic32mx_handle_unlock_command)
        mips_ejtag_drscan_8(ejtag_info, &mchip_cmd);
        if (mchip_cmd & (1 << 7)) {
                /* device is not locked */
-               command_print(CMD_CTX, "pic32mx is already unlocked, erasing anyway");
+               command_print(CMD, "pic32mx is already unlocked, erasing anyway");
        }
 
        /* unlock/erase device */
@@ -931,7 +931,7 @@ COMMAND_HANDLER(pic32mx_handle_unlock_command)
        /* select ejtag tap */
        mips_ejtag_set_instr(ejtag_info, MTAP_SW_ETAP);
 
-       command_print(CMD_CTX, "pic32mx unlocked.\n"
+       command_print(CMD, "pic32mx unlocked.\n"
                        "INFO: a reset or power cycle is required "
                        "for the new settings to take effect.");
 
@@ -967,7 +967,7 @@ static const struct command_registration pic32mx_command_handlers[] = {
        COMMAND_REGISTRATION_DONE
 };
 
-struct flash_driver pic32mx_flash = {
+const struct flash_driver pic32mx_flash = {
        .name = "pic32mx",
        .commands = pic32mx_command_handlers,
        .flash_bank_command = pic32mx_flash_bank_command,
@@ -980,4 +980,5 @@ struct flash_driver pic32mx_flash = {
        .erase_check = default_flash_blank_check,
        .protect_check = pic32mx_protect_check,
        .info = pic32mx_info,
+       .free_driver_priv = default_flash_free_driver_priv,
 };

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)