X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Ftarget%2Ftarget.c;h=0a44e7b37370891ec41773a9601278e302ad06f0;hp=d5e4ea56ef2812635b3c983e4c0488277e287766;hb=938e01d0c3ff4fedf1629cc1c1928af1c90882e9;hpb=52377759a2c5c6a291c9bbd110a7f9efca4e1e46 diff --git a/src/target/target.c b/src/target/target.c index d5e4ea56ef..0a44e7b373 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -394,18 +394,19 @@ int target_process_reset(struct command_context_s *cmd_ctx) target = target->next; } + if ((retval = jtag_execute_queue()) != ERROR_OK) + { + LOG_WARNING("JTAG communication failed while deasserting reset."); + retval = ERROR_OK; + } + if (jtag_reset_config & RESET_SRST_PULLS_TRST) { /* If TRST was asserted we need to set up registers again */ if ((retval = target_examine(cmd_ctx)) != ERROR_OK) return retval; - } + } - if ((retval = jtag_execute_queue()) != ERROR_OK) - { - LOG_WARNING("JTAG communication failed while deasserting reset."); - retval = ERROR_OK; - } LOG_DEBUG("Waiting for halted stated as approperiate"); @@ -748,21 +749,24 @@ static int target_call_timer_callbacks_check_time(int checktime) (((now.tv_sec >= callback->when.tv_sec) && (now.tv_usec >= callback->when.tv_usec)) || (now.tv_sec > callback->when.tv_sec))) { - callback->callback(callback->priv); - if (callback->periodic) + if(callback->callback != NULL) { - int time_ms = callback->time_ms; - callback->when.tv_usec = now.tv_usec + (time_ms % 1000) * 1000; - time_ms -= (time_ms % 1000); - callback->when.tv_sec = now.tv_sec + time_ms / 1000; - if (callback->when.tv_usec > 1000000) + callback->callback(callback->priv); + if (callback->periodic) { - callback->when.tv_usec = callback->when.tv_usec - 1000000; - callback->when.tv_sec += 1; + int time_ms = callback->time_ms; + callback->when.tv_usec = now.tv_usec + (time_ms % 1000) * 1000; + time_ms -= (time_ms % 1000); + callback->when.tv_sec = now.tv_sec + time_ms / 1000; + if (callback->when.tv_usec > 1000000) + { + callback->when.tv_usec = callback->when.tv_usec - 1000000; + callback->when.tv_sec += 1; + } } + else + target_unregister_timer_callback(callback->callback, callback->priv); } - else - target_unregister_timer_callback(callback->callback, callback->priv); } callback = next_callback; @@ -1132,6 +1136,23 @@ int target_checksum_memory(struct target_s *target, u32 address, u32 size, u32* return retval; } +int target_blank_check_memory(struct target_s *target, u32 address, u32 size, u32* blank) +{ + int retval; + if (!target->type->examined) + { + LOG_ERROR("Target not examined yet"); + return ERROR_FAIL; + } + + if (target->type->blank_check_memory == 0) + return ERROR_TARGET_RESOURCE_NOT_AVAILABLE; + + retval = target->type->blank_check_memory(target, address, size, blank); + + return retval; +} + int target_read_u32(struct target_s *target, u32 address, u32 *value) { u8 value_buf[4]; @@ -2400,7 +2421,7 @@ int handle_wp_command(struct command_context_s *cmd_ctx, char *cmd, char **args, while (watchpoint) { - command_print(cmd_ctx, "address: 0x%8.8x, mask: 0x%8.8x, r/w/a: %i, value: 0x%8.8x, mask: 0x%8.8x", watchpoint->address, watchpoint->length, watchpoint->rw, watchpoint->value, watchpoint->mask); + command_print(cmd_ctx, "address: 0x%8.8x, len: 0x%8.8x, r/w/a: %i, value: 0x%8.8x, mask: 0x%8.8x", watchpoint->address, watchpoint->length, watchpoint->rw, watchpoint->value, watchpoint->mask); watchpoint = watchpoint->next; } }