X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Ftarget%2Ftarget.c;h=4d277c694b85412d0be46d1ee36f920cf0b22609;hp=f5a8666b6e2566b5bd49e950561bb49d784e0a35;hb=cd74dd28911353674e599744c1acce8bf3a6a7a7;hpb=0cb9778368ddda6dc193752034de6f8aafeb2454;ds=sidebyside diff --git a/src/target/target.c b/src/target/target.c index f5a8666b6e..4d277c694b 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -1274,6 +1274,10 @@ COMMAND_HANDLER(handle_target_init_command) if (ERROR_OK != retval) return retval; + retval = command_run_line(CMD_CTX, "init_target_events"); + if (ERROR_OK != retval) + return retval; + retval = command_run_line(CMD_CTX, "init_board"); if (ERROR_OK != retval) return retval; @@ -2414,8 +2418,12 @@ static int handle_target(void *priv) return retval; } /* Since we succeeded, we reset backoff count */ - if (target->backoff.times > 0) - LOG_USER("Polling target %s succeeded again", target_name(target)); + if (target->backoff.times > 0) { + LOG_USER("Polling target %s succeeded again, trying to reexamine", target_name(target)); + target_reset_examined(target); + target_examine_one(target); + } + target->backoff.times = 0; } } @@ -3186,7 +3194,7 @@ static COMMAND_HELPER(handle_verify_image_command_internal, int verify) if (diffs == 0) LOG_ERROR("checksum mismatch - attempting binary compare"); - data = (uint8_t *)malloc(buf_cnt); + data = malloc(buf_cnt); /* Can we use 32bit word accesses? */ int size = 1; @@ -5098,7 +5106,7 @@ static int target_create(Jim_GetOptInfo *goi) target->target_number = new_target_number(); /* allocate memory for each unique target type */ - target->type = (struct target_type *)calloc(1, sizeof(struct target_type)); + target->type = calloc(1, sizeof(struct target_type)); memcpy(target->type, target_types[x], sizeof(struct target_type)); @@ -5484,7 +5492,7 @@ COMMAND_HANDLER(handle_fast_load_image_command) image_size = 0x0; retval = ERROR_OK; fastload_num = image.num_sections; - fastload = (struct FastLoad *)malloc(sizeof(struct FastLoad)*image.num_sections); + fastload = malloc(sizeof(struct FastLoad)*image.num_sections); if (fastload == NULL) { command_print(CMD_CTX, "out of memory"); image_close(&image); @@ -5708,7 +5716,7 @@ COMMAND_HANDLER(handle_test_mem_access_command) read_buf[i] = read_ref[i]; } command_print_sameline(CMD_CTX, - "Test read %d x %d @ %d to %saligned buffer: ", count, + "Test read %" PRIu32 " x %d @ %d to %saligned buffer: ", count, size, offset, host_offset ? "un" : ""); struct duration bench; @@ -5780,7 +5788,7 @@ out: for (size_t i = 0; i < host_bufsiz; i++) write_buf[i] = rand(); command_print_sameline(CMD_CTX, - "Test write %d x %d @ %d from %saligned buffer: ", count, + "Test write %" PRIu32 " x %d @ %d from %saligned buffer: ", count, size, offset, host_offset ? "un" : ""); retval = target_write_memory(target, wa->address, 1, num_bytes, test_pattern);