#include "transport/transport.h"
#include "arm_cti.h"
#include "smp.h"
+#include "semihosting_common.h"
/* default halt wait timeout (ms) */
#define DEFAULT_HALT_TIMEOUT 5000
extern struct target_type nds32_v2_target;
extern struct target_type nds32_v3_target;
extern struct target_type nds32_v3m_target;
+extern struct target_type esp32_target;
+extern struct target_type esp32s2_target;
+extern struct target_type esp32s3_target;
extern struct target_type or1k_target;
extern struct target_type quark_x10xx_target;
extern struct target_type quark_d20xx_target;
&nds32_v2_target,
&nds32_v3_target,
&nds32_v3m_target,
+ &esp32_target,
+ &esp32s2_target,
+ &esp32s3_target,
&or1k_target,
&quark_x10xx_target,
&quark_d20xx_target,
if (target->type->deinit_target)
target->type->deinit_target(target);
+ if (target->semihosting)
+ free(target->semihosting->basedir);
free(target->semihosting);
jtag_unregister_event_callback(jtag_enable_callback, target);
}
if (!target->type->blank_check_memory)
- return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
+ return ERROR_NOT_IMPLEMENTED;
return target->type->blank_check_memory(target, blocks, num_blocks, erased_value);
}
{
struct target *target = get_current_target(CMD_CTX);
- LOG_USER("requesting target halt and executing a soft reset");
+ LOG_TARGET_INFO(target, "requesting target halt and executing a soft reset");
target_soft_reset_halt(target);
if (breakpoint->type == BKPT_SOFT) {
char *buf = buf_to_hex_str(breakpoint->orig_instr,
breakpoint->length);
- command_print(cmd, "IVA breakpoint: " TARGET_ADDR_FMT ", 0x%x, %i, 0x%s",
+ command_print(cmd, "IVA breakpoint: " TARGET_ADDR_FMT ", 0x%x, 0x%s",
breakpoint->address,
breakpoint->length,
- breakpoint->set, buf);
+ buf);
free(buf);
} else {
if ((breakpoint->address == 0) && (breakpoint->asid != 0))
- command_print(cmd, "Context breakpoint: 0x%8.8" PRIx32 ", 0x%x, %i",
+ command_print(cmd, "Context breakpoint: 0x%8.8" PRIx32 ", 0x%x, %u",
breakpoint->asid,
- breakpoint->length, breakpoint->set);
+ breakpoint->length, breakpoint->number);
else if ((breakpoint->address != 0) && (breakpoint->asid != 0)) {
- command_print(cmd, "Hybrid breakpoint(IVA): " TARGET_ADDR_FMT ", 0x%x, %i",
+ command_print(cmd, "Hybrid breakpoint(IVA): " TARGET_ADDR_FMT ", 0x%x, %u",
breakpoint->address,
- breakpoint->length, breakpoint->set);
+ breakpoint->length, breakpoint->number);
command_print(cmd, "\t|--->linked with ContextID: 0x%8.8" PRIx32,
breakpoint->asid);
} else
- command_print(cmd, "Breakpoint(IVA): " TARGET_ADDR_FMT ", 0x%x, %i",
+ command_print(cmd, "Breakpoint(IVA): " TARGET_ADDR_FMT ", 0x%x, %u",
breakpoint->address,
- breakpoint->length, breakpoint->set);
+ breakpoint->length, breakpoint->number);
}
breakpoint = breakpoint->next;
return result;
}
-static int jim_mem2array(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
-{
- struct command_context *context;
- struct target *target;
-
- context = current_command_context(interp);
- assert(context);
-
- target = get_current_target(context);
- if (!target) {
- LOG_ERROR("mem2array: no current target");
- return JIM_ERR;
- }
-
- return target_mem2array(interp, target, argc - 1, argv + 1);
-}
-
static int target_mem2array(Jim_Interp *interp, struct target *target, int argc, Jim_Obj *const *argv)
{
int e;
+ LOG_WARNING("DEPRECATED! use 'read_memory' not 'mem2array'");
+
/* argv[0] = name of array to receive the data
* argv[1] = desired element width in bits
* argv[2] = memory address
return result;
}
-static int jim_array2mem(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
-{
- struct command_context *context;
- struct target *target;
-
- context = current_command_context(interp);
- assert(context);
-
- target = get_current_target(context);
- if (!target) {
- LOG_ERROR("array2mem: no current target");
- return JIM_ERR;
- }
-
- return target_array2mem(interp, target, argc-1, argv + 1);
-}
-
static int target_array2mem(Jim_Interp *interp, struct target *target,
int argc, Jim_Obj *const *argv)
{
int e;
+ LOG_WARNING("DEPRECATED! use 'write_memory' not 'array2mem'");
+
/* argv[0] = name of array from which to read the data
* argv[1] = desired element width in bits
* argv[2] = memory address
}
int tmp;
+#if JIM_VERSION >= 80
Jim_Obj **dict = Jim_DictPairs(interp, argv[1], &tmp);
if (!dict)
return JIM_ERR;
+#else
+ Jim_Obj **dict;
+ int ret = Jim_DictPairs(interp, argv[1], &dict, &tmp);
+
+ if (ret != JIM_OK)
+ return ret;
+#endif
const unsigned int length = tmp;
struct command_context *cmd_ctx = current_command_context(interp);
int i;
const char *targetname;
int retval, len;
+ static int smp_group = 1;
struct target *target = NULL;
struct target_list *head, *new;
/* now parse the list of cpu and put the target in smp mode*/
foreach_smp_target(head, lh) {
target = head->target;
- target->smp = 1;
+ target->smp = smp_group;
target->smp_targets = lh;
}
+ smp_group++;
if (target && target->rtos)
- retval = rtos_smp_init(head->target);
+ retval = rtos_smp_init(target);
return retval;
}
.mode = COMMAND_EXEC,
.usage = "filename [offset [type]]",
},
- {
- .name = "mem2array",
- .mode = COMMAND_EXEC,
- .jim_handler = jim_mem2array,
- .help = "read 8/16/32 bit memory and return as a TCL array "
- "for script processing",
- .usage = "arrayname bitwidth address count",
- },
- {
- .name = "array2mem",
- .mode = COMMAND_EXEC,
- .jim_handler = jim_array2mem,
- .help = "convert a TCL array to memory locations "
- "and write the 8/16/32 bit values",
- .usage = "arrayname bitwidth address count",
- },
{
.name = "get_reg",
.mode = COMMAND_EXEC,