mirror of
https://github.com/linux-msm/openocd.git
synced 2026-02-25 13:15:07 -08:00
helper/command: change prototype of command_print/command_print_sameline
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should switch to CMD as first parameter. Change prototype of command_print() and command_print_sameline() to pass CMD instead of CMD_CTX. Since the first parameter is currently not used, the change can be done though scripts without manual coding. This patch is created using the command: sed -i PATTERN $(find src/ doc/ -type f) with all the following patters: 's/\(command_print(cmd\)->ctx,/\1,/' 's/\(command_print(CMD\)_CTX,/\1,/' 's/\(command_print(struct command_\)context \*context,/\1invocation *cmd,/' 's/\(command_print_sameline(cmd\)->ctx,/\1,/' 's/\(command_print_sameline(CMD\)_CTX,/\1,/' 's/\(command_print_sameline(struct command_\)context \*context,/\1invocation *cmd,/' This change is inspired by http://openocd.zylin.com/1815 from Paul Fertser but is now done through scripting. Change-Id: I3386d8f96cdc477e7a2308dd18269de3bed04385 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/5081 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
committed by
Tomas Vanek
parent
6916550938
commit
6cb5ba6f11
@@ -16,7 +16,7 @@ COMMAND_HANDLER(handle_hello_command)
|
||||
const char *sep, *name;
|
||||
int retval = CALL_COMMAND_HANDLER(handle_hello_args);
|
||||
if (ERROR_OK == retval)
|
||||
command_print(CMD_CTX, "Greetings%s%s!", sep, name);
|
||||
command_print(CMD, "Greetings%s%s!", sep, name);
|
||||
return retval;
|
||||
}
|
||||
@endcode
|
||||
|
||||
@@ -423,7 +423,7 @@ COMMAND_HANDLER(mg_probe_cmd)
|
||||
ret = mg_mflash_probe();
|
||||
|
||||
if (ret == ERROR_OK) {
|
||||
command_print(CMD_CTX,
|
||||
command_print(CMD,
|
||||
"mflash (total %" PRIu32 " sectors) found at 0x%8.8" PRIx32 "",
|
||||
mflash_bank->drv_info->tot_sects,
|
||||
mflash_bank->base);
|
||||
@@ -799,7 +799,7 @@ COMMAND_HANDLER(mg_write_cmd)
|
||||
}
|
||||
|
||||
if (duration_measure(&bench) == ERROR_OK) {
|
||||
command_print(CMD_CTX, "wrote %zu bytes from file %s "
|
||||
command_print(CMD, "wrote %zu bytes from file %s "
|
||||
"in %fs (%0.3f kB/s)", filesize, CMD_ARGV[1],
|
||||
duration_elapsed(&bench), duration_kbps(&bench, filesize));
|
||||
}
|
||||
@@ -866,7 +866,7 @@ COMMAND_HANDLER(mg_dump_cmd)
|
||||
}
|
||||
|
||||
if (duration_measure(&bench) == ERROR_OK) {
|
||||
command_print(CMD_CTX, "dump image (address 0x%8.8" PRIx32 " "
|
||||
command_print(CMD, "dump image (address 0x%8.8" PRIx32 " "
|
||||
"size %" PRIu32 ") to file %s in %fs (%0.3f kB/s)",
|
||||
address, size, CMD_ARGV[1],
|
||||
duration_elapsed(&bench), duration_kbps(&bench, size));
|
||||
|
||||
@@ -547,14 +547,14 @@ COMMAND_HANDLER(handle_at91sam9_cle_command)
|
||||
unsigned num, address_line;
|
||||
|
||||
if (CMD_ARGC != 2) {
|
||||
command_print(CMD_CTX, "incorrect number of arguments for 'at91sam9 cle' command");
|
||||
command_print(CMD, "incorrect number of arguments for 'at91sam9 cle' command");
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], num);
|
||||
nand = get_nand_device_by_num(num);
|
||||
if (!nand) {
|
||||
command_print(CMD_CTX, "invalid nand device number: %s", CMD_ARGV[0]);
|
||||
command_print(CMD, "invalid nand device number: %s", CMD_ARGV[0]);
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
@@ -582,7 +582,7 @@ COMMAND_HANDLER(handle_at91sam9_ale_command)
|
||||
COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], num);
|
||||
nand = get_nand_device_by_num(num);
|
||||
if (!nand) {
|
||||
command_print(CMD_CTX, "invalid nand device number: %s", CMD_ARGV[0]);
|
||||
command_print(CMD, "invalid nand device number: %s", CMD_ARGV[0]);
|
||||
return ERROR_COMMAND_ARGUMENT_INVALID;
|
||||
}
|
||||
|
||||
@@ -610,7 +610,7 @@ COMMAND_HANDLER(handle_at91sam9_rdy_busy_command)
|
||||
COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], num);
|
||||
nand = get_nand_device_by_num(num);
|
||||
if (!nand) {
|
||||
command_print(CMD_CTX, "invalid nand device number: %s", CMD_ARGV[0]);
|
||||
command_print(CMD, "invalid nand device number: %s", CMD_ARGV[0]);
|
||||
return ERROR_COMMAND_ARGUMENT_INVALID;
|
||||
}
|
||||
|
||||
@@ -641,7 +641,7 @@ COMMAND_HANDLER(handle_at91sam9_ce_command)
|
||||
COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], num);
|
||||
nand = get_nand_device_by_num(num);
|
||||
if (!nand) {
|
||||
command_print(CMD_CTX, "invalid nand device number: %s", CMD_ARGV[0]);
|
||||
command_print(CMD, "invalid nand device number: %s", CMD_ARGV[0]);
|
||||
return ERROR_COMMAND_ARGUMENT_INVALID;
|
||||
}
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@ COMMAND_HELPER(nand_command_get_device, unsigned name_index,
|
||||
COMMAND_PARSE_NUMBER(uint, str, num);
|
||||
*nand = get_nand_device_by_num(num);
|
||||
if (!*nand) {
|
||||
command_print(CMD_CTX, "NAND flash device '%s' not found", str);
|
||||
command_print(CMD, "NAND flash device '%s' not found", str);
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
return ERROR_OK;
|
||||
|
||||
@@ -59,7 +59,7 @@ int nand_fileio_start(struct command_invocation *cmd,
|
||||
struct nand_fileio_state *state)
|
||||
{
|
||||
if (state->address % nand->page_size) {
|
||||
command_print(cmd->ctx, "only page-aligned addresses are supported");
|
||||
command_print(cmd, "only page-aligned addresses are supported");
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ int nand_fileio_start(struct command_invocation *cmd,
|
||||
int retval = fileio_open(&state->fileio, filename, filemode, FILEIO_BINARY);
|
||||
if (ERROR_OK != retval) {
|
||||
const char *msg = (FILEIO_READ == filemode) ? "read" : "write";
|
||||
command_print(cmd->ctx, "failed to open '%s' for %s access",
|
||||
command_print(cmd, "failed to open '%s' for %s access",
|
||||
filename, msg);
|
||||
return retval;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ COMMAND_HELPER(nand_fileio_parse_args, struct nand_fileio_state *state,
|
||||
return retval;
|
||||
|
||||
if (NULL == nand->device) {
|
||||
command_print(CMD_CTX, "#%s: not probed", CMD_ARGV[0]);
|
||||
command_print(CMD, "#%s: not probed", CMD_ARGV[0]);
|
||||
return ERROR_NAND_DEVICE_NOT_PROBED;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ COMMAND_HELPER(nand_fileio_parse_args, struct nand_fileio_state *state,
|
||||
if (need_size) {
|
||||
COMMAND_PARSE_NUMBER(u32, CMD_ARGV[3], state->size);
|
||||
if (state->size % nand->page_size) {
|
||||
command_print(CMD_CTX, "only page-aligned sizes are supported");
|
||||
command_print(CMD, "only page-aligned sizes are supported");
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
}
|
||||
@@ -155,7 +155,7 @@ COMMAND_HELPER(nand_fileio_parse_args, struct nand_fileio_state *state,
|
||||
else if (sw_ecc && !strcmp(CMD_ARGV[i], "oob_softecc_kw"))
|
||||
state->oob_format |= NAND_OOB_SW_ECC_KW;
|
||||
else {
|
||||
command_print(CMD_CTX, "unknown option: %s", CMD_ARGV[i]);
|
||||
command_print(CMD, "unknown option: %s", CMD_ARGV[i]);
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1290,7 +1290,7 @@ COMMAND_HANDLER(handle_lpc3180_select_command)
|
||||
COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], num);
|
||||
struct nand_device *nand = get_nand_device_by_num(num);
|
||||
if (!nand) {
|
||||
command_print(CMD_CTX, "nand device '#%s' is out of bounds", CMD_ARGV[0]);
|
||||
command_print(CMD, "nand device '#%s' is out of bounds", CMD_ARGV[0]);
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
@@ -1310,10 +1310,10 @@ COMMAND_HANDLER(handle_lpc3180_select_command)
|
||||
}
|
||||
|
||||
if (lpc3180_info->selected_controller == LPC3180_MLC_CONTROLLER)
|
||||
command_print(CMD_CTX, "%s controller selected",
|
||||
command_print(CMD, "%s controller selected",
|
||||
selected[lpc3180_info->selected_controller]);
|
||||
else
|
||||
command_print(CMD_CTX,
|
||||
command_print(CMD,
|
||||
lpc3180_info->is_bulk ? "%s controller selected bulk mode is available" :
|
||||
"%s controller selected bulk mode is not available",
|
||||
selected[lpc3180_info->selected_controller]);
|
||||
|
||||
@@ -1760,7 +1760,7 @@ COMMAND_HANDLER(handle_lpc32xx_select_command)
|
||||
COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], num);
|
||||
struct nand_device *nand = get_nand_device_by_num(num);
|
||||
if (!nand) {
|
||||
command_print(CMD_CTX, "nand device '#%s' is out of bounds",
|
||||
command_print(CMD, "nand device '#%s' is out of bounds",
|
||||
CMD_ARGV[0]);
|
||||
return ERROR_OK;
|
||||
}
|
||||
@@ -1778,7 +1778,7 @@ COMMAND_HANDLER(handle_lpc32xx_select_command)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
|
||||
command_print(CMD_CTX, "%s controller selected",
|
||||
command_print(CMD, "%s controller selected",
|
||||
selected[lpc32xx_info->selected_controller]);
|
||||
|
||||
return ERROR_OK;
|
||||
|
||||
@@ -157,7 +157,7 @@ COMMAND_HANDLER(handle_mxc_biswap_command)
|
||||
|
||||
int retval = CALL_COMMAND_HANDLER(nand_command_get_device, 0, &nand);
|
||||
if (retval != ERROR_OK) {
|
||||
command_print(CMD_CTX, "invalid nand device number or name: %s", CMD_ARGV[0]);
|
||||
command_print(CMD, "invalid nand device number or name: %s", CMD_ARGV[0]);
|
||||
return ERROR_COMMAND_ARGUMENT_INVALID;
|
||||
}
|
||||
|
||||
@@ -169,9 +169,9 @@ COMMAND_HANDLER(handle_mxc_biswap_command)
|
||||
mxc_nf_info->flags.biswap_enabled = false;
|
||||
}
|
||||
if (mxc_nf_info->flags.biswap_enabled)
|
||||
command_print(CMD_CTX, "BI-swapping enabled on %s", nand->name);
|
||||
command_print(CMD, "BI-swapping enabled on %s", nand->name);
|
||||
else
|
||||
command_print(CMD_CTX, "BI-swapping disabled on %s", nand->name);
|
||||
command_print(CMD, "BI-swapping disabled on %s", nand->name);
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
@@ -37,20 +37,20 @@ COMMAND_HANDLER(handle_nand_list_command)
|
||||
int i;
|
||||
|
||||
if (!nand_devices) {
|
||||
command_print(CMD_CTX, "no NAND flash devices configured");
|
||||
command_print(CMD, "no NAND flash devices configured");
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
for (p = nand_devices, i = 0; p; p = p->next, i++) {
|
||||
if (p->device)
|
||||
command_print(CMD_CTX, "#%i: %s (%s) "
|
||||
command_print(CMD, "#%i: %s (%s) "
|
||||
"pagesize: %i, buswidth: %i,\n\t"
|
||||
"blocksize: %i, blocks: %i",
|
||||
i, p->device->name, p->manufacturer->name,
|
||||
p->page_size, p->bus_width,
|
||||
p->erase_size, p->num_blocks);
|
||||
else
|
||||
command_print(CMD_CTX, "#%i: not probed", i);
|
||||
command_print(CMD, "#%i: not probed", i);
|
||||
}
|
||||
|
||||
return ERROR_OK;
|
||||
@@ -87,7 +87,7 @@ COMMAND_HANDLER(handle_nand_info_command)
|
||||
return retval;
|
||||
|
||||
if (NULL == p->device) {
|
||||
command_print(CMD_CTX, "#%s: not probed", CMD_ARGV[0]);
|
||||
command_print(CMD, "#%s: not probed", CMD_ARGV[0]);
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ COMMAND_HANDLER(handle_nand_info_command)
|
||||
if (last >= p->num_blocks)
|
||||
last = p->num_blocks - 1;
|
||||
|
||||
command_print(CMD_CTX,
|
||||
command_print(CMD,
|
||||
"#%i: %s (%s) pagesize: %i, buswidth: %i, erasesize: %i",
|
||||
i++,
|
||||
p->device->name,
|
||||
@@ -123,7 +123,7 @@ COMMAND_HANDLER(handle_nand_info_command)
|
||||
else
|
||||
bad_state = " (block condition unknown)";
|
||||
|
||||
command_print(CMD_CTX,
|
||||
command_print(CMD,
|
||||
"\t#%i: 0x%8.8" PRIx32 " (%" PRId32 "kB) %s%s",
|
||||
j,
|
||||
p->blocks[j].offset,
|
||||
@@ -147,7 +147,7 @@ COMMAND_HANDLER(handle_nand_probe_command)
|
||||
|
||||
retval = nand_probe(p);
|
||||
if (retval == ERROR_OK) {
|
||||
command_print(CMD_CTX, "NAND flash device '%s (%s)' found",
|
||||
command_print(CMD, "NAND flash device '%s (%s)' found",
|
||||
p->device->name, p->manufacturer->name);
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ COMMAND_HANDLER(handle_nand_erase_command)
|
||||
|
||||
retval = nand_erase(p, offset, offset + length - 1);
|
||||
if (retval == ERROR_OK) {
|
||||
command_print(CMD_CTX, "erased blocks %lu to %lu "
|
||||
command_print(CMD, "erased blocks %lu to %lu "
|
||||
"on NAND flash device #%s '%s'",
|
||||
offset, offset + length - 1,
|
||||
CMD_ARGV[0], p->device->name);
|
||||
@@ -233,7 +233,7 @@ COMMAND_HANDLER(handle_nand_check_bad_blocks_command)
|
||||
|
||||
retval = nand_build_bbt(p, first, last);
|
||||
if (retval == ERROR_OK) {
|
||||
command_print(CMD_CTX, "checked NAND flash device for bad blocks, "
|
||||
command_print(CMD, "checked NAND flash device for bad blocks, "
|
||||
"use \"nand info\" command to list blocks");
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ COMMAND_HANDLER(handle_nand_write_command)
|
||||
while (s.size > 0) {
|
||||
int bytes_read = nand_fileio_read(nand, &s);
|
||||
if (bytes_read <= 0) {
|
||||
command_print(CMD_CTX, "error while reading file");
|
||||
command_print(CMD, "error while reading file");
|
||||
nand_fileio_cleanup(&s);
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
@@ -262,7 +262,7 @@ COMMAND_HANDLER(handle_nand_write_command)
|
||||
retval = nand_write_page(nand, s.address / nand->page_size,
|
||||
s.page, s.page_size, s.oob, s.oob_size);
|
||||
if (ERROR_OK != retval) {
|
||||
command_print(CMD_CTX, "failed writing file %s "
|
||||
command_print(CMD, "failed writing file %s "
|
||||
"to NAND flash %s at offset 0x%8.8" PRIx32,
|
||||
CMD_ARGV[1], CMD_ARGV[0], s.address);
|
||||
nand_fileio_cleanup(&s);
|
||||
@@ -272,7 +272,7 @@ COMMAND_HANDLER(handle_nand_write_command)
|
||||
}
|
||||
|
||||
if (nand_fileio_finish(&s) == ERROR_OK) {
|
||||
command_print(CMD_CTX, "wrote file %s to NAND flash %s up to "
|
||||
command_print(CMD, "wrote file %s to NAND flash %s up to "
|
||||
"offset 0x%8.8" PRIx32 " in %fs (%0.3f KiB/s)",
|
||||
CMD_ARGV[1], CMD_ARGV[0], s.address, duration_elapsed(&s.bench),
|
||||
duration_kbps(&s.bench, total_bytes));
|
||||
@@ -302,7 +302,7 @@ COMMAND_HANDLER(handle_nand_verify_command)
|
||||
retval = nand_read_page(nand, dev.address / dev.page_size,
|
||||
dev.page, dev.page_size, dev.oob, dev.oob_size);
|
||||
if (ERROR_OK != retval) {
|
||||
command_print(CMD_CTX, "reading NAND flash page failed");
|
||||
command_print(CMD, "reading NAND flash page failed");
|
||||
nand_fileio_cleanup(&dev);
|
||||
nand_fileio_cleanup(&file);
|
||||
return retval;
|
||||
@@ -310,7 +310,7 @@ COMMAND_HANDLER(handle_nand_verify_command)
|
||||
|
||||
int bytes_read = nand_fileio_read(nand, &file);
|
||||
if (bytes_read <= 0) {
|
||||
command_print(CMD_CTX, "error while reading file");
|
||||
command_print(CMD, "error while reading file");
|
||||
nand_fileio_cleanup(&dev);
|
||||
nand_fileio_cleanup(&file);
|
||||
return ERROR_FAIL;
|
||||
@@ -318,7 +318,7 @@ COMMAND_HANDLER(handle_nand_verify_command)
|
||||
|
||||
if ((dev.page && memcmp(dev.page, file.page, dev.page_size)) ||
|
||||
(dev.oob && memcmp(dev.oob, file.oob, dev.oob_size))) {
|
||||
command_print(CMD_CTX, "NAND flash contents differ "
|
||||
command_print(CMD, "NAND flash contents differ "
|
||||
"at 0x%8.8" PRIx32, dev.address);
|
||||
nand_fileio_cleanup(&dev);
|
||||
nand_fileio_cleanup(&file);
|
||||
@@ -330,7 +330,7 @@ COMMAND_HANDLER(handle_nand_verify_command)
|
||||
}
|
||||
|
||||
if (nand_fileio_finish(&file) == ERROR_OK) {
|
||||
command_print(CMD_CTX, "verified file %s in NAND flash %s "
|
||||
command_print(CMD, "verified file %s in NAND flash %s "
|
||||
"up to offset 0x%8.8" PRIx32 " in %fs (%0.3f KiB/s)",
|
||||
CMD_ARGV[1], CMD_ARGV[0], dev.address, duration_elapsed(&file.bench),
|
||||
duration_kbps(&file.bench, dev.size));
|
||||
@@ -354,7 +354,7 @@ COMMAND_HANDLER(handle_nand_dump_command)
|
||||
retval = nand_read_page(nand, s.address / nand->page_size,
|
||||
s.page, s.page_size, s.oob, s.oob_size);
|
||||
if (ERROR_OK != retval) {
|
||||
command_print(CMD_CTX, "reading NAND flash page failed");
|
||||
command_print(CMD, "reading NAND flash page failed");
|
||||
nand_fileio_cleanup(&s);
|
||||
return retval;
|
||||
}
|
||||
@@ -374,7 +374,7 @@ COMMAND_HANDLER(handle_nand_dump_command)
|
||||
return retval;
|
||||
|
||||
if (nand_fileio_finish(&s) == ERROR_OK) {
|
||||
command_print(CMD_CTX, "dumped %zu bytes in %fs (%0.3f KiB/s)",
|
||||
command_print(CMD, "dumped %zu bytes in %fs (%0.3f KiB/s)",
|
||||
filesize, duration_elapsed(&s.bench),
|
||||
duration_kbps(&s.bench, filesize));
|
||||
}
|
||||
@@ -392,7 +392,7 @@ COMMAND_HANDLER(handle_nand_raw_access_command)
|
||||
return retval;
|
||||
|
||||
if (NULL == p->device) {
|
||||
command_print(CMD_CTX, "#%s: not probed", CMD_ARGV[0]);
|
||||
command_print(CMD, "#%s: not probed", CMD_ARGV[0]);
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
@@ -400,7 +400,7 @@ COMMAND_HANDLER(handle_nand_raw_access_command)
|
||||
COMMAND_PARSE_ENABLE(CMD_ARGV[1], p->use_raw);
|
||||
|
||||
const char *msg = p->use_raw ? "enabled" : "disabled";
|
||||
command_print(CMD_CTX, "raw access is %s", msg);
|
||||
command_print(CMD, "raw access is %s", msg);
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
@@ -502,13 +502,13 @@ COMMAND_HANDLER(handle_nand_init_command)
|
||||
static int nand_list_walker(struct nand_flash_controller *c, void *x)
|
||||
{
|
||||
struct command_invocation *cmd = x;
|
||||
command_print(cmd->ctx, " %s", c->name);
|
||||
command_print(cmd, " %s", c->name);
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
COMMAND_HANDLER(handle_nand_list_drivers)
|
||||
{
|
||||
command_print(CMD_CTX, "Available NAND flash controller drivers:");
|
||||
command_print(CMD, "Available NAND flash controller drivers:");
|
||||
return nand_driver_walk(&nand_list_walker, CMD);
|
||||
}
|
||||
|
||||
|
||||
@@ -791,9 +791,9 @@ COMMAND_HANDLER(ambiqmicro_handle_mass_erase_command)
|
||||
for (i = 0; i < bank->num_sectors; i++)
|
||||
bank->sectors[i].is_erased = 1;
|
||||
|
||||
command_print(CMD_CTX, "ambiqmicro mass erase complete");
|
||||
command_print(CMD, "ambiqmicro mass erase complete");
|
||||
} else
|
||||
command_print(CMD_CTX, "ambiqmicro mass erase failed");
|
||||
command_print(CMD, "ambiqmicro mass erase failed");
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
@@ -815,9 +815,9 @@ COMMAND_HANDLER(ambiqmicro_handle_page_erase_command)
|
||||
return retval;
|
||||
|
||||
if (ambiqmicro_erase(bank, first, last) == ERROR_OK)
|
||||
command_print(CMD_CTX, "ambiqmicro page erase complete");
|
||||
command_print(CMD, "ambiqmicro page erase complete");
|
||||
else
|
||||
command_print(CMD_CTX, "ambiqmicro page erase failed");
|
||||
command_print(CMD, "ambiqmicro page erase failed");
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
@@ -838,7 +838,7 @@ COMMAND_HANDLER(ambiqmicro_handle_program_otp_command)
|
||||
COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], offset);
|
||||
COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], count);
|
||||
|
||||
command_print(CMD_CTX, "offset=0x%08x count=%d", offset, count);
|
||||
command_print(CMD, "offset=0x%08x count=%d", offset, count);
|
||||
|
||||
CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
|
||||
|
||||
|
||||
@@ -256,7 +256,7 @@ static struct sam3_chip *get_current_sam3(struct command_invocation *cmd)
|
||||
|
||||
t = get_current_target(cmd->ctx);
|
||||
if (!t) {
|
||||
command_print(cmd->ctx, "No current target?");
|
||||
command_print(cmd, "No current target?");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ static struct sam3_chip *get_current_sam3(struct command_invocation *cmd)
|
||||
if (!p) {
|
||||
/* this should not happen */
|
||||
/* the command is not registered until the chip is created? */
|
||||
command_print(cmd->ctx, "No SAM3 chips exist?");
|
||||
command_print(cmd, "No SAM3 chips exist?");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ static struct sam3_chip *get_current_sam3(struct command_invocation *cmd)
|
||||
return p;
|
||||
p = p->next;
|
||||
}
|
||||
command_print(cmd->ctx, "Cannot find SAM3 chip?");
|
||||
command_print(cmd, "Cannot find SAM3 chip?");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -3549,7 +3549,7 @@ COMMAND_HANDLER(sam3_handle_info_command)
|
||||
if (pChip->details.bank[0].pBank == NULL) {
|
||||
x = 0;
|
||||
need_define:
|
||||
command_print(CMD_CTX,
|
||||
command_print(CMD,
|
||||
"Please define bank %d via command: flash bank %s ... ",
|
||||
x,
|
||||
at91sam3_flash.name);
|
||||
@@ -3608,7 +3608,7 @@ COMMAND_HANDLER(sam3_handle_gpnvm_command)
|
||||
}
|
||||
|
||||
if (pChip->details.bank[0].pBank == NULL) {
|
||||
command_print(CMD_CTX, "Bank0 must be defined first via: flash bank %s ...",
|
||||
command_print(CMD, "Bank0 must be defined first via: flash bank %s ...",
|
||||
at91sam3_flash.name);
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
@@ -3647,22 +3647,22 @@ showall:
|
||||
r = FLASHD_GetGPNVM(&(pChip->details.bank[0]), x, &v);
|
||||
if (r != ERROR_OK)
|
||||
break;
|
||||
command_print(CMD_CTX, "sam3-gpnvm%u: %u", x, v);
|
||||
command_print(CMD, "sam3-gpnvm%u: %u", x, v);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
if ((who >= 0) && (((unsigned)(who)) < pChip->details.n_gpnvms)) {
|
||||
r = FLASHD_GetGPNVM(&(pChip->details.bank[0]), who, &v);
|
||||
command_print(CMD_CTX, "sam3-gpnvm%u: %u", who, v);
|
||||
command_print(CMD, "sam3-gpnvm%u: %u", who, v);
|
||||
return r;
|
||||
} else {
|
||||
command_print(CMD_CTX, "sam3-gpnvm invalid GPNVM: %u", who);
|
||||
command_print(CMD, "sam3-gpnvm invalid GPNVM: %u", who);
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
if (who == -1) {
|
||||
command_print(CMD_CTX, "Missing GPNVM number");
|
||||
command_print(CMD, "Missing GPNVM number");
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
|
||||
@@ -3672,7 +3672,7 @@ showall:
|
||||
(0 == strcmp("clear", CMD_ARGV[0]))) /* quietly accept both */
|
||||
r = FLASHD_ClrGPNVM(&(pChip->details.bank[0]), who);
|
||||
else {
|
||||
command_print(CMD_CTX, "Unknown command: %s", CMD_ARGV[0]);
|
||||
command_print(CMD, "Unknown command: %s", CMD_ARGV[0]);
|
||||
r = ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
return r;
|
||||
@@ -3697,7 +3697,7 @@ COMMAND_HANDLER(sam3_handle_slowclk_command)
|
||||
COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], v);
|
||||
if (v > 200000) {
|
||||
/* absurd slow clock of 200Khz? */
|
||||
command_print(CMD_CTX, "Absurd/illegal slow clock freq: %d\n", (int)(v));
|
||||
command_print(CMD, "Absurd/illegal slow clock freq: %d\n", (int)(v));
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
pChip->cfg.slow_freq = v;
|
||||
@@ -3705,11 +3705,11 @@ COMMAND_HANDLER(sam3_handle_slowclk_command)
|
||||
}
|
||||
default:
|
||||
/* error */
|
||||
command_print(CMD_CTX, "Too many parameters");
|
||||
command_print(CMD, "Too many parameters");
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
break;
|
||||
}
|
||||
command_print(CMD_CTX, "Slowclk freq: %d.%03dkhz",
|
||||
command_print(CMD, "Slowclk freq: %d.%03dkhz",
|
||||
(int)(pChip->cfg.slow_freq / 1000),
|
||||
(int)(pChip->cfg.slow_freq % 1000));
|
||||
return ERROR_OK;
|
||||
|
||||
@@ -235,7 +235,7 @@ static struct sam4_chip *get_current_sam4(struct command_invocation *cmd)
|
||||
|
||||
t = get_current_target(cmd->ctx);
|
||||
if (!t) {
|
||||
command_print(cmd->ctx, "No current target?");
|
||||
command_print(cmd, "No current target?");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ static struct sam4_chip *get_current_sam4(struct command_invocation *cmd)
|
||||
if (!p) {
|
||||
/* this should not happen */
|
||||
/* the command is not registered until the chip is created? */
|
||||
command_print(cmd->ctx, "No SAM4 chips exist?");
|
||||
command_print(cmd, "No SAM4 chips exist?");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ static struct sam4_chip *get_current_sam4(struct command_invocation *cmd)
|
||||
return p;
|
||||
p = p->next;
|
||||
}
|
||||
command_print(cmd->ctx, "Cannot find SAM4 chip?");
|
||||
command_print(cmd, "Cannot find SAM4 chip?");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -3029,7 +3029,7 @@ COMMAND_HANDLER(sam4_handle_info_command)
|
||||
if (pChip->details.bank[0].pBank == NULL) {
|
||||
x = 0;
|
||||
need_define:
|
||||
command_print(CMD_CTX,
|
||||
command_print(CMD,
|
||||
"Please define bank %d via command: flash bank %s ... ",
|
||||
x,
|
||||
at91sam4_flash.name);
|
||||
@@ -3088,7 +3088,7 @@ COMMAND_HANDLER(sam4_handle_gpnvm_command)
|
||||
}
|
||||
|
||||
if (pChip->details.bank[0].pBank == NULL) {
|
||||
command_print(CMD_CTX, "Bank0 must be defined first via: flash bank %s ...",
|
||||
command_print(CMD, "Bank0 must be defined first via: flash bank %s ...",
|
||||
at91sam4_flash.name);
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
@@ -3127,23 +3127,23 @@ showall:
|
||||
r = FLASHD_GetGPNVM(&(pChip->details.bank[0]), x, &v);
|
||||
if (r != ERROR_OK)
|
||||
break;
|
||||
command_print(CMD_CTX, "sam4-gpnvm%u: %u", x, v);
|
||||
command_print(CMD, "sam4-gpnvm%u: %u", x, v);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
if ((who >= 0) && (((unsigned)(who)) < pChip->details.n_gpnvms)) {
|
||||
r = FLASHD_GetGPNVM(&(pChip->details.bank[0]), who, &v);
|
||||
if (r == ERROR_OK)
|
||||
command_print(CMD_CTX, "sam4-gpnvm%u: %u", who, v);
|
||||
command_print(CMD, "sam4-gpnvm%u: %u", who, v);
|
||||
return r;
|
||||
} else {
|
||||
command_print(CMD_CTX, "sam4-gpnvm invalid GPNVM: %u", who);
|
||||
command_print(CMD, "sam4-gpnvm invalid GPNVM: %u", who);
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
if (who == -1) {
|
||||
command_print(CMD_CTX, "Missing GPNVM number");
|
||||
command_print(CMD, "Missing GPNVM number");
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
|
||||
@@ -3153,7 +3153,7 @@ showall:
|
||||
(0 == strcmp("clear", CMD_ARGV[0]))) /* quietly accept both */
|
||||
r = FLASHD_ClrGPNVM(&(pChip->details.bank[0]), who);
|
||||
else {
|
||||
command_print(CMD_CTX, "Unknown command: %s", CMD_ARGV[0]);
|
||||
command_print(CMD, "Unknown command: %s", CMD_ARGV[0]);
|
||||
r = ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
return r;
|
||||
@@ -3178,7 +3178,7 @@ COMMAND_HANDLER(sam4_handle_slowclk_command)
|
||||
COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], v);
|
||||
if (v > 200000) {
|
||||
/* absurd slow clock of 200Khz? */
|
||||
command_print(CMD_CTX, "Absurd/illegal slow clock freq: %d\n", (int)(v));
|
||||
command_print(CMD, "Absurd/illegal slow clock freq: %d\n", (int)(v));
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
pChip->cfg.slow_freq = v;
|
||||
@@ -3186,11 +3186,11 @@ COMMAND_HANDLER(sam4_handle_slowclk_command)
|
||||
}
|
||||
default:
|
||||
/* error */
|
||||
command_print(CMD_CTX, "Too many parameters");
|
||||
command_print(CMD, "Too many parameters");
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
break;
|
||||
}
|
||||
command_print(CMD_CTX, "Slowclk freq: %d.%03dkhz",
|
||||
command_print(CMD, "Slowclk freq: %d.%03dkhz",
|
||||
(int)(pChip->cfg.slow_freq / 1000),
|
||||
(int)(pChip->cfg.slow_freq % 1000));
|
||||
return ERROR_OK;
|
||||
|
||||
@@ -1067,7 +1067,7 @@ COMMAND_HANDLER(at91sam7_handle_gpnvm_command)
|
||||
if (bank == NULL)
|
||||
return ERROR_FLASH_BANK_INVALID;
|
||||
if (strcmp(bank->driver->name, "at91sam7")) {
|
||||
command_print(CMD_CTX, "not an at91sam7 flash bank '%s'", CMD_ARGV[0]);
|
||||
command_print(CMD, "not an at91sam7 flash bank '%s'", CMD_ARGV[0]);
|
||||
return ERROR_FLASH_BANK_INVALID;
|
||||
}
|
||||
if (bank->target->state != TARGET_HALTED) {
|
||||
@@ -1091,7 +1091,7 @@ COMMAND_HANDLER(at91sam7_handle_gpnvm_command)
|
||||
|
||||
COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], bit);
|
||||
if ((bit < 0) || (bit >= at91sam7_info->num_nvmbits)) {
|
||||
command_print(CMD_CTX,
|
||||
command_print(CMD,
|
||||
"gpnvm bit '#%s' is out of bounds for target %s",
|
||||
CMD_ARGV[0],
|
||||
at91sam7_info->target_name);
|
||||
|
||||
@@ -947,9 +947,9 @@ COMMAND_HANDLER(samd_handle_chip_erase_command)
|
||||
* perform the erase. */
|
||||
res = target_write_u8(target, SAMD_DSU + SAMD_DSU_CTRL_EXT, (1<<4));
|
||||
if (res == ERROR_OK)
|
||||
command_print(CMD_CTX, "chip erase started");
|
||||
command_print(CMD, "chip erase started");
|
||||
else
|
||||
command_print(CMD_CTX, "write to DSU CTRL failed");
|
||||
command_print(CMD, "write to DSU CTRL failed");
|
||||
}
|
||||
|
||||
return res;
|
||||
@@ -961,7 +961,7 @@ COMMAND_HANDLER(samd_handle_set_security_command)
|
||||
struct target *target = get_current_target(CMD_CTX);
|
||||
|
||||
if (CMD_ARGC < 1 || (CMD_ARGC >= 1 && (strcmp(CMD_ARGV[0], "enable")))) {
|
||||
command_print(CMD_CTX, "supply the \"enable\" argument to proceed.");
|
||||
command_print(CMD, "supply the \"enable\" argument to proceed.");
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
|
||||
@@ -975,9 +975,9 @@ COMMAND_HANDLER(samd_handle_set_security_command)
|
||||
|
||||
/* Check (and clear) error conditions */
|
||||
if (res == ERROR_OK)
|
||||
command_print(CMD_CTX, "chip secured on next power-cycle");
|
||||
command_print(CMD, "chip secured on next power-cycle");
|
||||
else
|
||||
command_print(CMD_CTX, "failed to secure chip");
|
||||
command_print(CMD, "failed to secure chip");
|
||||
}
|
||||
|
||||
return res;
|
||||
@@ -1008,7 +1008,7 @@ COMMAND_HANDLER(samd_handle_eeprom_command)
|
||||
}
|
||||
|
||||
if (code > 6) {
|
||||
command_print(CMD_CTX, "Invalid EEPROM size. Please see "
|
||||
command_print(CMD, "Invalid EEPROM size. Please see "
|
||||
"datasheet for a list valid sizes.");
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
@@ -1022,10 +1022,10 @@ COMMAND_HANDLER(samd_handle_eeprom_command)
|
||||
uint32_t size = ((val >> 4) & 0x7); /* grab size code */
|
||||
|
||||
if (size == 0x7)
|
||||
command_print(CMD_CTX, "EEPROM is disabled");
|
||||
command_print(CMD, "EEPROM is disabled");
|
||||
else {
|
||||
/* Otherwise, 6 is 256B, 0 is 16KB */
|
||||
command_print(CMD_CTX, "EEPROM size is %u bytes",
|
||||
command_print(CMD, "EEPROM size is %u bytes",
|
||||
(2 << (13 - size)));
|
||||
}
|
||||
}
|
||||
@@ -1038,7 +1038,7 @@ COMMAND_HANDLER(samd_handle_eeprom_command)
|
||||
static COMMAND_HELPER(get_u64_from_hexarg, unsigned int num, uint64_t *value)
|
||||
{
|
||||
if (num >= CMD_ARGC) {
|
||||
command_print(CMD_CTX, "Too few Arguments.");
|
||||
command_print(CMD, "Too few Arguments.");
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
|
||||
@@ -1049,12 +1049,12 @@ static COMMAND_HELPER(get_u64_from_hexarg, unsigned int num, uint64_t *value)
|
||||
*value = strtoull(&(CMD_ARGV[num][2]), &check, 16);
|
||||
if ((value == 0 && errno == ERANGE) ||
|
||||
check == NULL || *check != 0) {
|
||||
command_print(CMD_CTX, "Invalid 64-bit hex value in argument %d.",
|
||||
command_print(CMD, "Invalid 64-bit hex value in argument %d.",
|
||||
num + 1);
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
} else {
|
||||
command_print(CMD_CTX, "Argument %d needs to be a hex value.", num + 1);
|
||||
command_print(CMD, "Argument %d needs to be a hex value.", num + 1);
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
return ERROR_OK;
|
||||
@@ -1067,7 +1067,7 @@ COMMAND_HANDLER(samd_handle_nvmuserrow_command)
|
||||
|
||||
if (target) {
|
||||
if (CMD_ARGC > 2) {
|
||||
command_print(CMD_CTX, "Too much Arguments given.");
|
||||
command_print(CMD, "Too much Arguments given.");
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
|
||||
@@ -1105,7 +1105,7 @@ COMMAND_HANDLER(samd_handle_nvmuserrow_command)
|
||||
uint64_t value;
|
||||
res = read_userrow(target, &value);
|
||||
if (res == ERROR_OK)
|
||||
command_print(CMD_CTX, "NVMUSERROW: 0x%016"PRIX64, value);
|
||||
command_print(CMD, "NVMUSERROW: 0x%016"PRIX64, value);
|
||||
else
|
||||
LOG_ERROR("NVMUSERROW could not be read.");
|
||||
}
|
||||
@@ -1145,7 +1145,7 @@ COMMAND_HANDLER(samd_handle_bootloader_command)
|
||||
}
|
||||
|
||||
if (code > 6) {
|
||||
command_print(CMD_CTX, "Invalid bootloader size. Please "
|
||||
command_print(CMD, "Invalid bootloader size. Please "
|
||||
"see datasheet for a list valid sizes.");
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
@@ -1166,7 +1166,7 @@ COMMAND_HANDLER(samd_handle_bootloader_command)
|
||||
nb = (2 << (8 - size)) * page_size;
|
||||
|
||||
/* There are 4 pages per row */
|
||||
command_print(CMD_CTX, "Bootloader size is %" PRIu32 " bytes (%" PRIu32 " rows)",
|
||||
command_print(CMD, "Bootloader size is %" PRIu32 " bytes (%" PRIu32 " rows)",
|
||||
nb, (uint32_t)(nb / (page_size * 4)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -765,9 +765,9 @@ COMMAND_HANDLER(same5_handle_chip_erase_command)
|
||||
* perform the erase. */
|
||||
int res = target_write_u8(target, SAMD_DSU + SAMD_DSU_CTRL_EXT, (1<<4));
|
||||
if (res == ERROR_OK)
|
||||
command_print(CMD_CTX, "chip erase started");
|
||||
command_print(CMD, "chip erase started");
|
||||
else
|
||||
command_print(CMD_CTX, "write to DSU CTRL failed");
|
||||
command_print(CMD, "write to DSU CTRL failed");
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -781,7 +781,7 @@ COMMAND_HANDLER(same5_handle_userpage_command)
|
||||
return ERROR_FAIL;
|
||||
|
||||
if (CMD_ARGC > 2) {
|
||||
command_print(CMD_CTX, "Too much Arguments given.");
|
||||
command_print(CMD, "Too much Arguments given.");
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
|
||||
@@ -806,7 +806,7 @@ COMMAND_HANDLER(same5_handle_userpage_command)
|
||||
int res2 = target_read_memory(target, SAMD_USER_ROW, 4, 2, buffer);
|
||||
if (res2 == ERROR_OK) {
|
||||
uint64_t value = target_buffer_get_u64(target, buffer);
|
||||
command_print(CMD_CTX, "USER PAGE: 0x%016"PRIX64, value);
|
||||
command_print(CMD, "USER PAGE: 0x%016"PRIX64, value);
|
||||
} else {
|
||||
LOG_ERROR("USER PAGE could not be read.");
|
||||
}
|
||||
@@ -829,7 +829,7 @@ COMMAND_HANDLER(same5_handle_bootloader_command)
|
||||
unsigned long size = strtoul(CMD_ARGV[0], NULL, 0);
|
||||
uint32_t code = (size + 8191) / 8192;
|
||||
if (code > 15) {
|
||||
command_print(CMD_CTX, "Invalid bootloader size. Please "
|
||||
command_print(CMD, "Invalid bootloader size. Please "
|
||||
"see datasheet for a list valid sizes.");
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
@@ -842,7 +842,7 @@ COMMAND_HANDLER(same5_handle_bootloader_command)
|
||||
if (res2 == ERROR_OK) {
|
||||
uint32_t code = (val >> 26) & 0xf; /* grab size code */
|
||||
uint32_t size = (15 - code) * 8192;
|
||||
command_print(CMD_CTX, "Bootloader protected in the first %"
|
||||
command_print(CMD, "Bootloader protected in the first %"
|
||||
PRIu32 " bytes", size);
|
||||
}
|
||||
|
||||
|
||||
@@ -672,22 +672,22 @@ showall:
|
||||
r = samv_get_gpnvm(target, x, &v);
|
||||
if (r != ERROR_OK)
|
||||
break;
|
||||
command_print(CMD_CTX, "samv-gpnvm%u: %u", x, v);
|
||||
command_print(CMD, "samv-gpnvm%u: %u", x, v);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
if ((who >= 0) && (((unsigned)who) < SAMV_NUM_GPNVM_BITS)) {
|
||||
r = samv_get_gpnvm(target, who, &v);
|
||||
command_print(CMD_CTX, "samv-gpnvm%u: %u", who, v);
|
||||
command_print(CMD, "samv-gpnvm%u: %u", who, v);
|
||||
return r;
|
||||
} else {
|
||||
command_print(CMD_CTX, "invalid gpnvm: %u", who);
|
||||
command_print(CMD, "invalid gpnvm: %u", who);
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
if (who == -1) {
|
||||
command_print(CMD_CTX, "missing gpnvm number");
|
||||
command_print(CMD, "missing gpnvm number");
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
|
||||
@@ -696,7 +696,7 @@ showall:
|
||||
else if (!strcmp("clr", CMD_ARGV[0]) || !strcmp("clear", CMD_ARGV[0]))
|
||||
r = samv_clear_gpnvm(target, who);
|
||||
else {
|
||||
command_print(CMD_CTX, "unknown command: %s", CMD_ARGV[0]);
|
||||
command_print(CMD, "unknown command: %s", CMD_ARGV[0]);
|
||||
r = ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
return r;
|
||||
|
||||
@@ -433,9 +433,9 @@ COMMAND_HANDLER(avrf_handle_mass_erase_command)
|
||||
for (i = 0; i < bank->num_sectors; i++)
|
||||
bank->sectors[i].is_erased = 1;
|
||||
|
||||
command_print(CMD_CTX, "avr mass erase complete");
|
||||
command_print(CMD, "avr mass erase complete");
|
||||
} else
|
||||
command_print(CMD_CTX, "avr mass erase failed");
|
||||
command_print(CMD, "avr mass erase failed");
|
||||
|
||||
LOG_DEBUG("%s", __func__);
|
||||
return ERROR_OK;
|
||||
|
||||
@@ -1093,7 +1093,7 @@ COMMAND_HANDLER(efm32x_handle_debuglock_command)
|
||||
return retval;
|
||||
}
|
||||
|
||||
command_print(CMD_CTX, "efm32x debug interface locked, reset the device to apply");
|
||||
command_print(CMD, "efm32x debug interface locked, reset the device to apply");
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
@@ -776,7 +776,7 @@ COMMAND_HANDLER(em357_handle_lock_command)
|
||||
}
|
||||
|
||||
if (em357_erase_options(bank) != ERROR_OK) {
|
||||
command_print(CMD_CTX, "em357 failed to erase options");
|
||||
command_print(CMD, "em357 failed to erase options");
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
@@ -784,11 +784,11 @@ COMMAND_HANDLER(em357_handle_lock_command)
|
||||
em357_info->option_bytes.RDP = 0;
|
||||
|
||||
if (em357_write_options(bank) != ERROR_OK) {
|
||||
command_print(CMD_CTX, "em357 failed to lock device");
|
||||
command_print(CMD, "em357 failed to lock device");
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
command_print(CMD_CTX, "em357 locked");
|
||||
command_print(CMD, "em357 locked");
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
@@ -813,16 +813,16 @@ COMMAND_HANDLER(em357_handle_unlock_command)
|
||||
}
|
||||
|
||||
if (em357_erase_options(bank) != ERROR_OK) {
|
||||
command_print(CMD_CTX, "em357 failed to unlock device");
|
||||
command_print(CMD, "em357 failed to unlock device");
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
if (em357_write_options(bank) != ERROR_OK) {
|
||||
command_print(CMD_CTX, "em357 failed to lock device");
|
||||
command_print(CMD, "em357 failed to lock device");
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
command_print(CMD_CTX, "em357 unlocked.\n"
|
||||
command_print(CMD, "em357 unlocked.\n"
|
||||
"INFO: a reset or power cycle is required "
|
||||
"for the new settings to take effect.");
|
||||
|
||||
@@ -886,9 +886,9 @@ COMMAND_HANDLER(em357_handle_mass_erase_command)
|
||||
for (i = 0; i < bank->num_sectors; i++)
|
||||
bank->sectors[i].is_erased = 1;
|
||||
|
||||
command_print(CMD_CTX, "em357 mass erase complete");
|
||||
command_print(CMD, "em357 mass erase complete");
|
||||
} else
|
||||
command_print(CMD_CTX, "em357 mass erase failed");
|
||||
command_print(CMD, "em357 mass erase failed");
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -516,7 +516,7 @@ COMMAND_HANDLER(handle_esirisc_flash_mass_erase_command)
|
||||
|
||||
retval = esirisc_flash_mass_erase(bank);
|
||||
|
||||
command_print(CMD_CTX, "mass erase %s",
|
||||
command_print(CMD, "mass erase %s",
|
||||
(retval == ERROR_OK) ? "successful" : "failed");
|
||||
|
||||
return retval;
|
||||
@@ -536,7 +536,7 @@ COMMAND_HANDLER(handle_esirisc_flash_ref_erase_command)
|
||||
|
||||
retval = esirisc_flash_ref_erase(bank);
|
||||
|
||||
command_print(CMD_CTX, "erase reference cell %s",
|
||||
command_print(CMD, "erase reference cell %s",
|
||||
(retval == ERROR_OK) ? "successful" : "failed");
|
||||
|
||||
return retval;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user